/* ==========================================================================
   MoniKAVA Shop — вітрина.

   На відміну від admin.css (робочий інструмент, щільна таблична сітка),
   тут — вітрина: більше повітря, більший шрифт, великі картинки товару,
   м'які тіні. Той самий бренд, інший настрій.

   Бренд:
     Mist Teal    #96C2C1  — акценти, підкладки
     Forest Night #143109  — заголовки, шапка, текст
     DeepGreen    #0A7A32  — кнопки дії

   Без CDN і без бібліотек: шрифти системні, іконки — інлайновий SVG.
   ========================================================================== */

:root {
    --brand-mist: #96C2C1;
    --brand-forest: #143109;
    --brand-green: #0A7A32;

    --bg: #FAFBF9;
    --surface: #FFFFFF;
    --surface-alt: #F3F6F2;
    --text: #17231A;
    --text-muted: #62705F;
    --border: #E3E9DF;

    --danger: #B3261E;
    --danger-bg: #FCEEED;
    --warn: #8A5A00;
    --warn-bg: #FEF6E6;

    --radius: 14px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 3px rgba(20, 49, 9, 0.08);
    --shadow-md: 0 10px 30px rgba(20, 49, 9, 0.10);

    --s1: 6px;
    --s2: 12px;
    --s3: 18px;
    --s4: 28px;
    --s5: 44px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

h1, h2, h3 { color: var(--brand-forest); line-height: 1.25; }

a { color: inherit; }

img { max-width: 100%; display: block; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.s-skip {
    position: absolute; left: -999px; top: 0; z-index: 200;
    background: var(--brand-forest); color: #fff;
    padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
}
.s-skip:focus { left: 0; }

:focus-visible {
    outline: 3px solid var(--brand-green);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.s-muted { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */

.s-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.s-header__row {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--s2) var(--s3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
    min-height: var(--header-h);
}

.s-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--brand-forest);
    font-weight: 700;
    font-size: 20px;
    flex: none;
}

/* Фірмовий знак — растр із пропорціями 200:295 (кіт вищий, ніж ширший).
   Тому задаємо ВИСОТУ, а ширину лишаємо auto: кругла підкладка тут була б
   помилкою — вона або обрізала б вуха, або лишила порожні поля з боків. */
.s-brand__mark {
    height: 34px;
    width: auto;
    display: block;
}

.s-burger {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    cursor: pointer;
    flex: none;
}
.s-burger svg { width: 20px; height: 20px; color: var(--brand-forest); }

.s-search {
    flex: 1 1 auto;
    display: flex;
    max-width: 480px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.s-search__input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font: inherit;
    color: var(--text);
    min-width: 0;
}
.s-search__input:focus { outline: none; }

.s-search__btn {
    border: none;
    background: transparent;
    width: 44px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--brand-forest);
    flex: none;
}
.s-search__btn svg { width: 18px; height: 18px; }

.s-cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--brand-forest);
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    flex: none;
    position: relative;
    white-space: nowrap;
    transition: background 160ms ease, border-color 160ms ease;
}
.s-cart-link:hover { background: var(--brand-mist); border-color: var(--brand-mist); }
.s-cart-link svg { width: 20px; height: 20px; }

.s-cart-link__badge {
    background: var(--brand-green);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.s-cart-link__badge[hidden] { display: none; }

/* Навігація категоріями */
.s-nav {
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}

.s-nav__list {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--s3);
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.s-nav__item { position: relative; }

.s-nav__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: color 160ms ease, border-color 160ms ease;
}
.s-nav__link:hover, .s-nav__link.is-active { color: var(--brand-green); border-color: var(--brand-green); }

.s-nav__count {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 6px;
}

.s-nav__sub {
    list-style: none;
    margin: 0; padding: 0;
    display: none;
    position: absolute;
    left: 0; top: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 220px;
    z-index: 20;
    overflow: hidden;
}
.s-nav__sub a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
}
.s-nav__sub a:hover, .s-nav__sub a.is-active { background: var(--surface-alt); color: var(--brand-green); }
.s-nav__item.has-children:hover .s-nav__sub,
.s-nav__item.has-children:focus-within .s-nav__sub { display: block; }

/* --------------------------------------------------------------------------
   Каркас сторінки
   -------------------------------------------------------------------------- */

.s-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--s4) var(--s3) var(--s5);
}

.s-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: var(--s3);
}
.s-breadcrumbs a { text-decoration: none; color: var(--text-muted); }
.s-breadcrumbs a:hover { color: var(--brand-green); text-decoration: underline; }

.s-page-title { margin: 0 0 var(--s2); font-size: 30px; letter-spacing: -0.01em; }
.s-page-lead { margin: 0 0 var(--s4); color: var(--text-muted); max-width: 60ch; }

/* --------------------------------------------------------------------------
   Головна — інтро й плитка категорій
   -------------------------------------------------------------------------- */

.s-hero {
    background: linear-gradient(155deg, var(--brand-forest) 0%, #24500F 60%, var(--brand-mist) 130%);
    color: #fff;
    border-radius: var(--radius);
    padding: var(--s5) var(--s4);
    margin-bottom: var(--s5);
}
.s-hero h1 { color: #fff; margin: 0 0 var(--s2); font-size: 34px; }
.s-hero p { margin: 0; max-width: 60ch; color: rgba(255,255,255,0.86); font-size: 16.5px; }

.s-section { margin-bottom: var(--s5); }
.s-section__title { font-size: 22px; margin: 0 0 var(--s3); }

.s-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s3);
}

.s-cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s1);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s4) var(--s2);
    box-shadow: var(--shadow-sm);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.s-cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-mist); }
.s-cat-tile img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; margin-bottom: 4px; }
.s-cat-tile__noimg {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--surface-alt); color: var(--brand-mist);
    display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.s-cat-tile__noimg svg { width: 26px; height: 26px; }
.s-cat-tile__title { font-weight: 700; color: var(--brand-forest); }
.s-cat-tile__count { font-size: 13px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Сітка товарів
   -------------------------------------------------------------------------- */

.s-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s3);
}

.s-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.s-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-mist); }

.s-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.s-card__media img { width: 100%; height: 100%; object-fit: cover; }
.s-card__noimg { color: var(--brand-mist); }
.s-card__noimg svg { width: 40px; height: 40px; }

.s-card__badge {
    position: absolute;
    top: var(--s1);
    left: var(--s1);
    z-index: 1;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--brand-green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.s-card__body { padding: var(--s2) var(--s3) var(--s3); display: flex; flex-direction: column; gap: 4px; }
.s-card__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.s-card__price { font-weight: 700; color: var(--brand-green); font-size: 16px; }

/* --------------------------------------------------------------------------
   Тулбар (сортування) і пагінація
   -------------------------------------------------------------------------- */

.s-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    margin-bottom: var(--s3);
    flex-wrap: wrap;
}
.s-toolbar__count { color: var(--text-muted); font-size: 14px; }
.s-toolbar__sort select {
    font: inherit;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}

.s-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: var(--s4);
}
.s-pager a, .s-pager span {
    min-width: 36px; min-height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    font-size: 14px;
}
.s-pager a:hover { border-color: var(--brand-green); color: var(--brand-green); }
.s-pager [aria-current="page"] { background: var(--brand-forest); border-color: var(--brand-forest); color: #fff; font-weight: 700; }
.s-pager__gap { border: none; background: none; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Порожні стани
   -------------------------------------------------------------------------- */

.s-empty {
    text-align: center;
    padding: var(--s5) var(--s3);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s2);
}
.s-empty svg { width: 56px; height: 56px; color: var(--brand-mist); }
.s-empty h1 { margin: 0; }
.s-empty p { margin: 0; max-width: 46ch; }

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */

.s-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 22px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, transform 100ms ease;
}
.s-btn:hover { border-color: var(--brand-green); color: var(--brand-green); }
.s-btn:active { transform: scale(0.98); }

.s-btn--primary { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }
.s-btn--primary:hover { background: #086128; border-color: #086128; color: #fff; }

.s-btn--danger { color: var(--danger); border-color: #E5C3C0; }
.s-btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.s-btn--sm { min-height: 34px; padding: 6px 14px; font-size: 13.5px; }
.s-btn--lg { width: 100%; font-size: 16px; }

.s-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.s-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: border-color 160ms ease, color 160ms ease;
}
.s-chip:hover { border-color: var(--brand-green); color: var(--brand-green); }

/* Ряд підкатегорій над сіткою — головний спосіб звузити категорію.
   Горизонтальний скрол, а не перенос: на вузькому екрані ряд із 3–4 назв
   інакше з'їдав би пів першого екрана й відсував самі товари. */
.s-subcats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin: 0 0 var(--s4);
}

.s-chip__count {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

/* Порожня підкатегорія: приглушена, але жива й клікабельна — сигнал
   «є в асортименті, зараз немає», а не «розділу не існує». */
.s-chip--empty {
    color: var(--text-muted);
    border-style: dashed;
}
.s-chip--empty .s-chip__count { font-weight: 600; }

.s-chip--active {
    background: var(--brand-forest);
    border-color: var(--brand-forest);
    color: #fff;
}
.s-chip--active:hover { border-color: var(--brand-forest); color: #fff; }
.s-chip--active .s-chip__count { color: var(--brand-mist); }

@media (max-width: 560px) {
    .s-subcats {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        /* поля з'їдають контейнерний padding, щоб ряд «витікав» за край
           і було видно, що він гортається */
        margin-inline: calc(-1 * var(--s3));
        padding-inline: var(--s3);
    }
    .s-subcats::-webkit-scrollbar { display: none; }
    .s-chip { flex: none; }
}

/* --------------------------------------------------------------------------
   Сторінка варіанта
   -------------------------------------------------------------------------- */

.s-variant {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s4);
}

.s-variant__media {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.s-variant__media img { width: 100%; height: 100%; object-fit: cover; }
.s-variant__noimg { color: var(--brand-mist); }
.s-variant__noimg svg { width: 72px; height: 72px; }

.s-variant__title { font-size: 26px; margin: 0 0 6px; }
.s-variant__price { font-size: 24px; font-weight: 700; color: var(--brand-green); margin-bottom: var(--s3); }
.s-variant__lead { color: var(--text-muted); margin: var(--s3) 0; }

.s-variant__specs {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    margin: var(--s3) 0;
    padding: var(--s3);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.s-variant__spec-row {
    display: flex;
    align-items: flex-start;
    gap: var(--s2);
    line-height: 1.5;
}
.s-variant__spec-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--brand-mist);
}
.s-variant__shelf {
    margin: 0;
    padding-left: calc(20px + var(--s2));
    font-size: 13px;
    color: var(--text-muted);
}

.s-variant__desc { margin-top: var(--s4); border-top: 1px solid var(--border); padding-top: var(--s3); }
.s-variant__desc h2 { font-size: 17px; }

.s-variant__preorder {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-green);
    border-radius: var(--radius-sm);
    padding: var(--s2) var(--s3);
    margin-bottom: var(--s3);
    font-size: 14px;
}
.s-variant__preorder-head { display: flex; align-items: center; gap: 8px; }
.s-variant__preorder-head svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--brand-green); }
.s-variant__preorder-head strong { color: var(--brand-forest); }
.s-variant__preorder-terms { margin: 0; color: var(--text-muted); }
.s-variant__preorder-sms { margin: 0; color: var(--text-muted); font-size: 12.5px; }

.s-siblings { margin-bottom: var(--s3); }
.s-siblings__label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.s-siblings__list { display: flex; flex-wrap: wrap; gap: 6px; }

.s-buy { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }

.s-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface);
}
.s-qty__btn {
    width: 40px; height: 44px;
    border: none;
    background: var(--surface-alt);
    font-size: 18px;
    cursor: pointer;
    color: var(--brand-forest);
}
.s-qty__btn:hover { background: var(--brand-mist); }
.s-qty__input {
    width: 48px;
    height: 44px;
    border: none;
    text-align: center;
    font: inherit;
    font-weight: 600;
    -moz-appearance: textfield;
}
.s-qty__input::-webkit-outer-spin-button,
.s-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.s-alert {
    padding: var(--s2) var(--s3);
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 14.5px;
    margin-bottom: var(--s3);
}
.s-alert--warn { background: var(--warn-bg); border-color: #EBD6A6; color: var(--warn); }
.s-alert--err { background: var(--danger-bg); border-color: #E5C3C0; color: var(--danger); }
.s-alert--ok { background: #E8F5EC; border-color: #BFE3C9; color: var(--brand-green); }

/* --------------------------------------------------------------------------
   Кошик
   -------------------------------------------------------------------------- */

.s-cart-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-direction: column; gap: var(--s2); }

.s-cart-row {
    display: grid;
    grid-template-columns: 64px 1fr auto auto auto;
    align-items: center;
    gap: var(--s2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s2);
}
.s-cart-row.is-unavailable { background: var(--surface-alt); }

.s-cart-row__media { width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); flex: none; }
.s-cart-row__media img { width: 100%; height: 100%; object-fit: cover; }
.s-cart-row__noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--brand-mist); }
.s-cart-row__noimg svg { width: 24px; height: 24px; }

.s-cart-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-cart-row__title { font-weight: 600; text-decoration: none; color: var(--text); }
.s-cart-row__title:hover { color: var(--brand-green); }
.s-cart-row__price { color: var(--text-muted); font-size: 13.5px; }
.s-cart-row__issue { color: var(--warn); font-size: 13px; font-weight: 600; }

.s-cart-row__qty { display: flex; align-items: center; gap: 6px; }
.s-cart-row__qty .s-qty__btn { width: 32px; height: 34px; font-size: 15px; }
.s-cart-row__qty .s-qty__input { width: 40px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

.s-cart-row__sum { font-weight: 700; min-width: 80px; text-align: right; font-variant-numeric: tabular-nums; }

.s-cart-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s4);
    max-width: 380px;
    margin-left: auto;
    box-shadow: var(--shadow-sm);
}
.s-cart-summary__total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s3); font-size: 17px; }
.s-cart-summary__total strong { font-size: 24px; color: var(--brand-green); }
.s-cart-summary__hint { font-size: 12.5px; margin: var(--s2) 0 0; text-align: center; }

/* --------------------------------------------------------------------------
   Чекаут
   -------------------------------------------------------------------------- */

.s-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--s4);
    align-items: start;
}

.s-checkout-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s4);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}

.s-field { display: flex; flex-direction: column; gap: 6px; }
.s-field__label { font-size: 13.5px; font-weight: 600; color: var(--brand-forest); }
.s-field__label .s-field__opt { font-weight: 400; color: var(--text-muted); }

.s-input, .s-textarea {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    width: 100%;
}
.s-input:focus, .s-textarea:focus { outline: none; border-color: var(--brand-green); }
.s-textarea { resize: vertical; min-height: 80px; }

.s-field.has-error .s-input,
.s-field.has-error .s-textarea { border-color: var(--danger); }
.s-field__error { color: var(--danger); font-size: 12.5px; }

.s-radio-group { display: flex; flex-direction: column; gap: 8px; }
.s-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.s-radio:has(input:checked) { border-color: var(--brand-green); background: var(--surface-alt); }
.s-radio input { width: 18px; height: 18px; accent-color: var(--brand-green); flex: none; }

.s-checkout-np {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    padding: var(--s3);
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
}
.s-checkout-np[hidden] { display: none; }

.s-checkout-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s4);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--header-h) + var(--s3));
}
.s-checkout-summary h2 { font-size: 17px; margin: 0 0 var(--s3); }

.s-checkout-summary__items { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-direction: column; gap: 8px; }
.s-checkout-summary__item { display: flex; justify-content: space-between; gap: var(--s2); font-size: 13.5px; }
.s-checkout-summary__item span:first-child { color: var(--text-muted); }
.s-checkout-summary__item strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

.s-checkout-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
    border-top: 1px solid var(--border);
}
.s-checkout-summary__row[hidden] { display: none; }

.s-checkout-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 17px;
    padding-top: var(--s2);
    margin-top: 4px;
    border-top: 1px solid var(--border);
}
.s-checkout-summary__total strong { font-size: 24px; color: var(--brand-green); }
.s-checkout-summary__total[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Підвал
   -------------------------------------------------------------------------- */

.s-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: var(--s5);
}

.s-footer__grid {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--s4) var(--s3);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s4);
}

.s-footer__title {
    margin: 0 0 var(--s2);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--brand-forest);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.s-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.s-footer__links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
}
.s-footer__links a:hover { color: var(--brand-green); text-decoration: underline; }

.s-footer__row {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--s3);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13.5px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
}
.s-footer__row p { margin: 0; }

@media (max-width: 640px) {
    .s-footer__grid { grid-template-columns: 1fr; gap: var(--s3); }
}

/* --------------------------------------------------------------------------
   Чекаут — згода з офертою під кнопкою
   -------------------------------------------------------------------------- */

.s-checkout-consent {
    font-size: 12.5px;
    text-align: center;
    color: var(--text-muted);
    margin: 0;
}
.s-checkout-consent a { color: var(--brand-green); text-decoration: underline; }

/* --------------------------------------------------------------------------
   Юридичні сторінки (оферта, повернення, доставка, контакти, конфіденційність)

   Довгий суцільний текст читається інакше, ніж каталог: вужчий рядок,
   більший міжрядковий інтервал, помітні заголовки — на відміну від
   .s-main, розрахованого на сітки карток і форми.
   -------------------------------------------------------------------------- */

.s-legal {
    max-width: 68ch;
    line-height: 1.75;
    font-size: 15.5px;
}

.s-legal h2 {
    font-size: 20px;
    margin: var(--s5) 0 var(--s2);
    padding-top: var(--s3);
    border-top: 1px solid var(--border);
}
.s-legal h2:first-of-type { margin-top: var(--s4); }

.s-legal h3 {
    font-size: 16.5px;
    margin: var(--s4) 0 var(--s1);
}

.s-legal p { margin: 0 0 var(--s2); }

.s-legal ul, .s-legal ol {
    margin: 0 0 var(--s3);
    padding-left: 1.3em;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.s-legal a { color: var(--brand-green); text-decoration: underline; }

.s-legal__updated {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0 0 var(--s4);
}


/* Виділений блок — використано для правила "харчове не повертається". */
.s-legal-highlight {
    border-radius: var(--radius-sm);
    padding: var(--s3);
    margin: var(--s4) 0;
    border: 1px solid var(--border);
    background: var(--surface-alt);
}
.s-legal-highlight h2 { margin-top: 0; padding-top: 0; border-top: none; }
.s-legal-highlight--warn {
    background: var(--danger-bg);
    border-color: #E5C3C0;
}
.s-legal-highlight--warn h2 { color: var(--danger); }

.s-legal-kv {
    margin: 0 0 var(--s3);
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px var(--s3);
}
.s-legal-kv dt { color: var(--text-muted); font-size: 13.5px; }
.s-legal-kv dd { margin: 0; font-weight: 600; }

.s-legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 var(--s3);
    font-size: 14px;
}
.s-legal-table th, .s-legal-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.s-legal-table th {
    background: var(--surface-alt);
    color: var(--brand-forest);
    font-weight: 700;
}

@media (max-width: 640px) {
    .s-legal-table { display: block; overflow-x: auto; }
    .s-legal-kv { grid-template-columns: 1fr; }
    .s-legal-kv dt { margin-top: var(--s1); }
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
    .s-cat-grid { grid-template-columns: repeat(4, 1fr); }
    .s-grid { grid-template-columns: repeat(3, 1fr); }
    .s-variant { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

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

@media (max-width: 900px) {
    .s-burger { display: flex; }
    .s-search { order: 3; flex-basis: 100%; max-width: none; }
    .s-nav { display: none; }
    .s-nav.is-open { display: block; }
    .s-nav__list { flex-direction: column; padding: var(--s2) var(--s3); }
    .s-nav__sub { position: static; display: block; box-shadow: none; border: none; margin-left: var(--s2); }
    .s-nav__item.has-children:hover .s-nav__sub { display: block; }
}

@media (max-width: 640px) {
    .s-cart-row { grid-template-columns: 56px 1fr; grid-template-areas: "media body" "qty qty" "sum remove"; }
    .s-cart-row__media { grid-area: media; width: 56px; height: 56px; }
    .s-cart-row__body { grid-area: body; }
    .s-cart-row__qty { grid-area: qty; justify-content: flex-start; }
    .s-cart-row__sum { grid-area: sum; text-align: left; }
    .s-cart-row form:last-child { grid-area: remove; justify-self: end; }
    .s-cart-summary { max-width: none; }
    .s-checkout { grid-template-columns: 1fr; }
    .s-checkout-summary { position: static; }
}

/* Повага до prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
