/* =========================================================
   Я ТВОЙ РОЛЛ — тёмная адаптивная тема (mobile-first).
   App-shell: фикс-шапка сверху, горизонтальный каталог,
   фикс-корзина снизу, выдвижной фильтр слева.
   Перекраска под фирстиль = правка переменных в :root.
   ========================================================= */

:root {
    --bg:          #0f0f10;
    --surface:     #1a1a1d;
    --surface-2:   #232327;
    --surface-3:   #2b2b30;
    --border:      #2e2e33;
    --text:        #f1f1f3;
    --muted:       #9a9aa3;
    --accent:      #e23b3b;
    --accent-700:  #c62f2f;
    --ok:          #36c275;

    --radius:    16px;
    --radius-sm: 10px;

    --topbar-h:    58px;
    --bottombar-h: 62px;
    --app-max:     1040px;

    --shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    --font:   "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

    /* z-уровни */
    --z-stage:   1;
    --z-edge:    15;
    --z-bars:    40;
    --z-scrim:   35;
    --z-panel:   38;
    --z-sheet:   45;
    --z-drawer:  50;
    --z-modal:   100;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* Атрибут hidden обязан скрывать элемент, что бы ни задавал его display
   (иначе классы с display:flex/grid «побеждают» hidden — так были видны
   стрелки галереи на одиночном фото и строка суммы в пустой корзине). */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ===================== APP-SHELL ===================== */

.page-home { height: 100dvh; overflow: hidden; }

.app {
    position: relative;
    height: 100dvh;
    /* ПК-версия занимает весь экран, без боковых полей */
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

/* ---------- Блок 1: шапка ---------- */
.topbar {
    flex: 0 0 var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: var(--z-bars);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand__logo-img { height: 38px; width: auto; } /* используется на внутренних страницах */
.brand__horiz { height: 44px; width: auto; }    /* горизонтальный лого в шапке главной */
.brand__name { font-size: clamp(15px, 4.5vw, 19px); font-weight: 700; letter-spacing: 0.3px; }

.iconbtn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer;
    transition: background 0.15s;
    flex: 0 0 auto;
}
.iconbtn:active { background: var(--surface-3); }
.iconbtn__bars { width: 18px; height: 2px; background: var(--text); position: relative; }
.iconbtn__bars::before, .iconbtn__bars::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--text);
}
.iconbtn__bars::before { top: -6px; }
.iconbtn__bars::after  { top: 6px; }

.chev { width: 11px; height: 11px; border-right: 2px solid var(--text); border-bottom: 2px solid var(--text);
        transform: rotate(45deg); margin-top: -3px; transition: transform 0.25s; }
.iconbtn--chev[aria-expanded="true"] .chev { transform: rotate(-135deg); margin-top: 3px; }

/* ---------- Панель «о компании» ---------- */
.panel {
    position: absolute;
    top: var(--topbar-h); left: 0; right: 0;
    bottom: var(--bottombar-h); /* разворачивается до блока корзины */
    z-index: var(--z-panel);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px;
    display: flex; flex-direction: column;
    transform: translateY(-115%);
    transition: transform 0.28s ease;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}
.panel.is-open { transform: translateY(0); }
/* Закрытые оверлеи не должны ловить тапы, даже будучи за экраном */
.panel:not(.is-open), .sheet:not(.is-open), .drawer:not(.is-open) { pointer-events: none; }
.panel__title { margin: 0 0 8px; font-size: 18px; }
.panel__text { margin: 0 0 14px; color: #cfcfd4; font-size: 0.95em; }
.info { margin: 0; display: grid; gap: 8px; }
.info__row { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); padding-bottom: 7px; }
.info__row dt { color: var(--muted); }
.info__row dd { margin: 0; text-align: right; }

/* ---------- Блок 2: каталог (горизонтальный скролл) ---------- */
.stage { position: relative; flex: 1 1 auto; min-height: 0; z-index: var(--z-stage); }

.stage__tag {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    z-index: 6; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 999px; padding: 5px 12px; font-size: 0.85em; display: flex; gap: 8px; align-items: center;
}
.stage__tag-clear { color: var(--muted); font-size: 1.2em; line-height: 1; }
.stage__empty { display: grid; place-items: center; height: 100%; color: var(--muted); }

.catalog {
    height: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-columns: clamp(150px, 42vw, 200px);
    gap: 12px;
    /* слева больше: карточки не липнут к границе и не прячутся за язычком фильтра */
    padding: 14px 14px 14px 46px;
    overflow-x: auto;
    overflow-y: hidden;
    align-content: center;
    /* Без scroll-snap: он выравнивает карточку по краю вьюпорта, игнорируя
       padding-left, из-за чего лента «прилипала» к границе и дёргалась. */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
    cursor: grab;
}
.catalog.is-dragging { cursor: grabbing; }

/* Первый заход: карточки выезжают справа налево (подсказка, что блок скроллится) */
@keyframes card-in {
    from { opacity: 0; transform: translateX(90px); }
    to   { opacity: 1; transform: none; }
}
.catalog--intro .card { animation: card-in 0.55s ease backwards; }
.catalog::-webkit-scrollbar { height: 8px; }
.catalog::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }

.card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    user-select: none;
}
.card__media {
    flex: 1 1 auto; min-height: 0;
    padding: 0; border: none; background: #0c0c0d; cursor: pointer; overflow: hidden;
}
/* contain — фото целиком, без обрезки (решение после неудачного кадрирования) */
.card__media img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.card__body { flex: 0 0 auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.card__title {
    margin: 0; font-size: clamp(13px, 3.4vw, 15px); line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.4em;
}
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card__price { font-weight: 800; color: var(--accent); white-space: nowrap; font-size: 0.98em; }
.card__add {
    position: relative;
    flex: 0 0 auto;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: var(--accent); color: #fff; border: none; border-radius: 9px;
    font-size: 15px; font-weight: 800; line-height: 1; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
/* Плюс рисуется псевдоэлементами — глиф "+" не центруется идеально по вертикали */
.card__add::before, .card__add::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff; border-radius: 1px;
}
.card__add::before { width: 14px; height: 2px; }
.card__add::after  { width: 2px;  height: 14px; }
.card__add.is-in::before, .card__add.is-in::after { display: none; }
.card__add:active { transform: scale(0.9); }
.card__add.is-added { background: var(--ok); }

/* Степпер на плитке, когда товар уже в корзине: [− N +] */
.card__stepper {
    display: inline-flex; align-items: center;
    height: 34px; padding: 0 2px;
    background: var(--ok); border-radius: 9px;
}
.card__step {
    width: 26px; height: 34px;
    display: grid; place-items: center;
    background: none; border: none; color: #fff;
    font-size: 17px; font-weight: 800; line-height: 1; cursor: pointer;
}
.card__step:active { transform: scale(0.85); }
.card__qty { min-width: 16px; text-align: center; color: #fff; font-weight: 800; font-size: 14px; }

.modal__actions { display: inline-flex; align-items: center; gap: 8px; }
.modal__remove {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer;
}
.modal__remove:active { border-color: var(--accent); color: var(--accent); }

/* ---------- Кнопка-язычок фильтра (левый край) ---------- */
.edge-handle {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    z-index: var(--z-edge);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--accent); color: #fff; border: none;
    padding: 12px 6px 12px 4px;
    border-radius: 0 12px 12px 0;
    cursor: pointer; box-shadow: 2px 0 10px rgba(0, 0, 0, 0.35);
}
.edge-handle__arrow { font-size: 20px; line-height: 1; }
.edge-handle__label { font-size: 9px; writing-mode: vertical-rl; letter-spacing: 1px; text-transform: uppercase; }

/* ---------- Блок 3: фикс-корзина ---------- */
.bottombar {
    flex: 0 0 var(--bottombar-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: relative;
    z-index: var(--z-bars);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.cartbar {
    width: 100%; height: var(--bottombar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 18px; background: none; border: none; cursor: pointer;
}
.cartbar__chev {
    width: 11px; height: 11px; border-left: 2px solid var(--text); border-top: 2px solid var(--text);
    transform: rotate(45deg); transition: transform 0.25s; margin-bottom: -3px;
}
.cartbar[aria-expanded="true"] .cartbar__chev { transform: rotate(225deg); margin-bottom: 3px; }
.cartbar__label { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-right: auto; }
.cartbar__count {
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--accent); color: #fff; border-radius: 999px;
    font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.cartbar__total { font-weight: 800; color: var(--accent); }

/* ---------- Лист корзины (раскрывается вверх) ---------- */
.sheet {
    position: absolute; left: 0; right: 0; bottom: 0;
    z-index: var(--z-sheet);
    background: var(--surface);
    border-radius: 18px 18px 0 0;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0));
    max-height: calc(100dvh - var(--topbar-h) - 6px);
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.sheet.is-open { transform: translateY(0); }
.sheet__grip { width: 44px; height: 5px; border-radius: 999px; background: var(--surface-3); margin: 4px auto 12px; cursor: pointer; }
.sheet__title { margin: 0 0 12px; font-size: 18px; }

/* список позиций */
.cart__empty { color: var(--muted); text-align: center; padding: 18px 0; }
.cart__list { list-style: none; margin: 0; padding: 0; }
.cline {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center; gap: 10px;
    padding: 11px 0; border-bottom: 1px solid var(--border);
}
.cline { cursor: pointer; } /* клик по позиции открывает карточку товара */
.cline__title { font-size: 0.95em; }
.cline__qty   { color: var(--muted); }
.cline__sum   { font-weight: 700; white-space: nowrap; min-width: 70px; text-align: right; }
.cline__del   { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }
.cline__del:active { color: var(--accent); }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty__btn {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    font-size: 16px; cursor: pointer; display: grid; place-items: center;
}
.qty__btn:active { border-color: var(--accent); }
.qty__val { min-width: 20px; text-align: center; font-weight: 700; }
.cart__sumline { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 4px; font-size: 1.1em; }
.cart__sumline strong { color: var(--accent); }

/* форма заказа в листе */
.order { margin-top: 8px; }
.order[data-state="empty"] { display: none; }
.order__msg { border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; font-size: 0.92em; }
.order__msg.is-err { background: rgba(226, 59, 59, 0.14); border: 1px solid var(--accent); }
.order__msg.is-ok  { background: rgba(54, 194, 117, 0.14); border: 1px solid var(--ok); }
.order__note { color: var(--muted); font-size: 0.82em; margin: 10px 0 0; text-align: center; }

.field { display: block; margin-bottom: 10px; }
.field__label { display: block; margin-bottom: 5px; font-size: 0.82em; color: var(--muted); }
.field__input {
    width: 100%; padding: 12px 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font: inherit;
}
.field__input:focus { outline: none; border-color: var(--accent); }
.field.is-invalid .field__input { border-color: var(--accent); }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    border-radius: var(--radius-sm); padding: 11px 18px; font-weight: 700; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn--pay { width: 100%; background: var(--accent); border-color: var(--accent); color: #fff; padding: 14px; font-size: 1.02em; }
.btn--pay:active { background: var(--accent-700); }
.btn--pay[disabled] { opacity: 0.6; cursor: default; }

/* ---------- Выдвижной фильтр ---------- */
.drawer {
    position: absolute; top: 0; bottom: 0; left: 0;
    width: min(80vw, 300px);
    z-index: var(--z-drawer);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 18px 16px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
}
.drawer.is-open { transform: translateX(0); }
.drawer__title { margin: 0 0 14px; font-size: 17px; }
.drawer__nav { display: flex; flex-direction: column; gap: 6px; }
.drawer__link { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.drawer__link.is-active { background: rgba(226, 59, 59, 0.16); border-color: var(--accent); color: var(--text); }

/* ---------- Затемнение ---------- */
.scrim { position: absolute; inset: 0; z-index: var(--z-scrim); background: rgba(0, 0, 0, 0.55); }

/* ---------- Модалка товара ---------- */
.modal { position: absolute; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 8px; }
.modal[hidden] { display: none; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }
.modal__dialog {
    position: relative; z-index: 1; width: 100%; max-width: 440px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; box-shadow: var(--shadow); animation: pop 0.2s ease;
}
/* ПК: карточка на ~30% крупнее */
@media (min-width: 640px) {
    .modal__dialog { max-width: 550px; padding: 18px; }
}
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.modal__img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #0c0c0d; border-radius: var(--radius-sm); margin-bottom: 12px; }
.modal__title { margin: 0 0 4px; font-size: 19px; }
.modal__weight { color: var(--muted); font-size: 0.88em; margin-bottom: 8px; }
.modal__desc { color: #d3d3d8; font-size: 0.93em; }
.modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.modal__foot .btn--pay { width: auto; flex: 0 0 auto; padding: 12px 22px; }
.modal__price { font-size: 1.3em; font-weight: 800; color: var(--accent); }
.modal__incart { color: var(--ok); font-weight: 600; font-size: 0.88em; white-space: nowrap; }

/* ---------- Подтверждение заказа ---------- */
.modal__dialog--notify { max-width: 360px; text-align: center; }
.done-icon {
    width: 58px; height: 58px; margin: 4px auto 12px;
    display: grid; place-items: center;
    background: var(--ok); color: #fff;
    border-radius: 999px; font-size: 28px; font-weight: 800;
    animation: pop 0.3s ease;
}
.done-text { color: #e4e4e8; margin: 8px 0; }
.done-note { color: var(--muted); font-size: 0.85em; margin: 0 0 16px; }
.modal__dialog--notify .btn--pay { width: 100%; }

/* ---------- Полноэкранный просмотр фото (лайтбокс) ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 200; /* поверх всего, включая модалку */
    background: rgba(0, 0, 0, 0.88);
    display: grid; place-items: center;
    padding: 16px;
}
.lightbox__img {
    max-width: 100%; max-height: 100%;
    width: auto; height: auto;
    object-fit: contain; /* без урезания */
    border-radius: 6px;
    cursor: default;
}
.lightbox__close {
    position: absolute; top: 14px; right: 16px;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: none; border-radius: 999px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 24px; line-height: 1; cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* Фото в модалке кликабельно — курсор-лупа */
.modal__gallery .modal__img { cursor: zoom-in; }

/* Анимация листания фото: въезд со стороны нажатой стрелки */
@keyframes gal-left  { from { opacity: 0.2; transform: translateX(36px); }  to { opacity: 1; transform: none; } }
@keyframes gal-right { from { opacity: 0.2; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
.gal-anim-left  { animation: gal-left  0.28s ease; }
.gal-anim-right { animation: gal-right 0.28s ease; }

/* ===================== СТРАНИЦА CHECKOUT (fallback без JS) ===================== */
.page-checkout body, .page-checkout { background: var(--bg); }
.wrap { max-width: 560px; margin: 0 auto; padding: 18px clamp(14px, 5vw, 24px) 60px; }
.lite-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.lite-head .brand__name { font-weight: 700; }
.back-link { color: var(--muted); }
.page-title { font-size: clamp(20px, 6vw, 28px); margin: 6px 0 16px; }
.card-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.notice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; justify-items: start; }
.notice--ok { border-color: var(--ok); }
.notice--err { border-color: var(--accent); }
.field__err { color: var(--accent); font-size: 0.8em; margin-top: 4px; display: block; }

/* ===================== ДОРАБОТКИ (июль 2026) ===================== */

/* ---------- A7: панель о компании — лого + инфо-плитки ---------- */
.panel__logo { display: grid; place-items: center; margin: 4px 0 14px; }
.panel__logo-badge {
    width: min(44vw, 210px); height: auto;
    transform: scale(0.45); opacity: 0; transform-origin: top center;
}
.panel.is-open .panel__logo-badge { animation: logo-grow 0.45s ease forwards; }
@keyframes logo-grow {
    from { transform: scale(0.45); opacity: 0; }
    60%  { transform: scale(1.06); opacity: 1; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Вертикальные колонки-плитки с горизонтальной прокруткой (задача 9) */
.abouts {
    flex: 1; min-height: 0;
    display: flex; gap: 12px;
    overflow-x: auto; overflow-y: hidden;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}
.about-col {
    flex: 0 0 min(76vw, 300px);
    display: flex; flex-direction: column; gap: 12px;
    min-height: 0;
}
.about-col > .infotile { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.about-col--logo {
    display: grid; place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-basis: min(64vw, 260px);
}
.about-col--map { flex-basis: min(88vw, 380px); }
.infotile--map { display: flex; flex-direction: column; padding-bottom: 0; }
.mapwrap { flex: 1; min-height: 0; margin: 0 -14px; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.mapwrap iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--surface-3); }

.infotile {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    font-size: 0.92em;
}
.infotile p { margin: 0; color: #cfcfd4; }
.infotile__title { margin: 0 0 7px; font-size: 0.95em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.infotile__link { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 600; }

/* ---------- A2: фильтр внутри блока меню, сдвигает плитки ---------- */
.filterbar {
    position: absolute; top: 0; bottom: 0; left: 0;
    width: var(--filterbar-w, 230px);
    z-index: 10;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 14px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
}
.filterbar:not(.is-open) { pointer-events: none; }
.filterbar.is-open { transform: translateX(0); }
.filterbar__title { margin: 0 0 12px; font-size: 16px; }
.filterbar__nav { display: flex; flex-direction: column; gap: 6px; }
.filterbar__link {
    padding: 11px 13px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.filterbar__link.is-active { background: rgba(226, 59, 59, 0.16); border-color: var(--accent); color: var(--text); }

/* сдвиг плиток при открытом фильтре */
.catalog { transition: margin-left 0.28s ease; }
.stage.filter-open .catalog { margin-left: var(--filterbar-w, 230px); }
.stage.filter-open .edge-handle { transform: translate(var(--filterbar-w, 230px), -50%); }
.edge-handle { transition: transform 0.28s ease; }
.stage.filter-open .edge-handle .edge-handle__arrow { transform: rotate(180deg); }
.edge-handle__arrow { transition: transform 0.28s ease; }

/* ---------- A6: полоса «Меню» над раскрытой корзиной ---------- */
.sheet__menubar {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    width: calc(100% + 32px); margin: 0 -16px;
    padding: 7px 0 9px;
    background: none; border: none; border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.sheet__menubar-label { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; }
.sheet__grip { width: 44px; height: 5px; border-radius: 999px; background: var(--surface-3); }

.sheet__head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.sheet__title { margin: 0; font-size: 18px; }
.sheet__clear {
    background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--muted); padding: 6px 12px; font-size: 0.85em; cursor: pointer;
}
.sheet__clear:active { color: var(--accent); border-color: var(--accent); }

/* ---------- A4: кнопка карточки, когда товар в корзине ---------- */
.card__add.is-in { background: var(--ok); font-size: 15px; font-weight: 800; }

/* ---------- B: форма заказа ---------- */
.segmented {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px; margin-bottom: 12px;
}
.segmented__opt input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__opt span {
    display: grid; place-items: center;
    padding: 10px 6px; border-radius: 7px;
    color: var(--muted); font-size: 0.92em; font-weight: 600;
    cursor: pointer; transition: 0.15s;
}
.segmented__opt input:checked + span { background: var(--accent); color: #fff; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: 0.85em; color: var(--muted); }
.consent input { margin-top: 3px; accent-color: var(--accent); flex: 0 0 auto; }
.consent a { color: var(--accent); text-decoration: underline; }
.consent[hidden] { display: none; }

.order__totals {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; color: var(--muted); font-size: 0.95em;
}
.order__totals--final { color: var(--text); font-size: 1.1em; padding-bottom: 12px; }
.order__totals--final strong { color: var(--accent); }
#order-discount { color: var(--ok); }

/* ---------- A3: модалка — галерея и раскрытие описания ---------- */
.modal__dialog { max-height: min(92dvh, 720px); overflow-y: auto; overflow-x: hidden; }
/* overflow:hidden — анимация листания сдвигает фото и без него
   на мгновение вылезал горизонтальный скроллбар */
.modal__gallery { position: relative; margin-bottom: 12px; overflow: hidden; border-radius: var(--radius-sm); }
.modal__gallery .modal__img { margin-bottom: 0; user-select: none; }
.modal__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: rgba(15, 15, 16, 0.65); color: #fff;
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.modal__nav--prev { left: 8px; }
.modal__nav--next { right: 8px; }
.modal__dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.modal__dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.4); }
.modal__dots i.is-on { background: #fff; }

.modal__descwrap {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: linear-gradient(transparent, rgba(15, 15, 16, 0.92) 34%);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 26px 12px 10px;
    cursor: pointer;
    transition: 0.25s ease;
}
.modal__descwrap .modal__desc {
    margin: 0; color: #e6e6ea; font-size: 0.9em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.modal__gallery.desc-open .modal__descwrap {
    top: 0; background: rgba(15, 15, 16, 0.94);
    border-radius: var(--radius-sm);
    overflow-y: auto; padding: 14px;
}
.modal__gallery.desc-open .modal__desc { display: block; -webkit-line-clamp: unset; overflow: visible; }
.modal__weight { display: flex; gap: 10px; }

/* ---------- Онбординг жестов (задача 8) ---------- */
.gestures {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(10, 10, 12, 0.78);
    backdrop-filter: blur(3px);
    display: flex; flex-direction: column;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    text-align: center;
    animation: gestures-in 0.35s ease;
}
@keyframes gestures-in { from { opacity: 0; } to { opacity: 1; } }

/* Зоны повторяют пропорции жестов 30/40/30 */
.gestures__zone--top    { flex: 3; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding-top: 14px; }
.gestures__zone--mid    { flex: 4; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 26px; }
.gestures__zone--bottom { flex: 3; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; }

.gestures__label { margin: 0; color: #f2f2f5; font-size: 15px; font-weight: 600; line-height: 1.35; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }

.gestures__filter { display: flex; align-items: center; gap: 12px; text-align: left; }
.gestures__scroll { display: flex; align-items: center; justify-content: center; gap: 18px; }

/* Стрелки-шевроны */
.g-arrow {
    width: 22px; height: 22px; flex: 0 0 auto;
    border-right: 3px solid var(--accent);
    border-bottom: 3px solid var(--accent);
    border-radius: 2px;
    display: inline-block;
}
.g-arrow--down  { transform: rotate(45deg);   animation: bob-down 1.4s ease-in-out infinite; }
.g-arrow--up    { transform: rotate(-135deg); animation: bob-up 1.4s ease-in-out infinite; }
.g-arrow--right { transform: rotate(-45deg);  animation: bob-right 1.4s ease-in-out infinite; }
.g-arrow--left  { transform: rotate(135deg);  animation: bob-left 1.4s ease-in-out infinite; }
@keyframes bob-down  { 50% { translate: 0 9px; } }
@keyframes bob-up    { 50% { translate: 0 -9px; } }
@keyframes bob-right { 50% { translate: 9px 0; } }
@keyframes bob-left  { 50% { translate: -9px 0; } }

.gestures__ok {
    margin-top: 14px;
    padding: 12px 34px;
    background: var(--accent); color: #fff;
    border: none; border-radius: 999px;
    font-size: 15px; font-weight: 700; cursor: pointer;
}

/* ---------- Юридические страницы ---------- */
.wrap--legal { max-width: 760px; }
.legal { line-height: 1.6; }
.legal h2 { font-size: 1.02em; margin: 20px 0 8px; color: var(--text); }
.legal p, .legal ul { margin: 8px 0; color: #d2d2d7; font-size: 0.94em; }
.legal ul { padding-left: 22px; }
.legal li { margin: 3px 0; }
.legal a { color: var(--accent); text-decoration: underline; }

/* ===================== АДАПТИВ (вверх от мобильного) ===================== */

/* Планшет/ПК: больше места — крупнее карточки и 2 ряда повыше */
@media (min-width: 640px) {
    :root { --topbar-h: 64px; --bottombar-h: 68px; }
    .catalog { grid-auto-columns: clamp(190px, 26vw, 230px); gap: 16px; padding: 18px 18px 18px 56px; }
    .edge-handle__label { font-size: 10px; }
}

/* ПК: панель не на весь экран — фиксированная высота, колонки шире */
@media (min-width: 760px) {
    .panel { bottom: auto; height: min(520px, calc(100dvh - var(--topbar-h) - var(--bottombar-h))); }
    .about-col { flex-basis: 300px; }
    .about-col--logo { flex-basis: 240px; }
    .about-col--map { flex-basis: 420px; }
}

/* Широкий экран: каталог по-прежнему в 2 ряда */
@media (min-width: 1040px) {
    .catalog { grid-template-rows: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
