/* =====================================================================
   KuashaaMart - design system
   ---------------------------------------------------------------------
   Light is defined on :root. Dark is defined twice on purpose: once under
   prefers-color-scheme for visitors who never touch the toggle (the
   default the brief asks for - follow the PC theme), and once under
   [data-theme="dark"] so an explicit choice wins in both directions.
   ===================================================================== */

:root {
    color-scheme: light;

    --bg: #fbfaf8;
    --bg-subtle: #f4f2ee;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --border: #e7e3db;
    --border-strong: #d4cfc4;

    --text: #1a1a17;
    --text-muted: #6d6b63;
    --text-faint: #939086;

    --accent: #0f766e;
    --accent-hover: #115e59;
    --accent-soft: #e6f4f1;
    --accent-contrast: #ffffff;

    --sale: #b91c1c;
    --sale-soft: #fdeaea;
    --success: #15803d;
    --success-soft: #e8f5ec;
    --warning: #b45309;
    --warning-soft: #fdf3e3;
    --danger: #b91c1c;

    --shadow-sm: 0 1px 2px rgba(24, 24, 20, .06);
    --shadow: 0 4px 16px -4px rgba(24, 24, 20, .10), 0 2px 6px -2px rgba(24, 24, 20, .06);
    --shadow-lg: 0 18px 44px -12px rgba(24, 24, 20, .20);

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

    --header-h: 68px;
    --maxw: 1280px;

    --font-en: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-bn: "Hind Siliguri", "Noto Sans Bengali", var(--font-en);
}

/* Visitors on system default: follow the operating system. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --bg: #101312;
        --bg-subtle: #171b1a;
        --surface: #171b1a;
        --surface-raised: #1e2322;
        --border: #2a302e;
        --border-strong: #3a423f;

        --text: #ecebe7;
        --text-muted: #9c9f9a;
        --text-faint: #6f736e;

        --accent: #2dd4bf;
        --accent-hover: #5eead4;
        --accent-soft: #12302c;
        --accent-contrast: #06211e;

        --sale: #f87171;
        --sale-soft: #33191a;
        --success: #4ade80;
        --success-soft: #122b1c;
        --warning: #fbbf24;
        --warning-soft: #2e2412;
        --danger: #f87171;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 4px 16px -4px rgba(0, 0, 0, .5), 0 2px 6px -2px rgba(0, 0, 0, .4);
        --shadow-lg: 0 18px 44px -12px rgba(0, 0, 0, .6);
    }
}

/* Explicit choice from the toggle wins over the system setting. */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #101312;
    --bg-subtle: #171b1a;
    --surface: #171b1a;
    --surface-raised: #1e2322;
    --border: #2a302e;
    --border-strong: #3a423f;

    --text: #ecebe7;
    --text-muted: #9c9f9a;
    --text-faint: #6f736e;

    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: #12302c;
    --accent-contrast: #06211e;

    --sale: #f87171;
    --sale-soft: #33191a;
    --success: #4ade80;
    --success-soft: #122b1c;
    --warning: #fbbf24;
    --warning-soft: #2e2412;
    --danger: #f87171;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px -4px rgba(0, 0, 0, .5), 0 2px 6px -2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 18px 44px -12px rgba(0, 0, 0, .6);
}

/* --------------------------------------------------------------- reset */

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

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-en);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Bangla needs a font with proper conjunct rendering and a little more height. */
html[lang="bn"] body { font-family: var(--font-bn); line-height: 1.75; }

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

/* The rule above sets display on every svg, which would otherwise beat the
   browser's own [hidden] rule and leave hidden icons on screen. This restores
   the attribute's meaning for every element. */
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: .5rem;
    z-index: 200;
    background: var(--accent);
    color: var(--accent-contrast);
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
}
.skip-link:focus { left: .5rem; }

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

/* -------------------------------------------------------------- layout */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
main { flex: 1 0 auto; }
.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section--tight { padding-block: clamp(1.5rem, 3vw, 2.5rem); }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head p { margin: .15rem 0 0; color: var(--text-muted); font-size: .92rem; }

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(150%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-bar {
    display: flex;
    align-items: center;
    gap: clamp(.5rem, 2vw, 1.25rem);
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 750;
    font-size: 1.2rem;
    letter-spacing: -.02em;
    color: var(--text);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 800;
    font-size: .95rem;
    flex: none;
}

.header-nav { display: flex; align-items: center; gap: .25rem; margin-inline-start: .5rem; }
.header-nav a {
    color: var(--text-muted);
    padding: .5rem .7rem;
    border-radius: var(--radius-sm);
    font-weight: 550;
    font-size: .92rem;
}
.header-nav a:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }
.header-nav a[aria-current="page"] { color: var(--text); }

.header-search { flex: 1 1 auto; max-width: 460px; margin-inline: auto; position: relative; }
/* Attribute selector so this outranks the generic input rule defined later,
   which would otherwise flatten the left padding onto the search icon. */
.header-search input[type="search"] {
    width: 100%;
    padding: .6rem .9rem .6rem 2.4rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    font: inherit;
    font-size: .9rem;
}
.header-search input[type="search"]:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.header-search svg {
    position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-faint); pointer-events: none;
}

.header-actions { display: flex; align-items: center; gap: .3rem; margin-inline-start: auto; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
    border: 1px solid transparent;
    background: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    font: inherit;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.icon-btn svg { width: 19px; height: 19px; }

.cart-badge {
    position: absolute;
    top: 3px; right: 3px;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    display: grid; place-items: center;
    background: var(--accent);
    color: var(--accent-contrast);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
}
.cart-badge[hidden] { display: none !important; }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-switch a {
    padding: .3rem .6rem;
    font-size: .78rem;
    font-weight: 650;
    color: var(--text-muted);
    line-height: 1.5;
}
.lang-switch a:hover { background: var(--bg-subtle); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--accent-contrast); }

/* Category strip below the header bar */
.cat-strip { border-top: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip ul {
    display: flex; gap: .25rem; list-style: none;
    margin: 0; padding: .4rem 0; white-space: nowrap;
}
.cat-strip a {
    display: inline-block;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .87rem;
    font-weight: 550;
    color: var(--text-muted);
}
.cat-strip a:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }

.mobile-toggle { display: none; }

@media (max-width: 900px) {
    .header-nav { display: none; }
    .header-search { order: 10; flex-basis: 100%; max-width: none; margin: 0 0 .7rem; }
    .header-bar { flex-wrap: wrap; padding-top: .6rem; }
    .mobile-toggle { display: inline-grid; }
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .62rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, transform .08s;
    text-align: center;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-ghost { color: var(--text-muted); background: none; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-subtle); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }

.btn-block { width: 100%; }
.btn-sm { padding: .4rem .75rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1rem; }

.btn svg { width: 17px; height: 17px; flex: none; }

/* ---------------------------------------------------------------- cards */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(1rem, 2.5vw, 1.5rem); }

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

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: clamp(.9rem, 2vw, 1.4rem);
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    position: relative;
}
.product-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }

.product-card__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--bg-subtle);
    overflow: hidden;
}
.product-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.product-card:hover .product-card__media img { transform: scale(1.04); }

.badge {
    position: absolute;
    top: .6rem; left: .6rem;
    padding: .2rem .5rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .01em;
    z-index: 2;
}
.badge--sale { background: var(--sale); color: #fff; }
.badge--out {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    color: var(--text);
    font-size: .85rem;
    font-weight: 650;
    border-radius: 0;
    top: 0; left: 0;
    padding: 0;
}

.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: .8rem .85rem 0;
    gap: .3rem;
}
.product-card__cat { font-size: .72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.product-card__title {
    font-size: .93rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}
.product-card__title a { color: inherit; }
.product-card__title a:hover { color: var(--accent); text-decoration: none; }

.price-row { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; margin-top: auto; padding-top: .35rem; }
.price { font-size: 1.02rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.price--old { font-size: .82rem; color: var(--text-faint); text-decoration: line-through; font-weight: 500; }
.stock-note { font-size: .74rem; color: var(--warning); font-weight: 600; }

/* --------------------------------- add-to-cart control on the card */

.add-box { padding: .7rem .85rem .85rem; display: grid; gap: .5rem; }

.qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
    flex: none;
}
.qty button {
    width: 32px; height: 34px;
    border: 0; background: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    display: grid; place-items: center;
    font-family: inherit;
}
.qty button:hover:not(:disabled) { background: var(--bg-subtle); color: var(--text); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty input {
    width: 38px;
    height: 34px;
    border: 0;
    border-inline: 1px solid var(--border);
    background: none;
    color: var(--text);
    text-align: center;
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
    -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* The stepper sits above a full-width button rather than beside it.
   Side by side needs ~285px of card: the stepper is 114px and the Bangla label
   "কার্টে যোগ করুন" needs 137px. Cards in this grid top out around 230px, so a
   row layout would only ever squeeze the label onto three lines. */
.add-row {
    display: grid;
    gap: .4rem;
}

.add-row .qty {
    width: 100%;
    height: 38px;
    background: var(--bg-subtle);
    border-color: var(--border);
}
.add-row .qty button { width: 36px; height: 36px; font-size: 1.1rem; }
.add-row .qty input { flex: 1; width: auto; height: 36px; background: transparent; }

.add-row .btn {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding-inline: .6rem;
    font-size: .93rem;
    letter-spacing: -.005em;
    /* The label reads as one unit; shrink nothing, wrap nothing. */
    white-space: nowrap;
}

.add-row .btn-primary {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .10);
}
.add-row .btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 65%, transparent);
}

/* Variant chooser expands inside the card, so choosing a size never
   costs a page load. */
.variant-picker {
    display: none;
    gap: .35rem;
    flex-wrap: wrap;
    padding-bottom: .1rem;
}
.variant-picker.is-open { display: flex; }
.variant-picker__label { width: 100%; font-size: .74rem; color: var(--text-muted); font-weight: 600; }
.variant-chip {
    padding: .28rem .6rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}
.variant-chip:hover:not(:disabled) { border-color: var(--accent); }
.variant-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.variant-chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

/* --------------------------------------------------------------- hero */

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1100px 460px at 78% -12%, var(--accent-soft), transparent 62%),
        linear-gradient(180deg, var(--bg-subtle), var(--bg));
    border-bottom: 1px solid var(--border);
}
.hero-inner {
    display: grid;
    gap: 2rem;
    align-items: center;
    padding-block: clamp(3rem, 7vw, 5.5rem);
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: .75rem; max-width: 18ch; }
.hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 52ch; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; }

.hero-collage { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.hero-collage > * { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.hero-collage > *:first-child { grid-row: span 2; aspect-ratio: 3 / 4.15; }
.hero-collage > *:not(:first-child) { aspect-ratio: 4 / 3; }
.hero-collage img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .hero-collage { display: none; } }

/* --------------------------------------------------------- categories */

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: clamp(.8rem, 2vw, 1.2rem);
}
.cat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    overflow: hidden;
    transition: border-color .18s, transform .18s, box-shadow .18s;
    min-height: 128px;
    justify-content: flex-end;
}
.cat-tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-tile__icon { font-size: 1.6rem; line-height: 1; margin-bottom: auto; }
.cat-tile__name { font-weight: 650; font-size: .98rem; }
.cat-tile__count { font-size: .78rem; color: var(--text-muted); }
.cat-tile__bg { position: absolute; inset: 0; z-index: 0; opacity: .16; }
.cat-tile__bg img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile > *:not(.cat-tile__bg) { position: relative; z-index: 1; }

/* ------------------------------------------------------------ benefits */

.benefit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.benefit {
    display: flex; gap: .85rem; align-items: flex-start;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.benefit svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: .15rem; }
.benefit h3 { font-size: .95rem; margin: 0 0 .15rem; }
.benefit p { margin: 0; font-size: .86rem; color: var(--text-muted); }

/* -------------------------------------------------------------- forms */

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field > label { font-size: .87rem; font-weight: 600; color: var(--text); }
.field .hint { font-size: .78rem; color: var(--text-muted); }
.field .req { color: var(--danger); }
.field .opt { color: var(--text-faint); font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="search"], input[type="url"], select, textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .92rem;
}
textarea { resize: vertical; min-height: 92px; }
select { cursor: pointer; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
    border-color: var(--danger);
}

.field-error { color: var(--danger); font-size: .8rem; font-weight: 550; }

.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: .15rem 0 0; accent-color: var(--accent); flex: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .span-2 { grid-column: 1 / -1; }

/* ------------------------------------------------------------- alerts */

.alert {
    display: flex; gap: .6rem; align-items: flex-start;
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: .89rem;
    margin-bottom: 1.25rem;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.alert--error { background: var(--sale-soft); border-color: var(--sale); color: var(--sale); }
.alert--success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.alert--warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.alert--info { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------- toasts */

.toast-stack {
    position: fixed;
    z-index: 200;
    bottom: 1.25rem; right: 1.25rem;
    display: flex; flex-direction: column; gap: .5rem;
    pointer-events: none;
    max-width: min(340px, calc(100vw - 2rem));
}
@media (max-width: 560px) { .toast-stack { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; } }

.toast {
    display: flex; align-items: center; gap: .6rem;
    padding: .7rem .95rem;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: .88rem;
    font-weight: 550;
    pointer-events: auto;
    animation: toast-in .22s ease-out;
}
.toast--error { border-left-color: var(--danger); }
.toast svg { width: 17px; height: 17px; flex: none; color: var(--accent); }
.toast--error svg { color: var(--danger); }
.toast.is-leaving { animation: toast-out .18s ease-in forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ------------------------------------------------------- breadcrumbs */

.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .83rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-hidden] { color: var(--text-faint); }

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

.product-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 900px) { .product-layout { grid-template-columns: 1fr; } }

.gallery { display: grid; gap: .7rem; position: sticky; top: calc(var(--header-h) + 1rem); }
@media (max-width: 900px) { .gallery { position: static; } }
.gallery__main {
    aspect-ratio: 1 / 1;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.gallery__thumbs button {
    width: 66px; height: 66px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-subtle);
    cursor: pointer;
}
.gallery__thumbs button[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info h1 { margin-bottom: .4rem; }
.product-price { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin: 1rem 0; }
.product-price .price { font-size: 1.9rem; }
.product-meta { display: grid; gap: .3rem; font-size: .87rem; color: var(--text-muted); margin: 1.25rem 0; }
.product-meta strong { color: var(--text); font-weight: 600; }

.buy-panel {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.15rem;
    display: grid;
    gap: .9rem;
    margin: 1.5rem 0;
}
.buy-panel__row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.buy-panel__row .btn { flex: 1; min-width: 160px; }
.buy-panel .qty { height: 42px; }
.buy-panel .qty button, .buy-panel .qty input { height: 40px; }
.buy-panel .qty input { width: 46px; }

.prose { line-height: 1.75; color: var(--text); }
.prose :where(h2, h3) { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-inline-start: 1.3rem; }

/* ------------------------------------------------ rich product content */

/* Capped at a comfortable reading measure, but banners and images below are
   allowed to break out to the full width. */
.product-content {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    padding-top: clamp(1.5rem, 3vw, 2.5rem);
    border-top: 1px solid var(--border);
    max-width: 860px;
}
.product-content > h2 {
    margin-top: 2rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.product-content > h2:first-child { margin-top: 0; }

.content-heading {
    margin-top: 1.75rem;
    margin-bottom: .5rem;
    font-size: 1.05rem;
    font-weight: 650;
}

.content-figure { margin: 1.5rem 0; }
.content-figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
}
.content-figure figcaption {
    margin-top: .5rem;
    font-size: .84rem;
    color: var(--text-muted);
    text-align: center;
}

.content-banner {
    position: relative;
    margin: 1.75rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
}
.content-banner img { width: 100%; height: auto; }
.content-banner a { display: block; }
.content-banner__caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 1.5rem 1.15rem .95rem;
    display: grid;
    gap: .15rem;
    color: #fff;
    /* Scrim rather than a flat overlay, so the image stays visible behind it. */
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
}
.content-banner__caption strong { font-size: 1.05rem; font-weight: 650; }
.content-banner__caption span { font-size: .87rem; opacity: .9; }

.spec-table { min-width: 0; }
.spec-table th[scope="row"] {
    width: 38%;
    text-transform: none;
    letter-spacing: 0;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    vertical-align: top;
    background: var(--bg-subtle);
}
.spec-table td { color: var(--text); }
@media (max-width: 520px) {
    .spec-table th[scope="row"] { width: 45%; }
}

.cod-note {
    display: flex; gap: .6rem; align-items: flex-start;
    font-size: .85rem; color: var(--text-muted);
    padding: .7rem .85rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
}
.cod-note svg { width: 17px; height: 17px; color: var(--accent); flex: none; margin-top: .1rem; }

/* ---------------------------------------------------------- shop page */

.shop-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.25rem); align-items: start; }
@media (max-width: 900px) { .shop-layout { grid-template-columns: 1fr; } }

.filters { position: sticky; top: calc(var(--header-h) + 1rem); display: grid; gap: 1.25rem; }
.filters-toggle { display: none; }

/* The panel ships collapsed so small screens start closed even before
   JavaScript runs; from the desktop breakpoint up it is always open.
   A dedicated attribute rather than [hidden], which is globally !important. */
.filters[data-collapsed="true"] { display: none; }

@media (min-width: 901px) {
    .filters[data-collapsed="true"] { display: grid; }
}

@media (max-width: 900px) {
    .filters { position: static; }
    .filters-toggle { display: inline-flex; }
}
.filter-group h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .6rem; }
.filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.filter-list a {
    display: flex; justify-content: space-between; gap: .5rem;
    padding: .35rem .55rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: .88rem;
}
.filter-list a:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.filter-list a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.filter-list .count { color: var(--text-faint); font-size: .8rem; }
.filter-list ul { list-style: none; margin: .1rem 0 .1rem .7rem; padding: 0; display: grid; gap: .1rem; border-left: 1px solid var(--border); padding-left: .4rem; }

.shop-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.35rem;
}
.shop-toolbar .count { color: var(--text-muted); font-size: .89rem; }
.shop-toolbar form { display: flex; gap: .5rem; align-items: center; }
.shop-toolbar select { width: auto; padding-block: .45rem; font-size: .87rem; }

.pagination { display: flex; gap: .35rem; justify-content: center; align-items: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 38px; height: 38px;
    display: grid; place-items: center;
    padding-inline: .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: .88rem;
    font-weight: 600;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination [aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.pagination .is-disabled { opacity: .4; pointer-events: none; }

/* --------------------------------------------------------------- cart */

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(1.25rem, 3vw, 2.25rem); align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-line {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.cart-line:first-child { padding-top: 0; }
.cart-line.is-problem { background: var(--sale-soft); border-radius: var(--radius-sm); padding-inline: .75rem; }
.cart-line__img { width: 88px; height: 88px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-subtle); border: 1px solid var(--border); }
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__name { font-weight: 600; font-size: .95rem; margin: 0 0 .15rem; }
.cart-line__name a { color: var(--text); }
.cart-line__variant { font-size: .82rem; color: var(--text-muted); }
.cart-line__unit { font-size: .84rem; color: var(--text-muted); margin-top: .2rem; }
.cart-line__right { display: grid; gap: .5rem; justify-items: end; }
.cart-line__total { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.cart-line__remove { font-size: .8rem; color: var(--text-muted); background: none; border: 0; cursor: pointer; padding: .2rem; font-family: inherit; }
.cart-line__remove:hover { color: var(--danger); text-decoration: underline; }
.cart-line__warn { font-size: .8rem; color: var(--danger); font-weight: 600; }

@media (max-width: 560px) {
    .cart-line { grid-template-columns: 68px minmax(0, 1fr); gap: .75rem; }
    .cart-line__img { width: 68px; height: 68px; }
    .cart-line__right { grid-column: 2; justify-items: start; }
}

.summary { position: sticky; top: calc(var(--header-h) + 1rem); }
@media (max-width: 900px) { .summary { position: static; } }
.summary__row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; font-size: .92rem; color: var(--text-muted); }
.summary__row strong { color: var(--text); }
.summary__total { border-top: 1px solid var(--border); margin-top: .6rem; padding-top: .8rem; font-size: 1.12rem; font-weight: 700; color: var(--text); }

.empty-state { text-align: center; padding: clamp(2.5rem, 8vw, 5rem) 1rem; }
.empty-state svg { width: 56px; height: 56px; color: var(--text-faint); margin: 0 auto 1rem; }
.empty-state h2 { margin-bottom: .4rem; }
.empty-state p { color: var(--text-muted); max-width: 40ch; margin-inline: auto; }

/* ----------------------------------------------------------- checkout */

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }

.pay-option {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: 1rem;
    border: 1.5px solid var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}
.pay-option svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.pay-option strong { display: block; color: var(--text); }
.pay-option p { margin: .2rem 0 0; font-size: .85rem; color: var(--text-muted); }

.mini-line { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; font-size: .87rem; }
.mini-line__img { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; background: var(--bg-subtle); flex: none; border: 1px solid var(--border); }
.mini-line__img img { width: 100%; height: 100%; object-fit: cover; }
.mini-line__name { flex: 1; min-width: 0; }
.mini-line__name span { display: block; color: var(--text-muted); font-size: .8rem; }

/* -------------------------------------------------------------- order */

.status-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .22rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 650;
    border: 1px solid;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-0 { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.status-1, .status-2 { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.status-3 { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.status-4 { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.status-5, .status-6 { color: var(--danger); background: var(--sale-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

.order-hero { text-align: center; padding-block: clamp(2rem, 5vw, 3.5rem); }
.order-hero__icon {
    width: 64px; height: 64px;
    margin: 0 auto 1.25rem;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
}
.order-hero__icon svg { width: 30px; height: 30px; }
.order-number {
    display: inline-block;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .5rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text);
}

/* -------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 620px; }
table.data th, table.data td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { font-weight: 650; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-subtle); white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--bg-subtle); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- admin */

.admin-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
@media (max-width: 860px) { .admin-shell { grid-template-columns: 1fr; } }

.admin-side {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.1rem;
    display: flex; flex-direction: column; gap: 1.25rem;
}
@media (max-width: 860px) { .admin-side { border-right: 0; border-bottom: 1px solid var(--border); } }
.admin-side nav { display: grid; gap: .12rem; }
.admin-side nav a {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 550;
}
.admin-side nav a:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.admin-side nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.admin-side svg { width: 17px; height: 17px; flex: none; }

.admin-main { padding: clamp(1.1rem, 3vw, 2rem); min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-head h1 { font-size: 1.55rem; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat {
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.stat__label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat__value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin-top: .2rem; }
.stat--alert .stat__value { color: var(--danger); }

.admin-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--bg-subtle); border: 1px solid var(--border); }

.repeater-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: .5rem;
    align-items: center;
    margin-bottom: .5rem;
}

/* Variant rows carry two option values as well as price and stock. */
.repeater-row--variant { grid-template-columns: repeat(6, minmax(0, 1fr)) auto; }

@media (max-width: 1100px) { .repeater-row--variant { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; } }
@media (max-width: 760px) {
    .repeater-row { grid-template-columns: 1fr 1fr; }
    .repeater-row--variant { grid-template-columns: 1fr 1fr; }
}

.combo-builder {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: .85rem;
    margin-bottom: 1rem;
    background: var(--bg-subtle);
}
.combo-builder p { margin-bottom: .5rem; }

/* Product page: one labelled chip group per option. */
.option-group .variant-picker__label {
    display: block;
    margin-bottom: .4rem;
}
.repeater-row input { margin: 0; }

/* One content block in the admin editor. Bordered so a long description made
   of many blocks stays readable as a stack of discrete units. */
.block-editor {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .85rem;
    margin-bottom: .75rem;
    background: var(--bg-subtle);
}
.block-editor__head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}
.block-editor__head select { width: auto; min-width: 150px; padding-block: .35rem; }
.block-editor__handle { color: var(--text-faint); cursor: default; }
.block-editor .field { margin-bottom: .75rem; }
.block-editor textarea { min-height: 76px; }

.image-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.image-tile { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-subtle); }
.image-tile img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.image-tile__bar { display: flex; gap: .25rem; padding: .35rem; justify-content: space-between; align-items: center; background: var(--surface); }
.image-tile__bar button { font-size: .74rem; padding: .2rem .4rem; }
.image-tile.is-primary { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

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

.site-footer {
    margin-top: clamp(3rem, 6vw, 5rem);
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    padding-block: clamp(2rem, 4vw, 3rem) 1.5rem;
    font-size: .89rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { color: var(--text-muted); }
.footer-bottom {
    margin-top: 2rem; padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    color: var(--text-faint); font-size: .83rem;
}
.cod-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 650;
    font-size: .78rem;
}

/* -------------------------------------------------------------- utils */

.stack { display: grid; gap: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-end { margin-inline-start: auto; }
.muted { color: var(--text-muted); }
.small { font-size: .84rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.is-busy { opacity: .6; pointer-events: none; }

@media print {
    .site-header, .site-footer, .toast-stack, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
}
