/* ── Появление при скролле ─────────────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ── Кнопки ────────────────────────────────────────────────────────────── */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 22px; border-radius: var(--r-pill);
	font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap;
	transition: transform var(--t-fast) var(--ease), background-color var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t) var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -12px var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -14px var(--accent); }
.btn--primary:active { transform: scale(0.96); }
.btn--soft { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn--soft:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--light { background: #fff; color: var(--accent); }
.btn--light:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(0,0,0,.5); }
.btn--text { min-height: 40px; padding: 0 12px; color: var(--muted); }
.btn--text:hover { color: var(--ink); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
	display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
	background: var(--surface); box-shadow: var(--shadow-sm);
	transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t) var(--ease);
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }

/* ── Чипы ──────────────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
	flex: none; min-height: 40px; padding: 0 18px; border-radius: var(--r-pill);
	background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500;
	box-shadow: inset 0 0 0 1px var(--line);
	transition: background-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.chip:hover { box-shadow: inset 0 0 0 1px rgba(20,23,43,.22); }
.chip:active { transform: scale(0.95); }
.chip.is-active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.chip--static { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; background: var(--surface-2); box-shadow: none; pointer-events: none; }

.badge {
	position: absolute; top: 12px; left: 12px; padding: 5px 11px; border-radius: var(--r-pill);
	font-size: 12px; font-weight: 600; background: var(--accent); color: var(--accent-ink);
}
.badge--new { background: #fff; color: var(--accent); box-shadow: var(--shadow-sm); }

.count-dot {
	display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
	border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600;
}

/* ── Шапка ─────────────────────────────────────────────────────────────── */
.site-header {
	position: sticky; top: 0; z-index: 50; height: var(--header-h);
	background: rgba(243, 243, 246, 0.94);
	-webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px);
	transition: box-shadow var(--t) var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.site-header__inner {
	position: relative; height: 100%; width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto;
	display: flex; align-items: center; justify-content: space-between;
}
.site-header__links { display: flex; gap: 24px; font-size: 15px; font-weight: 500; flex: 1; }
.site-header__links a { color: var(--muted); transition: color var(--t) var(--ease); }
.site-header__links a:hover { color: var(--ink); }
.site-wordmark { position: absolute; left: 50%; transform: translateX(-50%); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); }
.site-wordmark img { max-height: 32px; width: auto; }
.site-header__actions { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 18px; }
.site-header__acc { display: flex; color: var(--ink); transition: transform var(--t-fast) var(--ease); }
.site-header__acc:active { transform: scale(0.88); }
.site-header__cart { position: relative; display: flex; justify-content: flex-end; }
.site-header__cart > svg { transition: transform var(--t-fast) var(--ease); }
.site-header__cart:active > svg { transform: scale(0.88); }
.cart-badge {
	position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px;
	display: grid; place-items: center; border-radius: var(--r-pill);
	background: var(--accent); color: var(--accent-ink); font-size: 11px; font-style: normal; font-weight: 600;
}
.cart-badge.is-bump { animation: bump 0.4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.4); } }

/* ── Нижняя навигация (мобильная) ──────────────────────────────────────── */
.bottom-nav { display: none; }
@media (max-width: 767px) {
	.site-header__links { display: none; }
	.site-header__actions { display: none; }
	.site-header__inner { justify-content: center; }
	.bottom-nav {
		position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
		display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px;
		background: rgba(255, 255, 255, 0.96); border-radius: 26px; box-shadow: var(--shadow-md);
		-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	}
	.bottom-nav a, .bottom-nav button {
		position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
		padding: 8px 0; border-radius: 20px; font-size: 11px; font-weight: 500; color: var(--muted);
		transition: background-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease);
	}
	.bottom-nav a:active, .bottom-nav button:active { transform: scale(0.92); background: var(--surface-2); }
	.bottom-nav a.is-current { color: var(--accent); }
	.bottom-nav .cart-badge { top: 2px; right: calc(50% - 24px); }
}

/* ── Футер ─────────────────────────────────────────────────────────────── */
.site-footer { margin-top: clamp(56px, 8vw, 96px); padding: 40px 0 28px; border-top: 1px solid var(--line); }
.site-footer__inner { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer__brand { font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: -0.03em; }
.site-footer__text, .site-footer__contacts { color: var(--muted); font-size: 15px; }
.site-footer__contacts { display: grid; gap: 6px; }
.site-footer__contacts a { transition: color var(--t) var(--ease); }
.site-footer__contacts a:hover { color: var(--ink); }
.site-footer__copy { width: min(100% - var(--gutter) * 2, var(--max)); margin: 28px auto 0; font-size: 13px; color: var(--muted); }

/* ── Карточка товара (в сетке и каруселях) ─────────────────────────────── */
.product-card { min-width: 0; }
.product-card__link {
	display: flex; flex-direction: column; height: 100%;
	background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
	transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.product-card__link:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card__link:active { transform: scale(0.98); }
.product-card__media { position: relative; aspect-ratio: 1; background: #fff; overflow: hidden; }
.product-card__media img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.6s var(--ease); }
.product-card__link:hover .product-card__media img { transform: scale(1.05); }
.product-card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.product-card__brand { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.product-card__name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.product-card__type { font-size: 13px; color: var(--muted); }
.product-card__price { margin-top: auto; padding-top: 8px; font-weight: 700; }

/* Мобильная версия карточки: ниже фото, мельче шрифт, плотнее тексты */
@media (max-width: 767px) {
	.product-card__media { aspect-ratio: 1 / 0.8; }
	.product-card__body { padding: 10px 12px 14px; gap: 1px; }
	.product-card__brand { font-size: 10px; }
	.product-card__name { font-size: 18px; line-height: 1.2; }
	.product-card__type { font-size: 11.5px; }
	.product-card__price { padding-top: 5px; font-size: 14px; }
	.product-card .badge { top: 8px; left: 8px; padding: 4px 9px; font-size: 11px; }
}

/* ── Слои: шторки и модалки ────────────────────────────────────────────── */
.layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.layer__backdrop { position: absolute; inset: 0; background: rgba(10, 12, 28, 0.42); opacity: 0; transition: opacity var(--t) var(--ease); }
.layer.is-open .layer__backdrop { opacity: 1; }

.sheet {
	position: relative; display: flex; flex-direction: column; width: 100%; max-height: 92dvh;
	background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-md);
	transform: translateY(100%); transition: transform 0.45s var(--ease-sheet);
	padding-bottom: env(safe-area-inset-bottom);
}
.layer.is-open .sheet { transform: none; }
.sheet.is-dragging { transition: none; }
.sheet__topbar { position: relative; flex: none; display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 16px; }
.sheet__handle { position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: rgba(20,23,43,.18); }
.sheet__close { position: absolute; right: 14px; top: 10px; width: 36px; height: 36px; box-shadow: none; background: var(--surface-2); }
.sheet__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--gutter) 28px; }

@media (min-width: 768px) {
	.layer { align-items: center; }
	.sheet { width: min(100% - 48px, 980px); border-radius: var(--r-xl); transform: translateY(24px) scale(.98); opacity: 0; transition: transform .4s var(--ease), opacity .3s var(--ease); max-height: 90dvh; }
	.layer.is-open .sheet { opacity: 1; transform: none; }
	.sheet__handle { display: none; }
	.cart.sheet, .filter-panel.sheet { width: min(100% - 48px, 460px); }
}

/* ── Корзина ───────────────────────────────────────────────────────────── */
.cart__title { font-size: 18px; letter-spacing: -0.01em; }
.cart__empty { text-align: center; color: var(--muted); padding: 40px 0; }
.cart__list { display: grid; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 10px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); animation: itemIn .35s var(--ease); }
@keyframes itemIn { from { opacity: 0; transform: translateY(8px); } }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.cart-item__brand { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cart-item__name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.cart-item__vol { font-size: 13px; color: var(--muted); }
.cart-item__side { display: grid; gap: 8px; justify-items: end; }
.cart-item__price { font-weight: 700; font-size: 15px; }
.qty { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: var(--r-pill); }
.qty button { width: 30px; height: 30px; display: grid; place-items: center; font-size: 18px; border-radius: 50%; transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.qty button:active { transform: scale(.85); background: rgba(20,23,43,.1); }
.qty span { min-width: 22px; text-align: center; font-size: 14px; font-weight: 600; }
.cart__footer { flex: none; padding: 16px var(--gutter) 20px; display: grid; gap: 10px; border-top: 1px solid var(--line); background: var(--bg); }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--muted); }
.cart__total strong { font-size: 22px; color: var(--ink); letter-spacing: -.02em; }

/* ── Форма заказа в корзине ────────────────────────────────────────────── */
.cart__form { display: grid; gap: 12px; margin-top: 18px; padding: 18px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.cart__form h3 { font-size: 16px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
	width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: var(--r-md);
	background: var(--bg); font-size: 16px; /* 16px — чтобы iOS не зумил поле */
	transition: box-shadow var(--t) var(--ease), background-color var(--t) var(--ease);
}
.field input::placeholder { color: #9a9db0; }
.field input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.field input.is-invalid { box-shadow: 0 0 0 2px #d6455d; background: #fff; animation: shake .35s var(--ease); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cart__error { color: #c23049; font-size: 14px; }
.cart__done { text-align: center; padding: 40px 0; font-size: 18px; font-weight: 600; }
.btn.is-loading { opacity: .7; pointer-events: none; }
.suggestions-wrapper { position: relative; }
.suggestions-suggestions { border-radius: var(--r-md) !important; box-shadow: var(--shadow-md) !important; border: 0 !important; overflow: hidden; z-index: 300 !important; }
.suggestions-suggestion { padding: 10px 14px !important; font-size: 14px; }
.suggestions-suggestion:hover, .suggestions-selected { background: var(--bg) !important; }

/* Список подсказок адреса: ограниченной высоты, со скроллом и подсказкой «листай» (затемнение снизу) */
.cart__form .suggestions-wrapper,
.acc-form .suggestions-wrapper { z-index: 400; }
.cart__form .suggestions-suggestions,
.acc-form .suggestions-suggestions {
	z-index: 500 !important; max-height: 212px; overflow-y: auto; overscroll-behavior: contain;
	scrollbar-width: thin; scrollbar-color: #b3b6c8 transparent;
}
.cart__form .suggestions-suggestions::-webkit-scrollbar,
.acc-form .suggestions-suggestions::-webkit-scrollbar { width: 6px; }
.cart__form .suggestions-suggestions::-webkit-scrollbar-thumb,
.acc-form .suggestions-suggestions::-webkit-scrollbar-thumb { background: #b3b6c8; border-radius: 3px; }
.cart__form .suggestions-suggestions:not(.is-end),
.acc-form .suggestions-suggestions:not(.is-end) {
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), rgba(0,0,0,.25));
	mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), rgba(0,0,0,.25));
}

/* Длинные адреса переносятся по словам, список не шире поля ввода */
.cart__form .suggestions-wrapper,
.acc-form .suggestions-wrapper { display: block; width: 100%; }
.cart__form .suggestions-suggestions,
.acc-form .suggestions-suggestions { width: 100% !important; max-width: 100% !important; min-width: 0 !important; left: 0 !important; box-sizing: border-box; }
.cart__form .suggestions-suggestion,
.acc-form .suggestions-suggestion { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; word-break: normal; line-height: 1.3; }
.cart__form .suggestions-suggestion .suggestions-value,
.cart__form .suggestions-value,
.acc-form .suggestions-value { white-space: normal !important; }

/* ── Корзина: скидки, баллы ────────────────────────────────────────────── */
.field span em { font-style: normal; font-weight: 400; }
.cart__adjust { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.cart__adjust div { display: flex; justify-content: space-between; }
.cart__adjust b { color: #1f8a4c; font-weight: 600; }
.cart__points { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-radius: var(--r-md); font-size: 14px; cursor: pointer; box-shadow: var(--shadow-sm); }
.cart__points input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.cart__login { font-size: 13px; color: var(--muted); line-height: 1.45; }
.cart__login a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ── Плавающая кнопка корзины (только ПК) ──────────────────────────────── */
.cart-fab { display: none; }
@media (min-width: 768px) {
	.cart-fab {
		position: fixed; z-index: 55; right: max(24px, env(safe-area-inset-right)); bottom: 24px;
		display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 22px 0 18px;
		border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
		font-size: 15px; font-weight: 600; box-shadow: 0 16px 32px -14px var(--accent), 0 2px 6px rgba(20,23,43,.12);
		transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
	}
	.cart-fab:hover { transform: translateY(-3px); box-shadow: 0 22px 36px -14px var(--accent), 0 2px 6px rgba(20,23,43,.12); }
	.cart-fab:active { transform: scale(0.96); }
	.cart-fab__icon { position: relative; display: flex; }
	.cart-fab__badge { top: -8px; right: -10px; background: #fff; color: var(--accent); }
	.cart-fab__sum { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.28); font-weight: 600; white-space: nowrap; }
}
