/* UAKEEN — дизайн-система прайс-листа (общая для сайта и админки) */
:root {
  --page: #F2F1ED;
  --surface: #FFFFFF;
  --cell: #EBEAE5;
  --well: #F6F5F2;
  --line: #DEDCD5;
  --ink: #16181B;
  --ink-2: #2E3134;
  --muted: #5F6368;
  --faint: #8A8E92;
  --accent: #0D6B63;
  --accent-ink: #0A5A53;
  --accent-soft: #DCEDEA;
  --amber: #E8891A;
  --amber-soft: #FBEBD0;
  --amber-ink: #7A4500;
  --asko: #D3202F;
  --asko-ink: #B71C29;
  --asko-soft: #FBE7EA;
  --ok: #1E8A4E;
  --low: #D08A00;
  --out: #B7322C;
  --danger-soft: #FBEAE8;
  --danger-ink: #A12B25;
  --overlay: rgba(16, 18, 20, 0.6);
  --r-xl: 28px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow-pop: 0 18px 40px rgba(22, 24, 27, 0.14);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid rgba(13, 107, 99, 0.35); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- Каркас ---------- */
.page { padding: clamp(8px, 4vw, 16px); }
.shell { max-width: 1280px; margin: 0 auto; background: var(--surface); border-radius: var(--r-xl); padding: clamp(14px, 4.2vw, 18px) clamp(12px, 4vw, 16px) 24px; display: flex; flex-direction: column; gap: 16px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.site-header__logo { display: block; height: 50px; width: auto; }
.site-header a { display: inline-flex; border-radius: 12px; }
.tagline { text-align: right; font-size: clamp(13px, 4.3vw, 17px); font-weight: 500; line-height: 1.12; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.site-footer { margin-top: 8px; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }

.overline { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Кнопки ---------- */
.icon-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid transparent; background: var(--cell); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0; text-decoration: none; transition: background .15s, transform .15s; }
.icon-btn:hover { background: #E2E0DA; color: var(--ink); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn--line { background: var(--surface); border-color: var(--line); }
.icon-btn--line:hover { background: var(--well); }
.icon-btn--white { background: var(--surface); color: var(--accent); }
.icon-btn--dark { background: var(--ink); color: #fff; }
.icon-btn--dark:hover { background: #2A2D31; color: #fff; }
.icon-btn--glass { background: rgba(255, 255, 255, 0.92); }
.icon-btn--sm { width: 40px; height: 40px; }
.icon-btn svg { width: 20px; height: 20px; }

.btn { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 700; text-decoration: none; background: var(--ink); color: #fff; transition: background .15s, transform .15s, opacity .15s; }
.btn:hover { background: #2A2D31; color: #fff; }
.btn:active { transform: scale(0.98); }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: var(--accent-ink); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--well); color: var(--ink); }
.btn--soft { background: var(--surface); color: var(--ink); }
.btn--danger { background: var(--out); }
.btn--danger:hover { background: #9B2A25; }
.btn--danger-soft { background: var(--danger-soft); color: var(--danger-ink); }
.btn--danger-soft:hover { background: #F6DAD7; color: var(--danger-ink); }
.btn--caps { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.link-btn { min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.link-btn:hover { background: var(--accent-soft); }
.link-btn svg { width: 15px; height: 15px; }

/* ---------- Чипы и статусы ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2; color: var(--accent); white-space: nowrap; }
.chip--hit { background: var(--amber-soft); color: var(--amber-ink); }
.chip--new { background: var(--accent-soft); color: var(--accent-ink); }
.chip--asko { color: var(--asko-ink); }
.chip--plain { color: var(--ink); }
.chip--grey { background: var(--cell); color: #3A3D40; }
.dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.dot--low_stock { background: var(--low); }
.dot--out_of_stock { background: var(--out); }
.stock { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }

/* ---------- Поля ---------- */
.input, .select, .textarea { width: 100%; height: 48px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); padding: 0 14px; font-size: 15px; font-weight: 600; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
/* На телефоне поля 16px — иначе iOS увеличивает страницу при фокусе. */
@media (max-width: 767px) {
  .input, .select, .textarea, .sort select, .arow__status .select { font-size: 16px !important; }
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 107, 99, 0.15); }
.input::placeholder, .textarea::placeholder { color: #8F9397; font-weight: 500; }
.input[aria-invalid="true"] { border: 2px solid var(--out); }
.textarea { height: auto; min-height: 128px; padding: 12px 14px; font-weight: 500; line-height: 1.55; resize: vertical; }
.select-wrap { position: relative; display: block; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; font-weight: 700; font-size: 14px; cursor: pointer; }
.select-wrap > svg { position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; pointer-events: none; }
.search { position: relative; display: block; }
.search > svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 44px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

/* Переключатель: <button class="switch" aria-pressed> */
.switch { min-height: 48px; padding: 0 12px 0 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 700; text-align: left; }
.switch__track { position: relative; flex: 0 0 auto; width: 46px; height: 28px; border-radius: 999px; background: #C9C6BE; transition: background .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform .2s; }
.switch[aria-pressed="true"] .switch__track { background: var(--accent); }
.switch[aria-pressed="true"] .switch__track::after { transform: translateX(18px); }

/* Сегменты: <div class="seg"><button aria-pressed> */
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--well); }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 6px rgba(22, 24, 27, 0.12); }
.seg--fill { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.seg--fill button { white-space: normal; text-align: center; line-height: 1.2; min-height: 42px; padding: 4px 8px; }

/* ---------- Главная ---------- */
.home-top { display: flex; flex-wrap: wrap; gap: 16px; }
.hero { position: relative; flex: 999 1 560px; min-width: 0; height: 236px; border-radius: var(--r-xl); overflow: hidden; background: #2B2E31; }
.hero__img, .banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__img { object-position: 40% 50%; }
.hero__shade, .banner__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 16, 18, 0.8) 0%, rgba(14, 16, 18, 0.45) 62%, rgba(14, 16, 18, 0.15) 100%); }
.hero__body, .banner__body { position: relative; height: 100%; padding: 22px 18px 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; color: #fff; }
.hero h1 { font-size: clamp(24px, 8vw, 32px); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
.hero p, .banner p { max-width: 520px; font-size: 14px; font-weight: 500; line-height: 1.45; color: rgba(255, 255, 255, 0.88); }
.glass-pill { align-self: flex-start; margin-top: 4px; padding: 9px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.22); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

.fresh { flex: 1 1 280px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.fresh__title { display: flex; align-items: center; gap: 8px; }
.fresh__title .dot { width: 10px; height: 10px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fresh__text { font-size: 14px; color: var(--muted); }
.fresh__text b { color: var(--ink); font-weight: 600; }
.fresh__stats { display: none; }

.section-head { margin-top: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: clamp(26px, 8.6vw, 34px); font-weight: 400; line-height: 1.08; letter-spacing: -0.02em; }
.section-head .label { padding-bottom: 6px; text-align: right; }

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cat-card { container-type: inline-size; position: relative; height: 258px; border-radius: var(--r-xl); overflow: hidden; background: var(--cell); border: 1px solid transparent; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; padding: 18px clamp(8px, 7cqi, 14px); transition: transform .2s, box-shadow .2s; }
.cat-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(22, 24, 27, 0.08); }
.cat-card__media { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.cat-card__media img { max-width: 82%; max-height: 112px; object-fit: contain; mix-blend-mode: multiply; }
.cat-card__tile { width: 88%; aspect-ratio: 1.45; border-radius: 22px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(211, 32, 47, 0.12); }
.cat-card__tile img { width: 78%; max-height: none; mix-blend-mode: normal; }
.cat-card__name { margin-top: 10px; font-size: clamp(14px, 11cqi, 19px); font-weight: 500; line-height: 1.15; text-align: center; hyphens: auto; overflow-wrap: anywhere; }
.cat-card__count { margin-top: 8px; font-size: clamp(10px, 7cqi, 12px); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: center; }
.cat-card__go { margin-top: 14px; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(22, 24, 27, 0.08); }
.cat-card__go svg { width: 20px; height: 20px; }
.ribbon { position: absolute; top: 24px; right: -46px; width: 170px; height: 26px; transform: rotate(40deg); background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; z-index: 2; box-shadow: 0 6px 14px rgba(22, 24, 27, 0.16); }
.cat-card--asko { background: linear-gradient(160deg, #FFF6F7 0%, #FBE1E4 100%); border-color: #F6CDD2; box-shadow: 0 18px 40px rgba(211, 32, 47, 0.16); }
.cat-card--asko .ribbon { background: var(--asko); }
.cat-card--asko .cat-card__count { color: var(--asko-ink); }
.cat-card--asko .cat-card__go { background: var(--asko); color: #fff; }
.cat-card--hot { background: linear-gradient(160deg, #FFF3DC 0%, #FBD891 100%); border-color: #F4CF86; box-shadow: 0 18px 40px rgba(232, 137, 26, 0.22); }
.cat-card--hot .ribbon { background: var(--amber); color: #2A1600; }
.cat-card--hot .cat-card__count { color: #7A4500; }
.cat-card--out .cat-card__media img { filter: grayscale(1) opacity(0.6); }
.cat-card--out .cat-card__count { color: var(--faint); }
.cat-card--out .cat-card__go { color: var(--muted); }

/* ---------- Категория ---------- */
.cat-head { display: flex; align-items: center; gap: 12px; }
.cat-head h1 { margin-top: 2px; font-size: 26px; font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
.banner { position: relative; height: 220px; border-radius: var(--r-xl); overflow: hidden; background: #2B2E31; }
.banner__img { object-position: 60% 60%; }
.banner__body { padding: 18px; gap: 8px; }
.banner__body .overline { color: rgba(255, 255, 255, 0.78); }
.banner h2 { font-size: 30px; font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }

.filters { background: var(--cell); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.frow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.frow .search { flex: 1 1 100%; min-width: 0; }
.sort { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; height: 48px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.sort__label { display: none; padding-left: 14px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sort select { appearance: none; -webkit-appearance: none; flex: 1 1 auto; min-width: 0; height: 100%; border: 0; border-radius: var(--r-md); background: transparent; padding: 0 36px 0 14px; font-size: 14px; font-weight: 700; color: var(--ink); outline: none; cursor: pointer; }
.sort > svg { position: absolute; right: 14px; top: 15px; width: 18px; height: 18px; pointer-events: none; }
.filters-btn { flex: 0 0 auto; height: 48px; padding: 0 16px; border-radius: var(--r-md); border: 0; background: var(--ink); color: #fff; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; position: relative; }
.filters-btn svg { width: 18px; height: 18px; }
.filters-btn__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.frow .switch { flex: 1 1 100%; justify-content: space-between; }
.fdivider { height: 1px; background: var(--line); }
.fgroups { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.fgroup { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fgroup--extra { display: none; }
#filterGroups { display: flex; flex-direction: column; gap: 14px; }
#filterGroups.fg-extra-only { display: none; }
.results { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.results b { color: var(--ink); }

.plist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.group-title { grid-column: 1 / -1; margin: 10px 4px 0; display: flex; align-items: baseline; gap: 10px; font-size: 18px; font-weight: 600; }
.group-title span { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Строка товара */
.prow { position: relative; border-radius: var(--r-lg); background: var(--cell); padding: 16px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: box-shadow .2s, transform .2s; }
.prow:hover { box-shadow: 0 10px 26px rgba(22, 24, 27, 0.08); }
.prow__top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.thumb { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 18px; background: #fff; border: 0; padding: 5px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb--empty { cursor: default; color: #A3A6A9; }
.thumb svg { width: 26px; height: 26px; }
.prow--out .thumb img { filter: grayscale(1); }
.prow__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.prow__body .chips { padding-right: 26px; }
.prow__model { font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.prow__desc { font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.prow__index { position: absolute; top: 16px; right: 16px; font-size: 12px; font-weight: 800; color: var(--accent); }
.prow__bottom { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.prow__bottom .stock { flex: 1 1 auto; min-width: 0; }
.price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.price__old { margin-bottom: 3px; font-size: 12px; font-weight: 700; color: var(--faint); text-decoration: line-through; }
.price__now { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.price--none { max-width: 96px; text-align: right; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); line-height: 1.25; }
.prow--out .price__now { color: var(--faint); }

/* Липкая компактная шапка категории */
.sticky-bar { position: fixed; z-index: 30; top: 10px; left: 50%; width: min(1248px, calc(100% - 24px)); transform: translate(-50%, -140%); transition: transform .25s ease; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 22px; background: rgba(255, 255, 255, 0.88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(222, 220, 213, 0.8); box-shadow: 0 10px 30px rgba(22, 24, 27, 0.10); }
.sticky-bar.is-visible { transform: translate(-50%, 0); }
.sticky-bar__title { min-width: 0; }
.sticky-bar__title .overline { font-size: 10px; }
.sticky-bar__name { font-size: 17px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-pill { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--page); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.home-pill svg { width: 16px; height: 16px; }

/* ---------- Состояния ---------- */
.empty { border-radius: var(--r-lg); background: var(--well); border: 1px dashed #CFCCC3; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; grid-column: 1 / -1; }
.empty--solid { background: var(--cell); border: 0; }
.empty__icon { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.empty__icon svg { width: 24px; height: 24px; }
.empty h3 { font-size: 17px; font-weight: 700; }
.empty p { font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 420px; }
.empty .btn { margin-top: 4px; min-height: 44px; }
.alert { border-radius: 20px; background: var(--danger-soft); padding: 16px; display: flex; gap: 12px; align-items: flex-start; color: #5F3A37; font-size: 13px; line-height: 1.5; }
.alert b { display: block; font-size: 15px; color: #8E241F; }
.skeleton { border-radius: var(--r-lg); background: var(--cell); padding: 16px; display: flex; gap: 12px; }
.skeleton i { display: block; border-radius: 999px; background: linear-gradient(90deg, var(--well) 0%, #fff 50%, var(--well) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton .sk-img { width: 72px; height: 72px; border-radius: 18px; flex: 0 0 auto; }
.skeleton .sk-lines { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.toast { position: fixed; z-index: 80; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 160%); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 12px 18px 12px 12px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 12px 30px rgba(22, 24, 27, 0.25); font-size: 14px; font-weight: 700; transition: transform .25s ease; }
.toast.is-visible { transform: translate(-50%, 0); }
.toast__icon { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.toast__icon svg { width: 16px; height: 16px; }
.toast--error .toast__icon { background: var(--out); }

/* ---------- Оверлеи ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet { width: 100%; max-height: 94vh; max-height: 94dvh; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.sheet__grab { display: flex; justify-content: center; padding: 10px 0 2px; }
.sheet__grab span { width: 44px; height: 5px; border-radius: 999px; background: var(--line); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px 10px 20px; }
.sheet__head h2 { margin-top: 2px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.sheet__body { flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.sheet__foot { display: flex; gap: 10px; padding: 12px 16px 20px; border-top: 1px solid var(--cell); }
.sheet__foot .btn--accent { flex: 1 1 auto; }
.radio-list { display: flex; flex-direction: column; gap: 4px; }
.radio-list button { min-height: 48px; padding: 0 14px; border: 0; border-radius: 14px; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 600; text-align: left; }
.radio-list button::after { content: ""; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C9C6BE; }
.radio-list button[aria-pressed="true"] { background: var(--page); }
.radio-list button[aria-pressed="true"]::after { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 5px, transparent 6px); }

/* Карточка товара */
.pmodal { width: 100%; max-height: 96vh; max-height: 96dvh; overflow: auto; overscroll-behavior: contain; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 0 16px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.pmodal__head { display: flex; flex-direction: column; gap: 12px; }
.pmodal__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pmodal__bar .overline { line-height: 1.25; }
.pmodal__tools { display: flex; gap: 8px; }
.pmodal__title h2 { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.pmodal__title .label { margin-top: 4px; }
.pmodal__grid { display: flex; flex-direction: column; gap: 14px; }
.pmodal__gallery { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stage { position: relative; height: 310px; border-radius: var(--r-lg); background: var(--well); overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.stage img { max-width: 84%; max-height: 84%; object-fit: contain; transition: transform .2s ease; cursor: zoom-in; }
.stage__count { position: absolute; top: 12px; left: 12px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); font-size: 12px; font-weight: 700; }
.stage__zoom { position: absolute; bottom: 12px; right: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(22, 24, 27, 0.72); color: #fff; font-size: 11px; font-weight: 700; }
.stage__full { position: absolute; top: 8px; right: 8px; }
.stage__prev, .stage__next { position: absolute; top: 50%; margin-top: -22px; }
.stage__prev { left: 8px; }
.stage__next { right: 8px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.thumbs button { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 16px; background: var(--well); border: 2px solid transparent; padding: 6px; display: flex; align-items: center; justify-content: center; }
.thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.thumbs img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pmodal__info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.buybox { border-radius: var(--r-lg); background: var(--cell); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.buybox .chip { font-size: 11px; padding: 6px 11px; }
.buybox__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.buybox__price { margin-top: 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.buybox__price b { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.buybox__price s { font-size: 15px; font-weight: 700; color: var(--faint); }
.buybox__price .price--none { max-width: none; text-align: left; font-size: 13px; }
.buybox__maker { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; }
.buybox__maker b { display: block; color: var(--ink); font-weight: 700; }
.pdesc { font-size: 15px; font-weight: 500; line-height: 1.6; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.specs { border-radius: 20px; border: 1px solid var(--line); padding: 6px 14px 4px; }
.specs h4 { margin: 0; padding: 8px 0 6px; font-size: 15px; font-weight: 700; }
.specs dl { margin: 0; }
.specs dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-top: 1px solid var(--cell); }
.specs dt { font-size: 14px; color: var(--muted); }
.specs dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Полноэкранная галерея */
.viewer { position: fixed; inset: 0; z-index: 70; background: #111315; color: #fff; display: flex; flex-direction: column; }
.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(16px, env(safe-area-inset-top)) 16px 8px; }
.viewer__bar b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__bar span { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.7); }
.viewer .icon-btn { background: rgba(255, 255, 255, 0.12); color: #fff; }
.viewer .icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.viewer__stage { position: relative; flex: 1 1 auto; min-height: 0; margin: 8px 12px; border-radius: var(--r-lg); background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; }
.viewer__stage img { max-width: 92%; max-height: 92%; object-fit: contain; transition: transform .2s ease; user-select: none; -webkit-user-drag: none; }
.viewer__stage.is-dragging img { transition: none; }
.viewer__stage .icon-btn { position: absolute; top: 50%; margin-top: -22px; background: rgba(17, 19, 21, 0.72); }
.viewer__prev { left: 8px; }
.viewer__next { right: 8px; }
.viewer__zoom { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px 4px; }
.viewer__zoom span { min-width: 64px; text-align: center; font-size: 15px; font-weight: 700; }
.viewer .thumbs { justify-content: center; padding: 8px 16px; }
.viewer .thumbs button { width: 56px; height: 56px; background: #fff; opacity: 0.6; }
.viewer .thumbs button[aria-pressed="true"] { opacity: 1; border-color: #4FC1B6; }
.viewer__hint { padding: 4px 16px max(20px, env(safe-area-inset-bottom)); text-align: center; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.7); }

/* Подсказки первого входа */
.hint { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: 420px; margin: 0 auto; background: #fff; border-radius: var(--r-xl); padding: 20px; box-shadow: 0 18px 50px rgba(22, 24, 27, 0.22); display: flex; flex-direction: column; gap: 10px; }
.hint__top { display: flex; align-items: center; justify-content: space-between; }
.hint__dots { display: flex; gap: 4px; }
.hint__dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--line); }
.hint__dots i.is-on { width: 18px; background: var(--accent); }
.hint h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.hint p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.hint__actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.hint__actions .btn { min-height: 44px; }

/* ---------- Планшет и десктоп ---------- */
@media (min-width: 768px) {
  .shell { padding: 24px 28px 32px; gap: 20px; border-radius: 32px; }
  .site-header__logo { height: 60px; }
  .tagline { font-size: 19px; }
  .hero { height: 360px; }
  .hero__body { padding: 36px; gap: 14px; }
  .hero h1 { font-size: 48px; }
  .hero p { font-size: 16px; }
  .fresh { padding: 24px; border-radius: var(--r-xl); justify-content: space-between; gap: 18px; }
  .fresh__big { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); }
  .fresh__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fresh__stats div { border-radius: 18px; background: var(--well); padding: 14px; font-size: 13px; color: var(--muted); }
  .fresh__stats b { display: block; font-size: 24px; color: var(--ink); }
  .section-head h2 { font-size: 40px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
  .cat-card { height: 300px; }
  .cat-card__media img { max-height: 140px; }
  .banner { height: 280px; }
  .banner__body { padding: 32px; gap: 10px; }
  .banner h2 { font-size: 44px; }
  .banner p { font-size: 16px; }
  .cat-head h1 { font-size: 30px; }
  .filters { padding: 20px; gap: 16px; }
  .frow .search { flex: 1 1 320px; }
  .sort { flex: 0 0 280px; }
  .sort__label { display: inline; }
  .sort select { padding-left: 6px; }
  .frow .switch { flex: 0 0 auto; }
  .filters-btn { display: none; }
  .fgroup { flex-direction: row; align-items: center; gap: 12px; }
  .fgroup--extra { display: flex; }
  #filterGroups.fg-extra-only { display: flex; }
  .stage { height: 380px; }
}

@media (min-width: 1024px) {
  .plist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overlay--center { align-items: center; padding: 24px; }
  .pmodal { width: min(1120px, 100%); max-height: min(880px, calc(100vh - 48px)); border-radius: 32px; padding: 28px; gap: 20px; overflow: hidden; }
  .pmodal .sheet__grab { display: none; }
  .pmodal__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; row-gap: 4px; }
  .pmodal__bar { display: contents; }
  .pmodal__bar .overline { grid-column: 1; grid-row: 1; }
  .pmodal__bar .overline br { display: none; }
  .pmodal__tools { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .pmodal__title { grid-column: 1; grid-row: 2; }
  .pmodal__title h2 { font-size: 30px; }
  .pmodal__grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; }
  .pmodal__gallery { flex-direction: row-reverse; min-height: 0; }
  .pmodal__gallery .stage { flex: 1 1 auto; height: auto; min-height: 420px; border-radius: var(--r-xl); }
  .pmodal__gallery .thumbs { flex-direction: column; overflow: auto; }
  .pmodal__gallery .thumbs button { width: 88px; height: 88px; border-radius: 18px; }
  .pmodal__info { overflow: auto; padding-right: 4px; }
}

@media (max-width: 359px) {
  .page { padding: 8px; }
  .shell { padding: 12px 10px 20px; border-radius: 22px; }
  .cat-grid { gap: 8px; }
  .site-header__logo { height: 42px; }
  .prow { padding: 12px; }
  .thumb { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Движение ---------- */
:root { --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in: cubic-bezier(.4, 0, 1, 1); }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { from { transform: none; } to { transform: translateY(100%); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes dot-pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); } 50% { box-shadow: 0 0 0 7px rgba(220, 237, 234, 0.35); } }

/* Появление экрана: блоки поднимаются по очереди, карточки категорий — каскадом. */
.view-enter > * { animation: rise-in .45s var(--ease-out) backwards; }
.view-enter > *:nth-child(2) { animation-delay: .04s; }
.view-enter > *:nth-child(3) { animation-delay: .08s; }
.view-enter > *:nth-child(4) { animation-delay: .12s; }
.view-enter > *:nth-child(5) { animation-delay: .16s; }
.view-enter > *:nth-child(n+6) { animation-delay: .2s; }
.view-enter .cat-card { animation: pop-in .5s var(--ease-out) backwards; animation-delay: calc(.16s + var(--i, 0) * .045s); }
.list-enter .prow { animation: rise-in .42s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * .04s); }
.list-enter .group-title { animation: rise-in .42s var(--ease-out) backwards; }

/* Оверлеи: анимация только при открытии (.enter) и закрытии (.leaving). */
.overlay.enter { animation: fade-in .22s ease backwards; }
.overlay.enter .sheet, .overlay.enter .pmodal { animation: sheet-in .34s var(--ease-out) backwards; }
.overlay.leaving { animation: fade-out .19s ease forwards; }
.overlay.leaving .sheet, .overlay.leaving .pmodal { animation: sheet-out .19s var(--ease-in) forwards; }
.viewer.enter { animation: fade-in .22s ease backwards; }
.viewer.enter .viewer__stage { animation: pop-in .32s var(--ease-out) backwards; }
.viewer.leaving { animation: fade-out .19s ease forwards; }
.hint.enter { animation: rise-in .36s var(--ease-out) backwards; }
@media (min-width: 1024px) {
  .overlay.enter .pmodal { animation: modal-in .32s var(--ease-out) backwards; }
  .overlay.leaving .pmodal { animation: modal-out .19s var(--ease-in) forwards; }
}

/* Фото проявляются после загрузки; пока грузятся — мягкий «блик» на подложке. */
.fade-img { opacity: 0; transition: opacity .4s ease, transform .55s var(--ease-out); }
.fade-img.is-loaded { opacity: 1; }
.fade-img.is-broken { opacity: 0; }
.hero__img.fade-img:not(.is-loaded), .banner__img.fade-img:not(.is-loaded) { transform: scale(1.04); }
.cat-card__media img.fade-img:not(.is-loaded), .thumb img.fade-img:not(.is-loaded), .thumbs img.fade-img:not(.is-loaded) { transform: scale(.94); }
.stage img.fade-img { transition: opacity .35s ease, transform .22s ease; }
.viewer__stage img.fade-img { transition: opacity .35s ease, transform .22s ease; }
.viewer__stage.is-dragging img.fade-img { transition: none; }
.thumb:has(> .fade-img:not(.is-loaded)),
.stage:has(> .fade-img:not(.is-loaded)),
.thumbs button:has(> .fade-img:not(.is-loaded)),
.cat-card__media:has(> .fade-img:not(.is-loaded)),
.cat-card__tile:has(> .fade-img:not(.is-loaded)) {
  background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.7) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.cat-card__media { border-radius: 20px; }
.hero:has(> .hero__img:not(.is-loaded)), .banner:has(> .banner__img:not(.is-loaded)) {
  background-image: linear-gradient(100deg, #2B2E31 20%, #3A3E42 50%, #2B2E31 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* Мелкие отклики на касание. */
.fresh__title .dot { animation: dot-pulse 2.6s ease-in-out infinite; }
.prow { transition: box-shadow .2s, transform .15s; }
.prow:active { transform: scale(0.992); }
.cat-card:active { transform: scale(0.98); }
.seg button, .radio-list button, .switch, .filters-btn, .home-pill { transition: background .18s, color .18s, box-shadow .18s, transform .15s; }
.seg button:active, .radio-list button:active, .filters-btn:active, .home-pill:active { transform: scale(0.97); }
.results { transition: opacity .15s; }
