/* ==========================================================================
   Borshoka — public site styles
   One stylesheet for every public page. Admin uses admin.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

    --bg: #FAF7F2;
    --surface: #FFFFFF;
    --sand: #F3EDE4;
    --sand-2: #E9E1D5;
    --line: #E6DFD4;
    --line-strong: #D6CDBF;

    --ink: #1E2B22;
    --ink-2: #4A574E;
    --ink-3: #626D66;   /* ≥4.5:1 on --bg, --sand and white */

    --brand: #2E6B3A;
    --brand-hover: #245730;
    --brand-soft: #E3EEE0;
    --brand-tint: #F0F6EE;

    --accent: #B4532A;
    --accent-soft: #F9E8DF;
    --star: #E0A21B;

    --danger: #B42318;
    --danger-soft: #FEE4E2;
    --warning: #8A4B0B;
    --warning-soft: #FDF0D5;
    --info: #1F5A80;
    --info-soft: #E2EFF8;

    /* Tailored, not bubbly: crisp controls, softly rounded surfaces */
    --radius-xs: 3px;   /* buttons, inputs, chips, labels */
    --radius-sm: 6px;   /* thumbnails, icon tiles, notices */
    --radius: 8px;      /* cards */
    --radius-lg: 12px;  /* large media and panels */
    --pill: 999px;      /* only for true circles/dots and the toggle switch */

    --shadow-sm: 0 1px 2px rgba(30, 43, 34, 0.06);
    --shadow: 0 6px 20px rgba(30, 43, 34, 0.08);
    --shadow-lg: 0 20px 50px rgba(30, 43, 34, 0.16);

    --header-h: 68px;
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* Legacy names still used in a few inline styles */
    --primary-green: var(--brand);
    --primary-color: var(--brand);
    --light-green: var(--brand-soft);
    --dark-green: var(--brand-hover);
    --text-dark: var(--ink);
    --text-medium: var(--ink-2);
    --text-light: var(--ink-3);
    --text-color: var(--ink-2);
    --cream: var(--bg);
    --white: var(--surface);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-2);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

body.i18n-loaded { opacity: 1; }
body.nav-open, body.cart-open { overflow: hidden; }

main { flex: 1; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; }
h1, h2 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.015em;
}
h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); }
h3 { font-size: 1.0625rem; font-weight: 600; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
    outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--brand-soft); color: var(--ink); }

.icon { width: 20px; height: 20px; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--tight { padding: clamp(32px, 5vw, 56px) 0; }
.section--sand { background: var(--sand); }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-bottom: clamp(24px, 4vw, 40px);
}
.section-head p { margin-top: 8px; max-width: 56ch; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.link-arrow .icon { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

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

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn,
.cta-button,
.btn-primary,
.submit-btn,
.checkout-submit,
.product-action-btn,
.cart-btn,
.confirmation-btn,
.error-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
/* Trailing icons (arrows) step forward on hover */
:is(.btn, .cta-button, .product-action-btn, .cart-btn, .confirmation-btn) > .icon:last-child:not(:first-child) {
    transition: transform 0.2s var(--ease);
}
:is(.btn, .cta-button, .product-action-btn, .cart-btn, .confirmation-btn):hover > .icon:last-child:not(:first-child) {
    transform: translateX(3px);
}

/* Primary */
.btn-primary,
.cta-button,
.submit-btn,
.checkout-submit,
.product-action-btn,
.cart-btn.primary,
.confirmation-btn.primary,
.error-button {
    background: var(--brand);
    color: #fff;
}
.btn-primary:hover,
.cta-button:hover,
.submit-btn:hover,
.checkout-submit:hover,
.product-action-btn:hover,
.cart-btn.primary:hover,
.confirmation-btn.primary:hover,
.error-button:hover {
    background: var(--brand-hover);
    color: #fff;
}

/* Secondary (outline) */
.btn-secondary,
.product-action-btn.secondary,
.cart-btn.secondary,
.confirmation-btn.secondary,
.error-button.secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}
.btn-secondary:hover,
.product-action-btn.secondary:hover,
.cart-btn.secondary:hover,
.confirmation-btn.secondary:hover,
.error-button.secondary:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

/* Quiet text action: underline, no box */
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); }

.btn-lg { min-height: 54px; padding: 0 28px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.btn[disabled], .btn:disabled,
.product-action-btn:disabled,
.checkout-submit:disabled,
.submit-btn:disabled {
    background: var(--sand-2);
    color: var(--ink-3);
    border-color: transparent;
    cursor: not-allowed;
    transform: none;
}

/* --------------------------------------------------------------------------
   5. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}
/* The frosted backdrop lives on a pseudo-element: backdrop-filter on the
   header itself would become the containing block for the fixed mobile menu */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
}
.site-header:has(.navbar.scrolled) {
    border-bottom-color: var(--line);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--header-h);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    color: var(--ink);
    text-decoration: none;
}
.logo:hover { color: var(--ink); }
.logo img { width: 36px; height: 36px; }
.logo span {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}
.nav-menu a {
    position: relative;
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    color: var(--ink-2);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}
.nav-menu a:hover { color: var(--ink); background: var(--sand); }
.nav-menu a.active,
.nav-menu a[aria-current="page"] { color: var(--ink); background: var(--sand); }
.nav-mobile-only { display: none; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface);
}
.lang-option {
    min-width: 38px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: var(--ink-3);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color 0.2s, color 0.2s;
}
.lang-option:hover { color: var(--ink); }
.lang-option.active,
.lang-option[aria-pressed="true"] { background: var(--ink); color: #fff; }

.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--ink);
    text-decoration: none;
    transition: background-color 0.2s;
}
.cart-icon:hover { background: var(--sand); color: var(--ink); }
.cart-icon .icon { width: 24px; height: 24px; }

.cart-badge {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--pill);
    background: var(--accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--bg);
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.3); }
}

.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.hamburger:hover { background: var(--sand); }
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.25s var(--ease), opacity 0.2s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 899px) {
    .nav-container { gap: 8px; }
    .hamburger { display: inline-flex; }
    .nav-mobile-only { display: block; }

    .nav-menu {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px var(--gutter) 32px;
        background: var(--bg);
        border-top: 1px solid var(--line);
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s linear 0.25s;
    }
    .nav-menu.active {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity 0.2s, transform 0.25s var(--ease);
    }
    .nav-menu li { border-bottom: 1px solid var(--line); }
    .nav-menu a {
        padding: 18px 4px;
        border-radius: 0;
        font-family: var(--font-display);
        font-size: 1.5rem;
        font-weight: 500;
        color: var(--ink);
    }
    .nav-menu a:hover,
    .nav-menu a.active,
    .nav-menu a[aria-current="page"] { background: transparent; color: var(--brand); }
}

@media (max-width: 380px) {
    .logo span { font-size: 1.2rem; }
    .lang-option { min-width: 32px; padding: 0 6px; }
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: auto;
    background: var(--ink);
    color: #C9D2CB;
    font-size: 0.9375rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 40px;
    padding-top: 64px;
    padding-bottom: 48px;
}
.footer-brand .logo { margin: 0 0 14px; color: #fff; }
.footer-brand .logo img { filter: invert(1); opacity: 0.92; }
.footer-brand p { max-width: 32ch; }
.site-footer h3 {
    margin-bottom: 14px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer a { color: #E4EAE5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
    padding-top: 22px;
    padding-bottom: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    color: #9AA59D;
}

@media (max-width: 899px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 48px; }
    .footer-brand { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   7. Home: hero
   -------------------------------------------------------------------------- */
.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(48px, 7vw, 88px); }
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: clamp(32px, 6vw, 80px);
}
.hero-copy h1 { margin: 14px 0 18px; font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.05; }
.hero-lead { font-size: 1.125rem; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 32px;
    list-style: none;
    font-size: 0.9375rem;
    color: var(--ink);
}
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { width: 18px; height: 18px; color: var(--brand); }

.hero-media { position: relative; }
.hero-media .hero-main {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 200px 200px var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.hero-media .hero-inset {
    position: absolute;
    left: -36px;
    bottom: 36px;
    width: 34%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 6px solid var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

@media (max-width: 899px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-media { max-width: 460px; margin: 0 auto; width: 100%; order: -1; }
    .hero-media .hero-main { aspect-ratio: 5 / 4; border-radius: var(--radius-lg); }
    .hero-media .hero-inset { display: none; }
    .hero-copy { text-align: left; }
}

/* --------------------------------------------------------------------------
   8. Product cards & grids
   -------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 2vw, 24px);
}
@media (min-width: 700px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s;
}
.product-card:hover {
    color: inherit;
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.product-card:focus-visible { outline-offset: 3px; }

.product-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--sand);
    overflow: hidden;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.product-card:hover .product-image img { transform: scale(1.04); }
.product-card.is-soldout .product-image > * { opacity: 0.55; }

/* Sewn-in garment label: square tag flush with the card edge, stitched inside */
.card-badge {
    position: absolute;
    top: 14px;
    left: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px 8px 13px;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    background: var(--brand);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
    outline: 1px dashed rgba(255, 255, 255, 0.45);
    outline-offset: -3px;
    box-shadow: 1px 1px 0 rgba(30, 43, 34, 0.12);
}
.card-badge .icon { display: none; }
.card-badge.is-soldout { background: var(--ink); }

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding: 14px 16px 16px;
}
.product-category {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-info h3 {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-info > p { display: none; } /* descriptions live on the detail page */
.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: auto;
    padding-top: 10px;
}
.product-price { color: var(--ink); font-size: 1rem; font-weight: 700; }
.product-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink-3);
}
.product-stock-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.product-stock-badge.in-stock { color: var(--brand); }
.product-stock-badge.low-stock { color: var(--accent); }

@media (max-width: 480px) {
    .product-info { padding: 12px; }
    .product-info h3 { font-size: 0.875rem; }
    .product-stock-badge { font-size: 0.6875rem; }
}

/* Branded stand-in for missing product photos */
.img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 60%),
        linear-gradient(135deg, var(--sand) 0%, var(--sand-2) 100%);
    color: var(--ink-3);
}
.img-fallback .icon { width: 44px; height: 44px; opacity: 0.45; stroke-width: 1.25; }

/* Loading skeletons */
.skeleton-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.skeleton-card .sk-media { aspect-ratio: 1; }
.skeleton-card .sk-line { height: 12px; margin: 14px 16px 0; border-radius: 6px; }
.skeleton-card .sk-line.short { width: 40%; margin-bottom: 18px; }
.sk-media, .sk-line {
    background: linear-gradient(90deg, var(--sand) 0%, #F8F4EE 50%, var(--sand) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.grid-message,
.product-grid .loading,
.product-grid .error-message,
.card-grid .loading,
.card-grid .error-message {
    grid-column: 1 / -1;
    padding: 56px 16px;
    text-align: center;
    color: var(--ink-3);
}
.product-grid .error-message,
.card-grid .error-message { color: var(--danger); }

.product-grid { transition: opacity 0.25s; }
.product-grid.fading { opacity: 0.35; }

/* --------------------------------------------------------------------------
   9. Home: collections, about, values
   -------------------------------------------------------------------------- */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 2vw, 24px);
}
@media (min-width: 900px) { .collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.collection-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.collection-card {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--sand-2);
    color: #fff;
    text-decoration: none;
    isolation: isolate;
}
.collection-card img,
.collection-card .img-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform 0.6s var(--ease);
}
.collection-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(20, 28, 22, 0) 40%, rgba(20, 28, 22, 0.72) 100%);
}
.collection-card:hover { color: #fff; }
.collection-card:hover img { transform: scale(1.05); }
.collection-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: clamp(14px, 2vw, 22px);
}
.collection-body h3 {
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    font-weight: 600;
}
.collection-body p {
    margin-top: 4px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.collection-body .link-arrow { margin-top: 10px; color: #fff; font-size: 0.875rem; }
@media (max-width: 600px) { .collection-body p { display: none; } }

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(32px, 6vw, 88px);
}
.split-media img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius-lg);
}
.split-copy h2 { margin: 12px 0 16px; }
.split-copy p + p { margin-top: 14px; }
.split-copy .btn { margin-top: 28px; }
@media (max-width: 899px) {
    .split { grid-template-columns: 1fr; }
    .split-media { max-width: 460px; }
    .split-media img { aspect-ratio: 4 / 3; }
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.value-item {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.value-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand);
}
.value-item h3 { margin-bottom: 6px; }
.value-item p { font-size: 0.9375rem; }
@media (max-width: 899px) { .values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
    .values-grid { gap: 10px; }
    .value-item { padding: 16px; }
    .value-icon { width: 38px; height: 38px; margin-bottom: 10px; }
    .value-item h3 { font-size: 0.9375rem; }
    .value-item p { font-size: 0.8125rem; line-height: 1.45; }
}

/* --------------------------------------------------------------------------
   10. Reviews carousel
   -------------------------------------------------------------------------- */
.reviews-carousel .section-head { justify-content: center; text-align: center; }
.carousel-container { overflow: hidden; margin: 0 -10px; }
.reviews-track { display: flex; }
.review-card { padding: 0 10px; }
.review-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}
.review-card .stars { color: var(--star); font-size: 1.05rem; letter-spacing: 2px; }
.review-text {
    flex: 1;
    margin: 14px 0 18px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.0625rem;
    line-height: 1.55;
}
.reviewer-name { font-size: 0.875rem; font-weight: 600; color: var(--ink-3); }

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
}
.carousel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    font-size: 0;
    transition: border-color 0.2s, background-color 0.2s;
}
.carousel-btn:hover { border-color: var(--ink); }
.carousel-btn::before {
    content: "";
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    margin-right: 3px;
}
.carousel-btn.prev::before { transform: rotate(-135deg); margin: 0 0 0 3px; }
.carousel-dots { display: flex; gap: 6px; }
.carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: var(--pill);
    background: var(--line-strong);
    transition: width 0.25s var(--ease), background-color 0.2s;
}
.carousel-dot.active { width: 22px; background: var(--brand); }

/* --------------------------------------------------------------------------
   11. Page headers & breadcrumbs
   -------------------------------------------------------------------------- */
.page-header {
    padding: clamp(32px, 5vw, 56px) 0 clamp(28px, 4vw, 44px);
    background: var(--sand);
    border-bottom: 1px solid var(--line);
}
.page-header h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.page-header p { margin-top: 10px; max-width: 60ch; font-size: 1.0625rem; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
    font-size: 0.875rem;
    color: var(--ink-3);
}
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb .icon { width: 14px; height: 14px; }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* --------------------------------------------------------------------------
   12. Shop toolbar, chips, toggles
   -------------------------------------------------------------------------- */
.shop-toolbar {
    display: flex;
    align-items: center;
    gap: 12px 16px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1 1 320px;
    max-width: 520px;
}
.search-input-wrapper > .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
    pointer-events: none;
}
.search-input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 46px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    background: var(--surface);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input-wrapper input::placeholder { color: var(--ink-3); }
.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-tint);
}
.search-input-wrapper input::-webkit-search-cancel-button { display: none; }
.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--sand);
    color: var(--ink-2);
    align-items: center;
    justify-content: center;
}
.clear-search-btn .icon { width: 16px; height: 16px; }
.clear-search-btn:hover { background: var(--sand-2); }

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-left: auto;
}

@media (max-width: 699px) {
    .search-input-wrapper { flex-basis: 100%; max-width: none; }
    .toolbar-controls { width: 100%; margin-left: 0; justify-content: space-between; }
}

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap select {
    height: 44px;
    padding: 0 40px 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    background: var(--surface);
    font-size: 0.9375rem;
    color: var(--ink);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.select-wrap .icon {
    position: absolute;
    right: 14px;
    width: 16px;
    height: 16px;
    color: var(--ink-3);
    pointer-events: none;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
    position: relative;
    width: 40px;
    height: 24px;
    border-radius: var(--pill);
    background: var(--line-strong);
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.toggle-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease);
}
.toggle input:checked + .toggle-track { background: var(--brand); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.chip-row {
    display: flex;
    gap: 8px;
    margin: 20px calc(var(--gutter) * -1) 0;
    padding: 2px var(--gutter) 6px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
}
.chip-row::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
    .chip-row { flex-wrap: wrap; overflow: visible; margin: 20px 0 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    background: var(--sand);
    color: var(--ink-2);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    scroll-snap-align: start;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover { background: var(--sand-2); color: var(--ink); }
.chip[aria-pressed="true"], .chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .icon { width: 15px; height: 15px; }

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 16px;
    min-height: 24px;
}
.search-results-count { font-size: 0.9375rem; color: var(--ink-3); }

.load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
}
.load-more[hidden] { display: none; }
.load-more-status { font-size: 0.875rem; color: var(--ink-3); }
.load-more .btn { min-width: 220px; }

.empty-state {
    padding: 56px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
}
.empty-state .empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--sand);
    color: var(--ink-3);
}
.empty-state p { margin-bottom: 20px; color: var(--ink); font-size: 1.0625rem; }

.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    flex-wrap: wrap;
    margin-top: clamp(48px, 7vw, 80px);
    padding: clamp(28px, 4vw, 44px);
    border-radius: var(--radius-lg);
    background: var(--ink);
    color: #DDE4DE;
}
.cta-banner h2 { color: #fff; font-size: clamp(1.4rem, 2.4vw, 1.85rem); margin-bottom: 6px; }
.cta-banner p { max-width: 52ch; }
.cta-banner .btn-primary { background: #fff; color: var(--ink); }
.cta-banner .btn-primary:hover { background: var(--brand-soft); color: var(--ink); }

/* --------------------------------------------------------------------------
   13. Product detail
   -------------------------------------------------------------------------- */
.pd { padding-top: clamp(20px, 3vw, 32px); padding-bottom: clamp(48px, 7vw, 88px); }
.pd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}
.pd-media { position: sticky; top: calc(var(--header-h) + 20px); }
.pd-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--sand);
}
.pd-image img { width: 100%; height: 100%; object-fit: cover; }
.pd-image .img-fallback .icon { width: 72px; height: 72px; }
.pd-image .card-badge { top: 20px; }

.pd-category {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand);
    text-decoration: none;
}
.product-detail-title { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.15; }
.pd-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 16px 0 20px;
}
.product-detail-price { color: var(--ink); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    font-weight: 600;
}
.stock-indicator::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock-indicator.in-stock { background: var(--brand-soft); color: var(--brand); }
.stock-indicator.out-of-stock { background: var(--sand); color: var(--ink-3); }
.product-detail-description { font-size: 1.0625rem; color: var(--ink-2); white-space: pre-line; }

.pd-buy { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.pd-buy-label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.product-actions { display: flex; gap: 12px; }
.product-actions .product-action-btn { flex: 1; min-height: 54px; font-size: 1rem; }
.pd-secondary-actions { display: grid; gap: 10px; margin-top: 12px; }

.quantity-selector {
    display: inline-flex;
    align-items: center;
    height: 54px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    background: var(--surface);
}
.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    border-radius: var(--radius-xs);
}
.qty-btn .icon { width: 18px; height: 18px; }
.qty-btn:hover:not(:disabled) { background: var(--sand); }
.qty-btn:disabled { color: var(--line-strong); cursor: not-allowed; }
.quantity-selector input {
    width: 40px;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 600;
    color: var(--ink);
    -moz-appearance: textfield;
}
.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.stock-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}
.stock-warning.is-warning { background: var(--warning-soft); color: var(--warning); }
.stock-warning.is-info { background: var(--info-soft); color: var(--info); }
.stock-warning .icon { width: 18px; height: 18px; }

.pd-details { margin-top: 28px; border-top: 1px solid var(--line); }
.pd-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}
.pd-details summary::-webkit-details-marker { display: none; }
.pd-details summary .icon { transition: transform 0.2s; }
.pd-details[open] summary .icon { transform: rotate(180deg); }
.product-specs { list-style: none; padding-bottom: 8px; }
.product-specs li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9375rem;
}
.product-specs li:last-child { border-bottom: 0; }
.spec-label { color: var(--ink-3); }
.spec-value { color: var(--ink); font-weight: 500; text-align: right; }
.pd-handmade-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--sand);
    font-size: 0.875rem;
    color: var(--ink-2);
}
.pd-handmade-note .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--brand); }


.error-container {
    max-width: 520px;
    margin: 64px auto;
    padding: 0 var(--gutter);
    text-align: center;
}
.error-container h2 { margin-bottom: 10px; }
.error-container p { margin-bottom: 24px; }

.loading-container { padding: 96px 0; }
.loading { text-align: center; color: var(--ink-3); }

@media (max-width: 899px) {
    .pd-grid { grid-template-columns: 1fr; }
    .pd-media { position: static; }
}

/* --------------------------------------------------------------------------
   14. Forms
   -------------------------------------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    background: var(--surface);
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626D66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-tint);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--ink-3); }

.checkout-form input.error,
.checkout-form textarea.error { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.checkout-form .error-message { display: none; font-size: 0.8125rem; color: var(--danger); }
.checkout-form input.error + .error-message,
.checkout-form textarea.error + .error-message { display: block; }

.card {
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.card > h2 { font-size: 1.5rem; margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   15. Contact
   -------------------------------------------------------------------------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 32px);
    align-items: start;
}
.contact-form-wrapper { box-shadow: var(--shadow-sm); }
.contact-form .submit-btn { width: 100%; margin-top: 6px; }
.contact-info { display: grid; gap: 14px; }
.contact-info > h2 { font-size: 1.5rem; margin-bottom: 4px; }
.info-card {
    display: flex;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.info-card .value-icon { width: 40px; height: 40px; margin: 0; flex-shrink: 0; }
.info-card h3 { margin-bottom: 4px; }
.info-card p { font-size: 0.9375rem; }
.social-links { display: grid; gap: 6px; margin-top: 8px; font-size: 0.9375rem; }
.social-badge { justify-self: start; color: var(--ink-2); text-decoration: none; }
.social-badge:hover { color: var(--brand); text-decoration: underline; }
.social-badge strong { color: var(--ink); }
@media (max-width: 899px) { .contact-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   16. FAQ
   -------------------------------------------------------------------------- */
.faq-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
}
.faq-layout > * { min-width: 0; }
.faq-nav { position: sticky; top: calc(var(--header-h) + 24px); }
.faq-nav p { margin-bottom: 10px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.faq-nav ul { list-style: none; display: grid; gap: 2px; }
.faq-nav a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-weight: 500;
    text-decoration: none;
}
.faq-nav a:hover { background: var(--sand); color: var(--ink); }

.faq-category + .faq-category { margin-top: 44px; }
.faq-category h2 { font-size: 1.5rem; margin-bottom: 12px; }
.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.2s;
}
.faq-item + .faq-item { margin-top: 10px; }
.faq-item[open] { border-color: var(--line-strong); }
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question .icon { color: var(--ink-3); transition: transform 0.2s var(--ease); }
.faq-item[open] .faq-question .icon { transform: rotate(180deg); }
.faq-answer { padding: 0 20px 20px; max-width: 70ch; }

.faq-contact { margin-top: 48px; }

@media (max-width: 899px) {
    .faq-layout { grid-template-columns: 1fr; }
    .faq-nav { position: static; }
    .faq-nav ul { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
    .faq-nav a { border: 1px solid var(--line-strong); border-radius: var(--radius-xs); white-space: nowrap; background: var(--surface); }
}

/* --------------------------------------------------------------------------
   17. Legal / long-form text
   -------------------------------------------------------------------------- */
.prose { max-width: 760px; }
.prose > div + div { margin-top: 40px; }
.prose h2 { font-size: 1.375rem; margin-bottom: 14px; }
.prose h3 { margin: 18px 0 6px; }
.prose p, .prose ul { margin-bottom: 12px; line-height: 1.75; }
.prose ul { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose strong { color: var(--ink); }

/* --------------------------------------------------------------------------
   18. Cart drawer
   -------------------------------------------------------------------------- */
.cart-modal { position: fixed; inset: 0; z-index: 1500; }
.cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 28, 22, 0.45);
    animation: fade-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.cart-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(440px, 100%);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
}
.cart-sidebar.open { transform: none; }
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 18px 24px;
    border-bottom: 1px solid var(--line);
}
.cart-header h2 { font-size: 1.5rem; }
.cart-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 1.6rem;
    line-height: 1;
}
.cart-close:hover { background: var(--sand); }
.cart-content { flex: 1; overflow-y: auto; padding: 8px 24px; }

.cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-image {
    position: relative;
    display: block;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--sand);
}
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-image .img-fallback .icon { width: 28px; height: 28px; }
.cart-item-stock-badge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px;
    background: rgba(30, 43, 34, 0.8);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    text-align: center;
}
.cart-item.out-of-stock .cart-item-image img { opacity: 0.5; }
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.cart-item-name a { color: var(--ink); text-decoration: none; }
.cart-item-name a:hover { text-decoration: underline; }
.cart-item-price { margin-top: 2px; font-size: 0.875rem; color: var(--ink-3); }
.cart-item-warning { margin-top: 4px; font-size: 0.8125rem; color: var(--warning) !important; }
.cart-item-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.cart-item-quantity {
    display: inline-flex;
    align-items: center;
    height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    background: var(--surface);
}
.cart-item-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 100%;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--ink);
    font-size: 1rem;
}
.cart-item-qty-btn:hover:not(:disabled) { background: var(--sand); }
.cart-item-qty-btn:disabled { color: var(--line-strong); cursor: not-allowed; }
.cart-item-qty-value { min-width: 26px; text-align: center; font-weight: 600; font-size: 0.875rem; color: var(--ink); }
.cart-item-remove {
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cart-item-remove:hover { color: var(--danger); }
.cart-item-total { margin-top: 8px; font-size: 0.875rem; color: var(--ink); font-weight: 600; }

.cart-empty { padding: 56px 12px; text-align: center; }
.cart-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--sand);
    color: var(--ink-3);
}
.cart-empty-icon .icon { width: 30px; height: 30px; }
.cart-empty p { margin-bottom: 20px; color: var(--ink); font-size: 1.0625rem; }

.cart-footer { padding: 18px 24px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    color: var(--ink);
    font-weight: 600;
}
#cart-subtotal-amount { font-size: 1.25rem; font-weight: 700; }
.cart-actions { display: flex; flex-direction: column-reverse; gap: 10px; }
.cart-actions .cart-btn { width: 100%; }

/* --------------------------------------------------------------------------
   19. Checkout & confirmation
   -------------------------------------------------------------------------- */
.checkout-container,
.confirmation-container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: clamp(28px, 4vw, 48px) var(--gutter) clamp(56px, 8vw, 96px);
}
.checkout-container > h1 { font-size: clamp(2rem, 3.6vw, 2.5rem); margin-bottom: 24px; }
.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 32px);
    align-items: start;
}
.checkout-grid > .loading,
.checkout-grid > .loading-container { grid-column: 1 / -1; }
.checkout-section {
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.checkout-section h2 { font-size: 1.375rem; margin-bottom: 18px; }
.checkout-section h3 { margin: 26px 0 14px; }
.checkout-order-summary { position: sticky; top: calc(var(--header-h) + 20px); background: var(--surface); }
.checkout-submit { width: 100%; min-height: 54px; margin-top: 8px; font-size: 1rem; }

.checkout-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}
.checkout-item:hover { color: inherit; }
.checkout-item:hover .checkout-item-name { text-decoration: underline; }
.checkout-item-image { width: 64px; height: 64px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--sand); }
.checkout-item-image img { width: 100%; height: 100%; object-fit: cover; }
.checkout-item-image .img-fallback .icon { width: 24px; height: 24px; }
.checkout-item-details { flex: 1; min-width: 0; }
.checkout-item-name { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.checkout-item-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.875rem; }
.checkout-item-price { color: var(--ink); font-weight: 600; }
.checkout-breakdown { display: grid; gap: 8px; padding-top: 16px; font-size: 0.9375rem; }
.checkout-breakdown div { display: flex; justify-content: space-between; gap: 12px; }
.checkout-breakdown dd { color: var(--ink); font-weight: 600; }
.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-weight: 600;
}

.form-check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 6px; font-size: 0.9375rem; }
.form-check input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; accent-color: var(--brand); }
.form-check input.error { outline: 2px solid var(--danger); outline-offset: 2px; }
.checkout-form #accept-terms-error { margin-bottom: 14px; }
.checkout-form #accept-terms-error.visible { display: block; }
.checkout-submit { margin-top: 12px; }
.checkout-total-amount { font-size: 1.5rem; font-weight: 700; }
.checkout-note { margin-top: 10px; font-size: 0.8125rem; color: var(--ink-3); }
.order-process {
    margin-top: 22px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--brand-tint);
}
.order-process h3 { margin: 0 0 10px; font-size: 0.9375rem; }
.order-process ol { padding-left: 18px; font-size: 0.875rem; display: grid; gap: 6px; }

@media (max-width: 899px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .checkout-order-summary { position: static; order: -1; }
}

.confirmation-container { max-width: 720px; text-align: center; }
.confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 2rem;
    font-weight: 700;
}
.confirmation-icon .icon { width: 34px; height: 34px; stroke-width: 2.25; }
.confirmation-container > h1 { margin-bottom: 12px; }
.confirmation-container > p { max-width: 54ch; margin: 0 auto 6px; }
.confirmation-box {
    margin: 32px 0;
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: left;
}
.confirmation-box:empty { display: none; }
.confirmation-box h3 { font-family: var(--font-display); font-size: 1.375rem; margin-bottom: 18px; }
.summary-block { margin-bottom: 20px; }
.summary-block h4 { margin-bottom: 6px; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.summary-block p { margin: 2px 0; }
.summary-line { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-line strong { color: var(--ink); }
.summary-total { display: flex; justify-content: space-between; padding-top: 16px; color: var(--ink); font-size: 1.2rem; font-weight: 700; }
.summary-date { margin-top: 14px; font-size: 0.875rem; color: var(--ink-3); text-align: center; }
.confirmation-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.notice {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
}
.notice .icon { margin-top: 2px; }
.notice strong { display: block; color: inherit; }
.notice ul { margin-top: 6px; padding-left: 18px; }
.notice-warning { background: var(--warning-soft); color: var(--warning); }

/* --------------------------------------------------------------------------
   20. 404
   -------------------------------------------------------------------------- */
.error-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 64px var(--gutter);
    text-align: center;
}
.error-content { max-width: 520px; }
.error-number {
    font-family: var(--font-display);
    font-size: clamp(5rem, 16vw, 8rem);
    font-weight: 600;
    line-height: 1;
    color: var(--brand-soft);
    -webkit-text-stroke: 2px var(--brand);
}
.error-title { margin: 16px 0 12px; font-size: clamp(1.75rem, 3.6vw, 2.25rem); }
.error-content > .error-message { margin-bottom: 28px; color: var(--ink-2); padding: 0; }
.error-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------------------------
   21. Toasts & error toast
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 380px;
    padding: 12px 16px 12px 12px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-size: 0.9375rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.3s var(--ease);
    pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
}
.toast-success .toast-icon { background: #3E8E4E; }
.toast-error .toast-icon { background: var(--danger); }
.toast-warning .toast-icon { background: #C77C0E; }
.toast-info .toast-icon { background: var(--info); }

@media (max-width: 600px) {
    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: none; }
}

.error-toast {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 3000;
    max-width: 420px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--danger-soft);
    box-shadow: var(--shadow-lg);
}
.error-toast-content { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.error-toast .error-icon { font-size: 1.25rem; }
.error-toast .error-message { flex: 1; text-align: left; padding: 0; color: var(--ink-2); }
.error-toast .error-message strong { display: block; color: var(--ink); margin-bottom: 2px; }
.error-toast .error-message p { font-size: 0.875rem; }
.error-toast-close { border: 0; background: transparent; font-size: 1.25rem; color: var(--ink-3); line-height: 1; }

.error-message-box { padding: 48px 16px; text-align: center; }
.error-message-box p { margin: 10px 0 18px; }
.loading-spinner { padding: 48px 16px; text-align: center; color: var(--ink-3); }
.spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    border: 3px solid var(--sand-2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   22. Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
