/* ---------------------------------------------------------------
   Зоотовари — storefront styles. Mobile first: every rule below is
   written for a ~360px phone, and widened in the media queries at
   the end of each block.
   --------------------------------------------------------------- */

:root {
    /* The palette is lifted straight from the shop's own logo: a pale sky
       blue, the tiger's amber and a soft ink instead of pure black. */
    --bg: #ffffff;
    --surface: #f5f8fb;
    --surface-2: #e9f0f7;
    --line: #e3e9f0;
    --text: #16202a;
    --muted: #63707e;
    --accent: #1f7099;
    --accent-dark: #185a7c;
    --accent-soft: #e9f2f8;
    --brand: #f9b236;
    --brand-dark: #d8890a;
    --brand-soft: #fff4e0;
    --sky: #bbd7ed;
    --sale: #d23f26;
    --ok: #16855f;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 1px 2px rgba(22, 32, 42, .05), 0 8px 24px rgba(22, 32, 42, .07);
    --tap: 44px;
    /* Nunito is rounded and friendly like the logo, and carries a full
       Cyrillic set; the system stack keeps the page readable if it fails. */
    --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
    --font-hand: "Caveat", "Segoe Script", cursive;
}

* { box-sizing: border-box; }

/* Без синего прямоугольника, которым телефонный браузер закрашивает кнопку
   или ссылку в момент нажатия: у кнопок свой отклик (цвет при нажатии), а
   рамка фокуса для клавиатуры (:focus-visible) остаётся. Свойство
   наследуется — одного правила на html хватает на всю страницу. */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-wrap: break-word;

    /* Подвал прижат к низу окна, даже когда текста на странице мало.
       dvh учитывает панель браузера на телефоне; vh остаётся запасным
       значением для браузеров, которые dvh не знают. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Содержимое забирает всю свободную высоту — за счёт этого подвал и уезжает
   вниз. flex-shrink: 0 не даёт длинной странице сжаться.

   width обязателен: у .wrap боковые поля стоят auto, а флексбокс из-за них
   отказывается растягивать блок по ширине окна и разворачивает его по самому
   широкому содержимому. На телефоне страница выходила вдвое шире экрана и
   показывалась как настольная. */
body > main { flex: 1 0 auto; width: 100%; }

/* Prices and measurements line up column-wise when the digits are even. */
.price-now, .price-old, .count, .range-out, .sizes td { font-variant-numeric: tabular-nums; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* An author rule like ".card { display: flex }" outranks the browser's own
   [hidden] { display: none }, so anything the scripts hide would keep showing.
   This one line makes the hidden attribute win everywhere. */
[hidden] { display: none !important; }


.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ---------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .72);
    /* Размытие держит название читаемым, когда под шапку уезжает фотография.
       Префикс нужен Safari на телефонах: без него шапка станет просто мутным
       стеклом без стекла. */
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
}

/* Браузер без размытия показал бы название поверх картинки, поэтому там
   шапка остаётся почти непрозрачной. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-header { background: rgba(255, 255, 255, .96); }
}

/* A two-colour hairline instead of a grey border: the shop's sky blue
   running into its amber. */
.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--sky), var(--brand) 55%, var(--sky));
}

.head-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 9px;
    padding-bottom: 9px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

/* No frame around the mark: the new logo comes on a white ground, so a ring
   would draw an empty box around the drawing. The rounding stays, in case a
   logo with a coloured ground is used later. */
.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 13px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* the shop's own strapline, set in the handwritten face from the logo */
.brand-tag {
    margin-top: 1px;
    color: var(--brand-dark);
    font-family: var(--font-hand);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.head-actions { margin-left: auto; display: flex; gap: 8px; }

.notice {
    background: var(--brand-soft);
    border-bottom: 1px solid #f4dfb4;
    color: #7d5a11;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    text-align: center;
}

/* -------------------------------------------------------- page heading */

.page-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
}

/* Отдельно стоящему заголовку нужен воздух под чертой; в панели каталога
   он лежит в строке с кнопками, и отступ там задаёт сама панель. */
.wrap > .page-title { margin-bottom: 18px; }

.page-title::after {
    content: '';
    display: block;
    width: 30px;
    height: 3px;
    margin-top: 5px;
    border-radius: 2px;
    background: var(--brand);
}

.count {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
    padding: 0 0 12px;
}

/* ---------------------------------------------------------- grid */

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 10px;
    padding-bottom: 40px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.card .card-price { margin-top: auto; }

/* Плитка квадратная, а снимок вписывается в неё целиком. Фото у товаров
   разной формы: студийные со сторінки виробника квадратные, свои —
   вертикальные 3:4. Обрезка «по краю» съедала у собак голову и лапы, так
   что лучше оставить поля, чем резать товар. */
.card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    /* Снимки приходят на белом фоне и без тени сливались бы со страницей.
       Тень еле заметная: её дело — очертить край плитки, а не поднять её. */
    box-shadow: 0 1px 2px rgba(22, 32, 42, .04), 0 4px 12px rgba(22, 32, 42, .07);
    transition: box-shadow .25s ease, transform .25s ease;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .35s ease;
}

.card-title {
    margin: 9px 0 4px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.price-now { font-size: 15.5px; font-weight: 800; letter-spacing: -.015em; }

/* «від 780 грн» — когда размеры одного товара стоят по-разному */
.price-from {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    margin-right: -3px;
}

.price-old {
    color: var(--muted);
    font-size: 12.5px;
    text-decoration: line-through;
}

.badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--sale);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .01em;
    box-shadow: 0 2px 8px rgba(210, 63, 38, .3);
}

.card.out .card-img img { filter: grayscale(1); opacity: .55; }

.out-badge {
    position: absolute;
    inset: auto 8px 8px;
    padding: 5px 0;
    border-radius: 999px;
    background: rgba(22, 32, 42, .8);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(4px);
}

.card.out .card-title,
.card.out .price-now { color: var(--muted); }

.empty {
    padding: 48px 0 80px;
    text-align: center;
    color: var(--muted);
}

/* ---------------------------------------------------------- product */

.back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--tap);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.gallery {
    position: relative;
    margin: 0;
}

.slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.slides::-webkit-scrollbar { display: none; }

/* Фото стоят на белом, как на самих снимках, поэтому кадр от страницы
   отделяет тонкая рамка, а не цветная подложка. Рамка одна на всю ленту и
   нарисована поверх неё: снимки листаются под ней, а не едут каждый в своей.
   Углы обрезает обёртка, а не сама лента — скруглённую ленту прокрутки
   браузеры рисуют хуже; isolation заставляет Safari обрезать и ленту,
   которую как раз листают. */
.frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg);
    isolation: isolate;
}

.frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border: 1px solid var(--line);
    border-radius: inherit;
    pointer-events: none;
}

.gallery[data-count="0"] .frame { display: none; }

.slides > div {
    flex: 0 0 100%;
    scroll-snap-align: center;
}

.slides img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: contain;
}

.dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 2px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--surface-2);
    transition: background .2s, width .2s;
}

.dot.on { background: var(--text); width: 18px; border-radius: 3px; }

.p-head { padding-top: 6px; }

.p-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.p-title {
    margin: 8px 0 12px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.p-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.p-price .price-now { font-size: 27px; }
.p-price .price-from { font-size: 15px; }
.p-price .price-old { font-size: 15px; }

.stock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    background: rgba(22, 133, 95, .09);
    font-size: 13px;
    font-weight: 700;
    color: var(--ok);
    margin-bottom: 18px;
}

.stock.no { color: var(--muted); background: var(--surface-2); }

.stock i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.desc {
    font-size: 14.5px;
    line-height: 1.62;
    padding-bottom: 24px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.desc p { margin: 0 0 10px; }
.desc ul { margin: 0 0 12px; padding-left: 20px; }
.desc li { margin-bottom: 5px; }

.related { border-top: 1px solid var(--line); padding-top: 20px; }

/* section headings across the product page carry a small amber tick */
.related h2, .sizes h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 14px;
}

.related h2::before, .sizes h2::before {
    content: '';
    width: 4px;
    height: 17px;
    border-radius: 2px;
    background: var(--brand);
    flex: 0 0 auto;
}

/* ---- лента «вам також може сподобатись» */

.rail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.rail-nav { display: flex; gap: 8px; margin-bottom: 14px; }
.rail-nav[hidden] { display: none; }

.rnav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: background .2s, opacity .2s;
}

.rnav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rnav:hover { background: var(--surface); }
.rnav[disabled] { opacity: .35; pointer-events: none; }

/* Карточки идут в ряд с прокруткой. Ширина в процентах оставляет край
   следующей карточки видимым — так понятно, что лента продолжается. */
.rail {
    display: flex;
    gap: 10px;
    /* Тень карточек выходит за их края, а всё, что за краем ленты с
       прокруткой, срезается. Поэтому лента на 16px выше и на ширину полей
       .wrap шире, чем ряд карточек, а отрицательные поля возвращают её на
       место: карточки стоят вровень с заголовком, тень цела. */
    margin: -16px -14px 0;
    padding: 16px 14px 40px;
    scroll-padding: 0 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar { display: none; }

.rail .card {
    flex: 0 0 44%;
    scroll-snap-align: start;
}

@media (min-width: 700px) {
    .rail .card { flex: 0 0 23%; }
    .rail {
        gap: 18px;
        margin: -16px -20px 0;
        padding: 16px 20px 40px;
        scroll-padding: 0 20px;
    }
}

/* ---- всплывающее сообщение о добавлении в корзину */

.toasts {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(420px, calc(100% - 28px));
    transform: translateX(-50%);
    pointer-events: none;
}

/* Одна анимация на весь срок жизни: появление, пауза и уход. Двумя
   отдельными они спорили бы за одни и те же свойства. */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px 12px 15px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 10px 28px rgba(22, 32, 42, .25);
    pointer-events: auto;
    animation: toast-life 4.2s ease both;
}

.toast.err { background: #8f2c1a; }

.toast-text { flex: 1 1 auto; }

/* друга строка: скільки не вистачає до безкоштовної доставки */
.toast-hint {
    display: block;
    margin-top: 3px;
    color: #ffd98f;
    font-size: 13px;
    font-weight: 600;
}

.toast.long { animation-duration: 6.5s; }

.toast-go {
    flex: 0 0 auto;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    transition: background .2s;
}

.toast-go:hover { background: rgba(255, 255, 255, .3); }

@keyframes toast-life {
    0%   { opacity: 0; transform: translateY(14px); }
    8%   { opacity: 1; transform: none; }
    90%  { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(14px); visibility: hidden; }
}

/* ---------------------------------------------------------- footer */

.site-footer {
    margin-top: 40px;
    padding: 24px 0 32px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    border-top: 2px solid var(--sky);
}

.foot-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.foot-brand { display: flex; align-items: center; gap: 11px; }
.foot-brand img { border-radius: 11px; }
.foot-brand span { display: flex; flex-direction: column; line-height: 1.25; }
.foot-brand b { color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.foot-brand i { font-style: normal; font-size: 12.5px; }

.site-footer a { color: var(--text); font-weight: 600; }
.site-footer a:hover { color: var(--accent); }

.foot-links { display: flex; flex-wrap: wrap; gap: 8px; }

.foot-links a {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--bg);
    box-shadow: inset 0 0 0 1px var(--line);
    font-size: 13px;
}

.foot-links a:hover { box-shadow: inset 0 0 0 1px var(--accent); }

/* Под телефоном — когда по нему звонить. */
.foot-contact { display: flex; flex-direction: column; gap: 8px; }
.foot-hours { margin: 0; font-size: 12.5px; }

/* ---------------------------------------------------------- wider screens */

@media (min-width: 480px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 18px 14px; }
    .card-title { font-size: 14px; }
}

@media (min-width: 700px) {
    .wrap { padding: 0 20px; }
    .head-row { padding-top: 12px; padding-bottom: 12px; }
    .brand-mark { width: 48px; height: 48px; border-radius: 15px; }
    .brand-name { font-size: 22px; }
    .brand-tag { font-size: 18px; }
    .page-title { font-size: 27px; }
    .grid { grid-template-columns: repeat(4, 1fr); gap: 24px 18px; }
    .p-title { font-size: 28px; }
    .foot-row { flex-direction: row; align-items: center; justify-content: space-between; }
    .foot-contact { align-items: flex-end; text-align: right; }

    .product-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 36px;
        align-items: start;
    }

    .card:hover .card-img img { transform: scale(1.05); }

    .card:hover .card-img {
        transform: translateY(-3px);
        box-shadow: 0 2px 4px rgba(22, 32, 42, .06),
                    0 10px 22px rgba(22, 32, 42, .11);
    }
}

@media (min-width: 1000px) {
    .grid { grid-template-columns: repeat(5, 1fr); }
}

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

/* ------------------------------------------------- gallery arrows + zoom */

.gnav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--text);
    cursor: pointer;
    transition: opacity .2s, background .2s;
}

.gnav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gnav.prev { left: 10px; }
.gnav.next { right: 10px; }
.gnav:hover { background: #fff; }
.gnav[disabled] { opacity: .3; pointer-events: none; }

.zoom-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(25, 25, 23, .55);
    pointer-events: none;
}

.zoom-hint svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
}

.slides img { cursor: zoom-in; }

.dot {
    padding: 0;
    border: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* ------------------------------------------------------------ size chart */

.sizes { margin-bottom: 24px; }

.sizes h2 { margin-bottom: 10px; }

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.sizes table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sizes th {
    padding: 0 14px 8px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

.sizes td {
    padding: 10px 14px 10px 0;
    border-top: 1px solid var(--line);
    white-space: nowrap;
}

.sizes th:last-child, .sizes td:last-child { padding-right: 0; }
.sizes td.sz { font-weight: 650; }
.sizes td.sz-price { font-weight: 700; }
.sizes td.sz-price s { color: var(--muted); font-weight: 500; margin-left: 6px; }

/* размер, которого сейчас нет: строка приглушена, но остаётся читаемой —
   покупателю полезно видеть замеры и цену того, что скоро вернётся */
.sizes tr.gone td { color: var(--muted); }
.sizes tr.gone td.sz { font-weight: 600; }

.sz-out {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--line);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: 1px;
}

.sizes-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.badge.flat { position: static; }

/* -------------------------------------------------------------- lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(18, 18, 16, .97);
    /* let the stage own all touch gestures */
    overscroll-behavior: contain;
}

body.lb-open { overflow: hidden; }

.lb-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.lb-stage img {
    max-width: 100%;
    max-height: 100%;
    transform-origin: 0 0;
    transition: transform .25s ease;
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
}

.lb-stage.zoomed img { transition: none; cursor: grab; }
.lb-stage.panning img { cursor: grabbing; }

.lb-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    color: #fff;
    background: linear-gradient(rgba(0, 0, 0, .45), transparent);
}

.lb-count { font-size: 13.5px; letter-spacing: .02em; }

.lb-close, .lb-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}

.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .22); }

.lb-close svg, .lb-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lb-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    margin-top: -22px;
}

.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-nav[disabled] { opacity: .25; pointer-events: none; }

.lb-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(16px + env(safe-area-inset-bottom));
    margin: 0;
    color: rgba(255, 255, 255, .65);
    font-size: 12.5px;
    text-align: center;
    transition: opacity .4s;
}

.lightbox.touched .lb-hint { opacity: 0; }

@media (min-width: 700px) {
    .gnav.prev { left: 12px; }
    .gnav.next { right: 12px; }
    .lb-hint { display: none; }
}

@media (hover: none) {
    /* on touch screens the swipe is the primary control */
    .gnav { width: 36px; height: 36px; margin-top: -18px; }
}

/* ================================================== toolbar + sort popup */

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 14px 0 12px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    height: var(--tap);
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font: 600 14px var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, background .15s;
}

.tool-btn:hover { background: var(--surface); border-color: var(--sky); }
.tool-btn.icon { width: var(--tap); padding: 0; justify-content: center; }

.tool-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fcount {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand);
    color: #3d2a05;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
}

.fcount[hidden] { display: none; }

.sort-wrap { position: relative; flex: 0 0 auto; }

.sort-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 45;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    box-shadow: var(--shadow);
}

.sort-pop[hidden] { display: none; }

.sort-pop button {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--text);
    font: 600 14px var(--font);
    text-align: left;
    cursor: pointer;
}

.sort-pop button:hover { background: var(--surface); }

.sort-pop button[aria-checked="true"] {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
}

/* ========================================================= filter panel */

.catalog { position: relative; }

.fp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(20, 20, 18, .42);
}

.fp-backdrop[hidden] { display: none; }

.filters-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 61;
    display: flex;
    flex-direction: column;
    width: min(330px, 88vw);
    background: var(--bg);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.filters-panel.open { transform: none; }

.fp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.fp-head b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

.fp-close {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.fp-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.fp-body { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }

.fp-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
}

.fgroup { padding: 16px 0; border-bottom: 1px solid var(--line); }
.fgroup:last-of-type { border-bottom: 0; }

.fgroup h3 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.cat-list { display: flex; flex-direction: column; gap: 2px; }

.cat {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--text);
    font: 600 14px var(--font);
    text-align: left;
    cursor: pointer;
}

/* Categories and brands add up, so every row carries a tick box. "Усі" is
   not a value of its own: ticking it clears the rest of the group. */
.cat::before {
    content: '';
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    transition: background-color .15s, border-color .15s;
}

.cat[aria-pressed="true"]::before {
    border-color: var(--accent);
    background: var(--accent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
        center / 13px no-repeat;
}

.cat span { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.cat:hover { background: var(--surface); }

.cat[aria-pressed="true"] {
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
}

.cat[aria-pressed="true"] span { color: var(--accent); opacity: .8; }

/* ---------------------------------------------------- dual price slider */

.range { position: relative; height: 34px; margin: 2px 10px 0; }

.range-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 15px;
    height: 4px;
    border-radius: 2px;
    background: var(--surface-2);
}

.range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
}

/* two sliders share one track: only the thumbs take pointer events */
.range input[type="range"] {
    position: absolute;
    left: 0;
    top: 9px;
    width: 100%;
    height: 16px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.range input[type="range"]:focus { outline: none; }

.range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    cursor: pointer;
}

.range input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    cursor: pointer;
}

.range input[type="range"]::-moz-range-track { background: none; }

.range-out {
    display: flex;
    justify-content: space-between;
    margin: 6px 10px 0;
    font-size: 13.5px;
    font-weight: 600;
}

/* -------------------------------------------------------- measurements */

.measures { display: flex; flex-direction: column; gap: 8px; }

.measure {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.measure > span { flex: 1; min-width: 0; }

.measure input {
    width: 88px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg);
    color: var(--text);
    /* 16px keeps iOS from zooming the page when the field gets focus */
    font: 16px var(--font);
    text-align: center;
}

.measure input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 112, 153, .14);
}

/* the hint shows the range on offer, so it must fit without clipping */
.measure input::placeholder {
    font-size: 13px;
    color: var(--muted);
    opacity: .75;
}

.measure i {
    width: 22px;
    color: var(--muted);
    font-size: 12.5px;
    font-style: normal;
}

.fhint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.45;
}

/* Ловушка для роботов: поле есть в разметке, но человек его не видит
   и не может в него попасть; display:none роботы научились обходить. */
.zs-extra {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cf-turnstile { margin: 4px 0 14px; }

.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--tap);
    font-size: 14.5px;
    cursor: pointer;
}

.switch input { width: 20px; height: 20px; accent-color: var(--accent); }

.reset {
    width: 100%;
    min-height: 40px;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    font: 600 14px var(--font);
    cursor: pointer;
}

.reset:hover { color: var(--text); background: var(--surface); }
.empty .btn { margin-top: 14px; }

.card-size {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.card.out .card-size { opacity: .7; }

body.fp-open { overflow: hidden; }

/* ============================================================== desktop */

@media (min-width: 900px) {
    .catalog {
        display: grid;
        grid-template-columns: 232px minmax(0, 1fr);
        gap: 30px;
        align-items: start;
    }

    /* the sheet becomes a plain sidebar */
    .filters-panel {
        position: sticky;
        top: 78px;
        z-index: 1;
        width: auto;
        /* never taller than the screen, so the list below can scroll inside */
        max-height: calc(100vh - 94px);
        border-right: 0;
        transform: none;
        transition: none;
    }

    .fp-head, .fp-foot, .fp-backdrop { display: none; }

    /* Long category and brand lists stay reachable: the panel scrolls on its
       own instead of waiting for the whole catalogue to be scrolled past. */
    .fp-body {
        padding: 0 10px 4px 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--surface-2) transparent;
    }

    .fp-body::-webkit-scrollbar { width: 8px; }

    .fp-body::-webkit-scrollbar-thumb {
        background: var(--surface-2);
        border-radius: 4px;
    }

    .fp-body::-webkit-scrollbar-thumb:hover { background: var(--line); }
    #filters-open { display: none; }

    .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1400px) {
    .grid { grid-template-columns: repeat(5, 1fr); }
}

/* --------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: 700 15px/1 var(--font);
    cursor: pointer;
    transition: background .15s;
}

.btn:hover { background: var(--accent-dark); }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--bg); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--surface); }

.btn[disabled], .btn.off {
    background: var(--surface-2);
    color: var(--muted);
    pointer-events: none;
}

/* ================================================================ магазин
   Кошик, оформлення замовлення і сторінка замовлення. */

/* ---- значок кошика в шапці */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    margin-left: auto;
    margin-right: -8px;
    border-radius: 50%;
    color: var(--text);
    flex: none;
}

.cart-link svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-link:hover { background: var(--surface); }
.cart-link.has { color: var(--accent); }

.cart-link b {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand);
    color: #3b2600;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

/* ---- вужча колонка для кошика та форм */
.wrap.narrow { max-width: 720px; }

.note {
    margin: 0 0 14px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 14px;
    line-height: 1.45;
}

.note.err {
    background: #fdecea;
    color: #8f2c1a;
}

/* предупреждение: не ошибка, но и мимо не пройдёшь */
.note.warn {
    background: var(--brand-soft);
    color: #7a4e05;
}

.row2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }

@media (min-width: 560px) {
    .row2 { grid-template-columns: 1fr 1fr; }
    /* улице нужно место под название, дому хватает пары знаков */
    .row2.addr { grid-template-columns: 2fr 1fr; }
}

/* ---- кнопка «в кошик» на сторінці товару */
.buy {
    margin: 18px 0 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.size-pick { margin-bottom: 14px; }

.size-pick-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { position: relative; }

.chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.chip input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Покупатель нажал «в кошик», не выбрав размер. Подсвечиваем блок и
   коротко его качаем — вместе с всплывающим сообщением этого хватает,
   чтобы понять, чего от тебя хотят. */
.size-pick.need { animation: size-nudge .38s ease; }
.size-pick.need .size-pick-label { color: #b3341c; }
.size-pick.need .chip:not(.gone) span { border-color: #e7a294; }

@keyframes size-nudge {
    0%, 100% { transform: none; }
    22%      { transform: translateX(-5px); }
    66%      { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
    .size-pick.need { animation: none; }
}

/* размер, которого нет: остаётся видимым, но перечёркнут — покупателю
   полезно знать, что такой размер вообще бывает */
.chip.gone span {
    color: var(--muted);
    background: var(--surface-2);
    border-color: transparent;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* ---- кошик */
.cart-list { list-style: none; margin: 0 0 18px; padding: 0; }

/* Телефон — два ряда рядом с фото: название и крестик, под ними количество
   и сумма. Сумма занимает и столбец крестика, поэтому названию достаётся
   всё место до крестика. */
.cart-row {
    display: grid;
    grid-template-columns: 64px auto 1fr auto;
    grid-template-areas:
        "img main main del"
        "img qty  sum  sum";
    align-items: center;
    gap: 10px 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.cart-row:last-child { border-bottom: 1px solid var(--line); }
.cart-row.gone .cart-title { color: var(--muted); }
/* у вещи, которой нет, на телефоне нет и второго ряда: ярлык «немає в
   наявності» уже всё сказал, одинокий прочерк суммы там лишний */
.cart-row.gone .cart-sum { display: none; }

.cart-img {
    grid-area: img;
    align-self: start;
    display: block;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.cart-img img { width: 100%; height: 100%; object-fit: cover; }

.cart-main { grid-area: main; align-self: start; min-width: 0; }

.cart-title {
    display: block;
    color: var(--text);
    font-weight: 700;
    line-height: 1.3;
}

.cart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.tag-out {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.qty {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    grid-area: qty;
    justify-self: start;
}

.qty button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.qty button:hover:not([disabled]) { background: var(--surface); }
.qty button[disabled] { color: var(--line); cursor: default; }
.qty b { min-width: 22px; text-align: center; font-size: 15px; }

.cart-sum {
    grid-area: sum;
    text-align: right;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* крестик — на уровне названия; поля кнопки прозрачные, поэтому она чуть
   сдвинута, чтобы сам значок встал вровень с краем суммы */
.cart-del { grid-area: del; align-self: start; margin: -4px -6px 0 0; text-align: right; }

.cart-del button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.cart-del svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.cart-del button:hover { color: var(--sale); }

.cart-foot { margin-top: 8px; }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
    font-size: 15px;
}

.cart-total b { font-size: 22px; font-weight: 800; }

/* ---- оформлення */
.co-summary {
    margin: 0 0 22px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 14px;
}

.co-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 5px 0;
}

.co-line b { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Строка с фотографией — как в корзине: так видно, что именно заказываешь. */
.co-line.item { align-items: center; gap: 12px; }

.co-thumb {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
}

.co-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.co-name { flex: 1 1 auto; min-width: 0; }


.co-line.total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 15px;
}

.co-line.total b { font-size: 19px; }

/* ---- акції: смужка під шапкою, блок у кошику, промокод, підсумки */

/* Смужка під шапкою — мʼятна, колір вигоди: той самий зелений, що й
   «Доставка безкоштовна» в кошику та на оформленні (вибір власника). */
.promo-strip {
    border-bottom: 1px solid #c8e8d8;
    background: #e3f4ec;
    color: #0f5c43;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.promo-strip-in {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px 22px;
    padding-top: 7px;
    padding-bottom: 7px;
    text-align: center;
}

.promo-item { display: inline-flex; align-items: center; gap: 8px; }

/* Акція на доставку веде на «Доставка і оплата». Коли в смужці лише вона,
   посилання розтягнуте на всю смужку — натиснути можна будь-де. */
a.promo-item:hover span { text-decoration: underline; text-underline-offset: 3px; }
a.promo-item:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }
.promo-strip.whole { position: relative; }
.promo-strip.whole a.promo-item::after { content: ""; position: absolute; inset: 0; }

/* значки акцій: грузовик і ярлик із відсотком, лінією, як кошик у шапці */
.pico {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.promo-strip .pico { color: var(--ok); }

/* Кошик: скільки не вистачає до акції — зі смужкою, що заповнюється, — і що
   вже дісталося. Бурштиновий — «ще трохи», зелений — «готово». */
.perks { display: grid; gap: 10px; margin: 0 0 18px; }

.perk {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    line-height: 1.45;
}

.perk p { margin: 0; }
.perk small { display: block; margin-top: 2px; font-size: 12.5px; opacity: .85; }
.perk .pico { width: 24px; height: 24px; }

.perk.done { background: #e6f5ee; color: #12654a; }

.perk.goal {
    border: 1px solid #f4dfb4;
    background: var(--brand-soft);
    color: #6b4a07;
}

.perk.goal .pico { color: var(--brand-dark); }
.perk-main { flex: 1 1 auto; min-width: 0; }

.perk-bar {
    display: block;
    height: 8px;
    margin-top: 9px;
    border-radius: 999px;
    background: rgba(216, 137, 10, .18);
    overflow: hidden;
}

.perk-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}

.perk-main a {
    display: inline-block;
    margin-top: 9px;
    color: var(--accent-dark);
    font-size: 13.5px;
    font-weight: 700;
}

.perk-main a:hover { text-decoration: underline; }

/* «Доставка і оплата»: умови акції на доставку над текстом власника — тим
   самим мʼятним блоком, що й «Доставка безкоштовна» в кошику */
.ship-terms { margin-bottom: 24px; }
.ship-terms .perk { font-size: 14.5px; line-height: 1.55; }
.ship-terms .perk b { display: block; margin-bottom: 3px; font-size: 16px; }

/* Підсумки: товари, знижка, доставка, разом. Над ними — риска від списку
   товарів; якщо рядок один («Разом»), друга риска не потрібна. */
.sums {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.sums > .co-line.total:first-child { margin-top: 0; padding-top: 5px; border-top: 0; }
.sums .co-line.sub { color: var(--muted); }
.sums .co-line.gain { color: var(--ok); font-weight: 700; }

.cart-sums { margin: 0 0 14px; padding-top: 0; border-top: 0; }
.cart-sums .co-line.total { font-size: 15px; }
.cart-sums .co-line.total b { font-size: 22px; font-weight: 800; }

/* Промокод на оформленні: згорнуте «Маєте промокод?», поле з кнопкою,
   застосований код — «квитком» з пунктирною рамкою. */
.co-promo {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.co-promo summary {
    width: max-content;
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.co-promo[open] summary { margin-bottom: 10px; }

.promo-row { display: flex; align-items: center; gap: 8px; }
.promo-row.on { flex-wrap: wrap; gap: 6px 14px; }

.promo-row input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: var(--tap);
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    /* 16px: iPhone не збільшує сторінку, коли поле отримує фокус */
    font: 700 16px/1.4 var(--font);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.promo-row input::placeholder { font-weight: 500; letter-spacing: 0; text-transform: none; }

.promo-row input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.promo-row .btn { flex: 0 0 auto; }

.promo-chip {
    display: inline-block;
    padding: 3px 10px;
    border: 1.5px dashed var(--accent);
    border-radius: 8px;
    background: var(--bg);
    color: var(--accent-dark);
    font: 800 14px/1.4 ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: .04em;
}

.promo-row .lnk {
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: 600 13.5px var(--font);
    text-decoration: underline;
    cursor: pointer;
}

.promo-row .lnk:hover { color: var(--sale); }

.promo-msg { margin: 8px 0 0; font-size: 13px; font-weight: 600; line-height: 1.45; }
.promo-msg.ok { color: var(--ok); }
.promo-msg.idle { color: var(--muted); }
.promo-msg.bad { color: #b3341c; }

.note .promo-chip { padding: 0 7px; font-size: 13px; }

/* Доставка на оформленні: безкоштовно, скільки не вистачає чи «за тарифами» */
.ship-notes .note { margin: 0; }
.ship-notes .fhint { margin-top: 0; }

.note.ok { background: #e6f5ee; color: #12654a; }

.ship-note { display: flex; align-items: flex-start; gap: 10px; }
.ship-note .pico { margin-top: 1px; }
.ship-note a { color: inherit; font-weight: 700; text-decoration: underline; }

/* сума до сплати ще раз — просто над кнопкою, щоб не гортати вгору */
.co-final {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 8px 0 12px;
    font-size: 15px;
    font-weight: 700;
}

.co-final b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* під кнопкою: натискання — це згода з офертою */
.co-legal { text-align: center; }
.co-legal a { color: inherit; text-decoration: underline; }

.order-facts dd small.free { color: var(--ok); font-weight: 600; }

.co-form h2 {
    margin: 26px 0 12px;
    font-size: 16px;
    font-weight: 800;
}

.co-form label {
    display: block;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.co-form input,
.co-form textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    min-height: var(--tap);
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: 500 15px/1.4 var(--font);
}

.co-form textarea { min-height: 0; resize: vertical; }

/* Прямоугольная рамка фокуса шла и на радиокнопки — вокруг круглой точки
   оставался квадрат. Текстовым полям она нужна, кружкам — своя, круглая, и
   только когда по форме идут с клавиатуры: мышью и так видно, что выбрано. */
.co-form input:not([type="radio"]):not([type="checkbox"]):focus,
.co-form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.co-form .choice input:focus-visible {
    border-radius: 50%;
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.co-form .opt { font-weight: 500; color: var(--muted); opacity: .8; }

.co-form .bad {
    display: block;
    margin-top: 5px;
    color: #b3341c;
    font-size: 12.5px;
    font-style: normal;
    font-weight: 600;
}

.choices { display: grid; gap: 8px; margin-bottom: 16px; }

.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--tap);
    margin: 0;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---- сторінка замовлення */

/* На этой странице нет ссылки «назад», а именно она на остальных страницах
   отбивает содержимое от шапки. Поэтому воздух сверху задаём сами. */
.thanks { margin: 22px 0 18px; }

/* Вводная строка страницы отслеживания. */
.lead {
    margin: 0 0 18px;
    max-width: 46rem;
    color: var(--muted);
    font-size: 15px;
}

.track-form { margin-bottom: 14px; }

/* Кнопка «до каталогу» внизу заказа: ей нужен воздух и сверху, и снизу. */
.order-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin: 24px 0 8px;
}

.thanks h1 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

.thanks p { margin: 0; color: var(--muted); }

.status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    font-weight: 700;
}

.status-line .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
}

.status-line .dot.s-new { background: var(--brand); }
.status-line .dot.s-confirmed,
.status-line .dot.s-awaiting { background: var(--accent); }
.status-line .dot.s-paid,
.status-line .dot.s-shipped,
.status-line .dot.s-done { background: var(--ok); }
.status-line .dot.s-cancelled { background: var(--sale); }

.pay-box {
    margin: 0 0 22px;
    padding: 16px;
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    background: var(--brand-soft);
}

.pay-box h2 { margin: 0 0 10px; font-size: 16px; font-weight: 800; }

/* Текст блока целиком пишет владелец: заголовки, абзацы, строки реквизитов. */
.pay-text {
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.pay-text p { margin: 0 0 10px; }
.pay-text p:last-child { margin-bottom: 0; }
.pay-text p + h2 { margin-top: 18px; }

.order-facts {
    margin: 0 0 22px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px 16px;
    font-size: 14px;
}

.order-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-top: 12px;
}

.order-facts dd { margin: 0; line-height: 1.5; }
.order-facts dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }

@media (min-width: 560px) {
    .order-facts { grid-template-columns: 150px 1fr; }
    .order-facts dt { margin-top: 0; padding-top: 3px; }
    .order-facts dd { margin-bottom: 8px; }
}

@media (min-width: 560px) {
    /* на широком экране количество, сумма и крестик встают в одну строку */
    .cart-row {
        grid-template-columns: 64px 1fr auto 116px 30px;
        grid-template-areas: "img main qty sum del";
    }
    .cart-img, .cart-main, .cart-del { align-self: center; }
    .cart-del { margin: 0; }
    .cart-row.gone .cart-sum { display: block; }
}

/* Варианты выбора внутри формы: правила для обычных полей .co-form label /
   .co-form input сильнее, чем .choice, поэтому переопределяем их прицельно —
   иначе радиокнопка растягивается на всю ширину, как текстовое поле. */
.co-form .choice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.co-form .choice input {
    display: inline-block;
    width: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}

.co-form .choice span { font: inherit; }

/* ---- текстовые страницы (доставка, возврат, контакты) */
.page-text { font-size: 15px; line-height: 1.65; }
.page-text h2 { margin: 26px 0 10px; font-size: 17px; font-weight: 800; }
.page-text h2:first-child { margin-top: 0; }
.page-text p { margin: 0 0 12px; }
.page-text ul { margin: 0 0 14px; padding-left: 20px; }
.page-text li { margin-bottom: 5px; }

/* ================================================= категории и бренды
   Полоса категорий над каталогом, тексты страниц категорий и брендов,
   хлебные крошки над товаром и ссылки на эти страницы в подвале. */

/* Настоящие ссылки на страницы категорий. На телефоне полоса листается
   пальцем от края до края экрана, на широком — переносится на вторую
   строку, если не поместится. */
.cat-strip {
    display: flex;
    gap: 8px;
    margin: 0 -14px;
    padding: 12px 14px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cat-strip::-webkit-scrollbar { display: none; }

.cat-strip a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.cat-strip a:hover { background: var(--surface-2); }

.cat-strip a[aria-current="page"] {
    background: var(--accent);
    color: #fff;
}

/* под полосой заголовку каталога хватает отступа поменьше */
.cat-strip + .toolbar { padding-top: 12px; }

/* текст страницы: короткий — над товарами, подробный — под ними */
.catalog-lead { max-width: 760px; margin-bottom: 14px; }
.catalog-lead > :last-child { margin-bottom: 0; }

.catalog-text {
    max-width: 760px;
    margin: 4px 0 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

/* хлебные крошки над товаром: Каталог › Куртки */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    min-height: var(--tap);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.crumbs a:hover { color: var(--accent); }
.crumbs span { opacity: .55; }

/* бренд и категория над названием товара — ссылки на их страницы */
.p-meta a {
    text-decoration: underline;
    text-decoration-color: rgba(31, 112, 153, .3);
    text-underline-offset: 3px;
}

.p-meta a:hover { text-decoration-color: currentColor; }

/* категории и бренды в подвале: ссылки на их страницы с любой страницы */
.foot-cats {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.foot-cats nav { display: flex; flex-wrap: wrap; gap: 5px 16px; }

.foot-cats b {
    flex: 0 0 100%;
    color: var(--text);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.site-footer .foot-cats a { color: var(--muted); }
.site-footer .foot-cats a:hover { color: var(--accent); }

@media (min-width: 700px) {
    .cat-strip { margin: 0 -20px; padding: 14px 20px 0; }
    .foot-cats { flex-direction: row; gap: 56px; }
}

@media (min-width: 900px) {
    .cat-strip { flex-wrap: wrap; margin: 0; padding: 16px 0 0; overflow: visible; }
}

.foot-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
}

.foot-pages a { color: var(--muted); }
.foot-pages a:hover { color: var(--accent); }

/* ---- поле с подсказками (город и отделение Новой почты) */
.co-form .field {
    position: relative;
    margin-bottom: 14px;
}

.co-form .field > label {
    display: block;
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.co-form .field > input { margin-top: 0; }

.ac-list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: 100%;
    max-height: 280px;
    margin: 4px 0 0;
    padding: 5px;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    box-shadow: var(--shadow);
}

.ac-list li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 9px 11px;
    border-radius: 9px;
    cursor: pointer;
    line-height: 1.3;
}

.ac-list li b { font-size: 14.5px; font-weight: 700; }

.ac-list li span {
    color: var(--muted);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-list li:hover,
.ac-list li.on { background: var(--accent-soft); }

/* ---- «скопіювати» одним натисканням: ТТН і те, що в реквізитах узято в [[ ]] */

.copy {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin: 0;
    padding: 2px 8px 2px 9px;
    border: 1px dashed rgba(22, 32, 42, .35);
    border-radius: 8px;
    background: rgba(255, 255, 255, .75);
    color: inherit;
    font: inherit;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    vertical-align: baseline;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.copy:hover { border-style: solid; background: #fff; }
.copy span { word-break: break-all; }

.copy svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .7;
}

.copy .ok { display: none; }
.copy.done .dup { display: none; }
.copy.done .ok { display: block; color: var(--ok); opacity: 1; }

/* Підказка «Скопійовано» спливає над кнопкою і сама зникає разом із класом. */
.copy.done::after {
    content: 'Скопійовано';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    padding: 4px 9px;
    border-radius: 8px;
    background: var(--text);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
}
