/* ============================================================
   Корзина РВД/Комплект
   ============================================================ */

:root {
	--rvd-teal: #44717b;
	--rvd-red: #e64949;
	--rvd-blue: #2ca6d9;
}

/* --- Кнопка-корзина в шапке (десктоп, на месте «Заявка на оборудование») --- */
.rvd-cart-btn {
	cursor: pointer;
	gap: 8px;
	padding: 0 14px;
	white-space: nowrap;
	width: auto;
	min-width: 150px;
	max-width: 240px;
}
.rvd-cart-btn.is-filled .rvd-cart-label { display: none; }
/* тема задаёт .button-58 > * { display:block } — возвращаем управление через [hidden] */
.rvd-cart-btn > *,
#rvd-cart-fab > * { display: inline-flex; }
.rvd-cart-btn [hidden],
#rvd-cart-fab [hidden] { display: none !important; }
.rvd-cart-btn .rvd-cart-ico {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	fill: currentColor;
}
.rvd-cart-btn .rvd-cart-label { display: inline-block; }
.rvd-cart-btn .rvd-cart-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--rvd-red);
	color: #fff;
	font-size: 12px;
	line-height: 18px;
	font-weight: 700;
}
.rvd-cart-btn .rvd-cart-sum {
	font-weight: 700;
	letter-spacing: 0;
}
.rvd-cart-btn.is-filled { color: #fff; }

/* --- Плавающая кнопка (мобайл / планшет) --- */
#rvd-cart-fab {
	position: fixed;
	right: 18px;
	bottom: 90px;
	z-index: 900;
	box-sizing: border-box;
	width: 56px;
	height: 56px;
	min-width: 56px;
	min-height: 56px;
	max-width: 56px;
	max-height: 56px;
	padding: 0;
	border-radius: 50%;
	background: var(--rvd-teal);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
	display: none;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-decoration: none;
}
#rvd-cart-fab .rvd-cart-ico { width: 26px; height: 26px; fill: #fff; }
#rvd-cart-fab .rvd-cart-badge {
	position: absolute;
	top: -4px;
	right: 2px;
	min-width: 10px;
	height: 20px;
	padding: 0 5px 0 7px;
	border-radius: 10px;
	background: var(--rvd-red);
	color: #fff;
	font-size: 12px;
	line-height: 20px;
	font-weight: 700;
	text-align: center;
}
@media (max-width: 1200px) {
	#rvd-cart-fab.is-visible { display: flex; }
}

/* --- Выезжающая панель корзины --- */
#rvd-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 1100;
	visibility: hidden;
	pointer-events: none;
}
#rvd-cart-drawer.is-open { visibility: visible; pointer-events: auto; }
#rvd-cart-drawer .rvd-drawer-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	opacity: 0;
	transition: opacity .2s ease;
}
#rvd-cart-drawer.is-open .rvd-drawer-overlay { opacity: 1; }
#rvd-cart-drawer .rvd-drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 420px;
	max-width: 92vw;
	background: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .25s ease;
	box-shadow: -4px 0 20px rgba(0, 0, 0, .25);
}
#rvd-cart-drawer.is-open .rvd-drawer-panel { transform: translateX(0); }
.rvd-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	background: var(--rvd-teal);
	color: #fff;
}
.rvd-drawer-head h3 { margin: 0; font-size: 18px; font-weight: 600; color: #fff; }
.rvd-drawer-close {
	background: none;
	border: 0;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
.rvd-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 18px; }
.rvd-cart-empty { text-align: center; color: #666; margin: 40px 0 8px; }
.rvd-cart-empty-hint { text-align: center; }
.rvd-cart-empty-hint a { color: var(--rvd-blue); }

.rvd-cart-list { list-style: none; margin: 0; padding: 0; }
.rvd-cart-item {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 10px;
	padding: 14px 0;
	border-bottom: 1px solid #eee;
	align-items: start;
}
.rvd-ci-img { display: block; width: 64px; height: 64px; }
.rvd-ci-img img { width: 64px; height: 64px; object-fit: contain; }
.rvd-ci-img--empty { background: #f3f3f3; border-radius: 4px; }
.rvd-ci-title {
	display: block;
	font-size: 13px;
	line-height: 1.35;
	color: #222;
	text-decoration: none;
}
.rvd-ci-title:hover { color: var(--rvd-blue); }
.rvd-ci-price { font-size: 13px; color: #444; margin: 4px 0 6px; }
.rvd-ci-price s { color: #999; margin-left: 4px; }
.rvd-ci-controls { display: flex; align-items: center; gap: 10px; }
.rvd-qty { display: inline-flex; border: 1px solid #d5d5d5; border-radius: 4px; overflow: hidden; }
.rvd-qty button {
	width: 26px;
	height: 26px;
	border: 0;
	background: #f5f5f5;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	color: #333;
}
.rvd-qty button:hover { background: #e9e9e9; }
.rvd-qty-val {
	width: 34px;
	height: 26px;
	border: 0;
	border-left: 1px solid #d5d5d5;
	border-right: 1px solid #d5d5d5;
	text-align: center;
	font-size: 13px;
	padding: 0;
	-moz-appearance: textfield;
}
.rvd-ci-remove {
	border: 0;
	background: none;
	color: #999;
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}
.rvd-ci-remove:hover { color: var(--rvd-red); }
.rvd-ci-sum { font-size: 13px; font-weight: 700; color: #222; white-space: nowrap; }

.rvd-drawer-foot { border-top: 2px solid #eee; padding: 16px 18px; }
.rvd-drawer-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 16px;
	margin-bottom: 4px;
}
.rvd-drawer-total b { font-size: 20px; color: #222; }
#rvd-cart-note { font-size: 12px; color: #888; margin: 0 0 12px; }
.rvd-drawer-actions { display: flex; gap: 10px; }
.rvd-btn {
	display: inline-block;
	border: 0;
	border-radius: 3px;
	padding: 12px 16px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
}
.rvd-btn--primary { background: var(--rvd-red); color: #fff; flex: 1 1 auto; }
.rvd-btn--primary:hover { background: #d13c3c; color: #fff; }
.rvd-btn--ghost { background: #eee; color: #555; }
.rvd-btn--ghost:hover { background: #e0e0e0; }

/* --- Модалка оформления (использует .modal из footer.php) --- */
#rvd-order-modal.rvd-open { opacity: 1; pointer-events: auto; overflow-y: auto; }
#rvd-order-modal .modal-dialog { max-width: 560px; }
#rvd-order-modal h2 { text-align: center; margin: 26px 0 6px; font-weight: 600; font-size: 22px; }
.rvd-order-table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; font-size: 13px; }
.rvd-order-table th, .rvd-order-table td { padding: 7px 8px; border-bottom: 1px solid #eee; text-align: left; }
.rvd-order-table th { color: #888; font-weight: 600; }
.rvd-order-table .rvd-ot-qty, .rvd-order-table .rvd-ot-price, .rvd-order-table .rvd-ot-sum { white-space: nowrap; text-align: right; }
.rvd-order-total-row { display: flex; justify-content: flex-end; gap: 12px; align-items: baseline; padding: 8px; font-size: 15px; }
.rvd-order-total-row b { font-size: 20px; }
#rvd-order-note { font-size: 12px; color: #888; padding: 0 8px 6px; }
#rvd-order-form { text-align: center; }
#rvd-order-form input[type="text"],
#rvd-order-form input[type="email"],
#rvd-order-form textarea {
	width: 90%;
	height: auto;
	margin: 8px auto;
	padding: 10px;
	box-sizing: border-box;
}
#rvd-order-form textarea { height: auto; resize: none; }
#rvd-order-form .rvd-btn--primary { width: auto; height: auto; padding: 14px 40px; margin-top: 16px; }
#recaptcha3 > div { margin: 8px auto 12px; }
.rvd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* --- Тост --- */
#rvd-toast {
	position: fixed;
	left: 50%;
	bottom: 30px;
	transform: translate(-50%, 20px);
	z-index: 1200;
	background: #333;
	color: #fff;
	padding: 12px 22px;
	border-radius: 4px;
	font-size: 14px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
#rvd-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

body.rvd-noscroll { overflow: hidden; }

@media (max-width: 520px) {
	#rvd-cart-drawer .rvd-drawer-panel { width: 100%; max-width: 100%; }
	.rvd-order-table th:nth-child(3), .rvd-order-table td:nth-child(3) { display: none; }
}
