/* ==========================================================================
   NBT - wholesale shirts & t-shirts
   Design system. One stylesheet, no framework.
   Tokens first, then primitives, then components, then pages.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    /* Neutrals - slightly warm, so product photos sit on a friendly ground */
    --ink:        #0d0f13;
    --ink-2:      #23272f;
    --ink-3:      #5a626f;
    --ink-4:      #8b94a3;

    --line:       #e7e9ee;
    --line-2:     #f1f3f6;

    --paper:      #ffffff;
    --wash:       #f7f8fa;
    --wash-2:     #eff1f5;

    --brand:      #0d0f13;
    --brand-ink:  #ffffff;

    --accent:     #b3122f;
    --accent-ink: #ffffff;
    --accent-wash:#fdeef0;

    --ok:         #0b7a4b;
    --ok-wash:    #e7f5ee;
    --warn:       #96590a;
    --warn-wash:  #fdf4e4;
    --info:       #1d4ed8;
    --info-wash:  #eef2ff;

    /* Type scale - 1.2 ratio, tuned down slightly for dense catalogue UI */
    --t-xs:   .72rem;
    --t-sm:   .82rem;
    --t-base: .92rem;
    --t-md:   1rem;
    --t-lg:   1.15rem;
    --t-xl:   1.45rem;
    --t-2xl:  1.9rem;
    --t-3xl:  2.6rem;

    /* Spacing - 4px base */
    --s-1: .25rem;  --s-2: .5rem;   --s-3: .75rem;  --s-4: 1rem;
    --s-5: 1.5rem;  --s-6: 2rem;     --s-7: 3rem;    --s-8: 4.5rem;

    --r-sm: 6px;
    --r:    10px;
    --r-lg: 16px;
    --r-pill: 999px;

    --shadow-1: 0 1px 2px rgba(13,15,19,.05);
    --shadow-2: 0 2px 6px rgba(13,15,19,.06), 0 1px 2px rgba(13,15,19,.04);
    --shadow-3: 0 12px 32px rgba(13,15,19,.10), 0 2px 8px rgba(13,15,19,.05);
    --shadow-pop: 0 20px 50px rgba(13,15,19,.16);

    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);

    --wrap: 1280px;
    --header-h: 68px;
}

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

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

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "tnum" 0;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 var(--s-2); line-height: 1.2; font-weight: 700; letter-spacing: -.018em; }
p { margin: 0 0 var(--s-3); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }

::selection { background: var(--ink); color: #fff; }

/* Visible, consistent focus for keyboard users only. */
:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-7) 0; }
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--s-4); margin-bottom: var(--s-5); padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; }
.section-head a { font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); }
.section-head a:hover { color: var(--accent); }

.grid { display: grid; gap: var(--s-4); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.grid-side { display: grid; gap: var(--s-4); grid-template-columns: 260px minmax(0, 1fr); align-items: start; }

/* Product form + live preview side by side. */
.form-split { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.preview { position: sticky; top: var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); overflow: hidden; box-shadow: var(--shadow-1); }
.preview__head { padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); background: var(--wash); }
.preview__media { aspect-ratio: 3/4; background: var(--wash); display: grid; place-items: center; overflow: hidden; color: var(--ink-4); font-size: var(--t-xs); }
.preview__media img { width: 100%; height: 100%; object-fit: cover; }
.preview__body { padding: .85rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.preview__meta { font-size: var(--t-xs); color: var(--ink-4); text-transform: uppercase; letter-spacing: .06em; }
.preview__name { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.preview__pills { display: flex; gap: .35rem; flex-wrap: wrap; margin: .15rem 0; }
.preview__specs { list-style: none; margin: .3rem 0 0; padding: 0; font-size: var(--t-sm); }
.preview__specs li { padding: .28rem 0; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: .6rem; }
.preview__specs li span:first-child { color: var(--ink-4); }
.preview__foot { font-size: var(--t-xs); color: var(--ink-4); margin-top: .3rem; }
@media (max-width: 1100px) {
    .form-split { grid-template-columns: 1fr; }
    .preview { position: static; }
}

.flex { display: flex; }
.between { justify-content: space-between; }
.center { text-align: center; }
.right { text-align: right; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.wrap-flex { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-1 { gap: var(--s-2); }
.gap-2 { gap: var(--s-4); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.mt-1 { margin-top: var(--s-2); } .mt-2 { margin-top: var(--s-4); } .mt-3 { margin-top: var(--s-5); }
.mb-1 { margin-bottom: var(--s-2); } .mb-2 { margin-bottom: var(--s-4); } .mb-3 { margin-bottom: var(--s-5); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--ink-3); }
.lede { font-size: var(--t-lg); line-height: 1.55; }
.underline { text-decoration: underline; text-underline-offset: 2px; }
.inline-flex { display: inline-flex; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); }
.strong { font-weight: 650; }
.eyebrow {
    font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-4);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    padding: .68rem 1.2rem; border: 1px solid transparent; border-radius: var(--r-sm);
    background: var(--brand); color: var(--brand-ink);
    font-weight: 600; font-size: var(--t-base); line-height: 1.25;
    cursor: pointer; text-align: center; white-space: nowrap;
    transition: transform .12s var(--ease), box-shadow .12s var(--ease),
                background .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);
}
.btn:hover { background: var(--ink-2); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--wash); border-color: var(--ink-4); box-shadow: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #97102a; }
.btn-ok { background: var(--ok); }
.btn-danger { background: #b42318; }
.btn-danger:hover { background: #92150c; }
.btn-sm { padding: .42rem .75rem; font-size: var(--t-sm); }
.btn-lg { padding: .9rem 1.6rem; font-size: var(--t-md); }
.btn-block { display: flex; width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { color: var(--accent); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: var(--t-sm); margin-bottom: var(--s-1); }
.input, input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], input[type=date], input[type=url], select, textarea {
    width: 100%; padding: .62rem .8rem; border: 1px solid var(--line);
    border-radius: var(--r-sm); background: var(--paper);
    font-size: var(--t-base); transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-4); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13, 15, 19, .08);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
textarea { min-height: 110px; resize: vertical; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238b94a3' stroke-width='1.6' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem;
}
.field { margin-bottom: var(--s-4); }
.field small { display: block; font-size: var(--t-xs); color: var(--ink-4); margin-top: var(--s-1); }
.field code, .panel-head code { font-family: var(--font-mono, monospace); font-size: var(--t-xs); }
.req { color: #b42318; }
.field .help { font-size: var(--t-xs); color: var(--ink-4); margin-top: var(--s-1); }
.error, .field .error { color: #b42318; font-size: var(--t-xs); margin-top: var(--s-1); }
.check { display: flex; align-items: center; gap: var(--s-2); font-weight: 500; cursor: pointer; }
.check input { width: auto; flex-shrink: 0; margin: 0; accent-color: var(--ink); }
.check label, .check.inline { margin: 0; font-weight: 500; }

/* ---------- Alerts ---------- */
.alert {
    padding: .8rem 1rem; border-radius: var(--r-sm); font-size: var(--t-base);
    margin-bottom: var(--s-4); border: 1px solid transparent;
    animation: slide-in .25s var(--ease-out);
}
.alert-success { background: var(--ok-wash); color: var(--ok); border-color: #b9e3cd; }
.alert-error { background: var(--accent-wash); color: var(--accent); border-color: #f7c8ce; }
.alert-info { background: var(--info-wash); color: #1e40af; border-color: #c7d2fe; }
.alert-warn { background: var(--warn-wash); color: var(--warn); border-color: #f3ddb2; }
.alert ul { margin: var(--s-2) 0 0; padding-left: 1.1rem; }

@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Header ---------- */
.topbar { background: var(--ink); color: #b9c0cb; font-size: var(--t-xs); padding: .45rem 0; }
.topbar a { color: #fff; font-weight: 600; }

.header {
    position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .2s var(--ease);
}
.header.is-stuck { box-shadow: var(--shadow-2); }
.header .inner { display: flex; align-items: center; gap: var(--s-5); height: var(--header-h); }

.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.logo span { color: var(--accent); }

.nav { display: flex; gap: var(--s-5); font-weight: 550; font-size: var(--t-base); }
.nav a { position: relative; padding: var(--s-2) 0; color: var(--ink-2); }
.nav a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: 4px; height: 2px;
    background: var(--ink); transition: right .22s var(--ease-out);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { right: 0; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-4); }
.icon-btn {
    display: inline-flex; align-items: center; gap: var(--s-1);
    font-size: var(--t-sm); font-weight: 600; color: var(--ink-2);
    padding: var(--s-1); border-radius: var(--r-sm); transition: color .12s var(--ease);
}
.icon-btn:hover { color: var(--accent); }
.badge-count {
    background: var(--accent); color: #fff; border-radius: var(--r-pill);
    font-size: .66rem; padding: .1rem .4rem; font-weight: 700; min-width: 18px; text-align: center;
}
.badge {
    display: inline-flex; align-items: center;
    background: var(--wash); border: 1px solid var(--line); color: var(--ink-2);
    border-radius: var(--r-sm); padding: .15rem .45rem;
    font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em;
}
.badge--ok { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.yes { color: #166534; font-weight: 700; }

/* ---------- Product card ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.product-card {
    border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
    background: var(--paper); display: flex; flex-direction: column;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.product-card:hover { box-shadow: var(--shadow-3); transform: translateY(-3px); border-color: transparent; }

.product-thumb { aspect-ratio: 1/1; background: var(--wash); position: relative; overflow: hidden; display: block; }
.product-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s var(--ease-out);
}
.product-card:hover .product-thumb img { transform: scale(1.045); }
.product-thumb .ph { display: grid; place-items: center; height: 100%; color: var(--ink-4); font-size: var(--t-sm); }

.product-body { padding: var(--s-3) var(--s-4) var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); flex: 1; }
.product-meta { font-size: .68rem; color: var(--ink-4); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.product-name { font-weight: 600; font-size: var(--t-base); line-height: 1.35; }
.product-card:hover .product-name { text-decoration: underline; text-underline-offset: 2px; }
.product-price { font-weight: 700; font-size: var(--t-md); letter-spacing: -.01em; }
.product-price .mrp { font-weight: 400; color: var(--ink-4); text-decoration: line-through; font-size: var(--t-sm); margin-left: var(--s-1); }
.product-foot { margin-top: auto; padding-top: var(--s-2); }

.tag {
    position: absolute; top: var(--s-3); left: var(--s-3); z-index: 2;
    background: var(--ink); color: #fff; font-size: .66rem; font-weight: 700;
    padding: .2rem .5rem; border-radius: var(--r-sm); letter-spacing: .05em; text-transform: uppercase;
}
.tag-oos { background: var(--ink-3); }
.tag-off { background: var(--accent); }
.tag-new { background: var(--ok); }

/* ---------- Category tile ---------- */
.cat-tile {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
    border: 1px solid var(--line); border-radius: var(--r); background: var(--paper);
    padding: var(--s-5); transition: all .18s var(--ease);
}
.cat-tile:hover { border-color: transparent; box-shadow: var(--shadow-3); transform: translateY(-3px); }
.cat-tile__name { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.015em; }
.cat-tile__meta { font-size: var(--t-xs); color: var(--ink-4); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.cat-tile__go {
    font-size: 1.1rem; color: var(--ink-4); flex-shrink: 0;
    transition: transform .18s var(--ease-out), color .18s var(--ease);
}
.cat-tile:hover .cat-tile__go { transform: translateX(4px); color: var(--accent); }

/* ---------- Price gate ---------- */
.price-locked {
    display: inline-flex; align-items: center; gap: var(--s-2);
    color: var(--ink-3); font-size: var(--t-sm); font-weight: 600;
    padding: .3rem 0;
}
.price-locked a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Filters / toolbar ---------- */
.toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
    flex-wrap: wrap; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); margin-bottom: var(--s-5);
}
.shop-layout { display: grid; grid-template-columns: 248px 1fr; gap: var(--s-6); align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + var(--s-4)); }

.filter-group { border-bottom: 1px solid var(--line); padding: var(--s-4) 0; }
.filter-group:first-child { padding-top: 0; }
.filter-group:last-child { border-bottom: 0; }
.filter-group h4 {
    font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em;
    color: var(--ink-3); margin-bottom: var(--s-3); font-weight: 700;
}
.filter-opt { display: flex; align-items: center; gap: var(--s-2); padding: .22rem 0; font-size: var(--t-base); cursor: pointer; }
.filter-opt input { width: auto; margin: 0; accent-color: var(--ink); }
.filter-opt label { margin: 0; font-weight: 450; font-size: var(--t-base); cursor: pointer; flex: 1; }
.filter-opt .n { font-size: var(--t-xs); color: var(--ink-4); }
.filter-opt:hover label { color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap {
    overflow-x: auto; border: 1px solid var(--line);
    border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow-1);
}
table { width: 100%; border-collapse: collapse; font-size: var(--t-base); }
thead th {
    text-align: left; padding: .7rem var(--s-4); background: var(--wash);
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-3); font-weight: 700; white-space: nowrap;
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1;
}
tbody td { padding: .75rem var(--s-4); border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s var(--ease); }
tbody tr:hover { background: #fbfcfd; }
.table-actions { display: flex; gap: var(--s-1); flex-wrap: wrap; }

/* ---------- Panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-5); box-shadow: var(--shadow-1); }
.panel-head {
    border-bottom: 1px solid var(--line); margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-4);
    padding: var(--s-4) var(--s-5); background: var(--wash);
    border-radius: var(--r) var(--r) 0 0;
}
.panel-head h3 { margin: 0; font-size: var(--t-base); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-1); }
.stat .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-4); font-weight: 700; }
.stat .value { font-size: var(--t-2xl); font-weight: 750; margin-top: var(--s-1); letter-spacing: -.025em; line-height: 1.1; }
.stat .delta { font-size: var(--t-xs); font-weight: 600; }
.up { color: var(--ok); } .down { color: var(--accent); }

/* ---------- Pills ---------- */
.pill {
    display: inline-block; padding: .2rem .55rem; border-radius: var(--r-pill);
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    background: var(--wash-2); color: var(--ink-3); white-space: nowrap;
}
.pill-pending { background: var(--warn-wash); color: var(--warn); }
.pill-confirmed, .pill-dispatched { background: #e0f2fe; color: #075985; }
.pill-packed { background: #ede9fe; color: #5b21b6; }
.pill-delivered, .pill-paid { background: var(--ok-wash); color: var(--ok); }
.pill-cancelled, .pill-failed { background: var(--accent-wash); color: var(--accent); }
.pill-refunded { background: #f3e8ff; color: #7e22ce; }

/* ---------- Cart / summary ---------- */
.cart-line {
    display: grid; grid-template-columns: 88px 1fr auto; gap: var(--s-4);
    padding: var(--s-4) 0; border-bottom: 1px solid var(--line); align-items: center;
}
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { aspect-ratio: 1; background: var(--wash); border-radius: var(--r-sm); overflow: hidden; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }

.summary-row { display: flex; justify-content: space-between; gap: var(--s-4); padding: .45rem 0; font-size: var(--t-base); }
.summary-total { border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-3); font-weight: 700; font-size: var(--t-md); }

.notice { background: var(--wash); border-left: 3px solid var(--ink); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); font-size: var(--t-base); }
.empty { text-align: center; padding: var(--s-8) var(--s-4); color: var(--ink-4); }
.empty h3 { color: var(--ink); }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: var(--s-1); list-style: none; padding: 0; margin: var(--s-5) 0 0; flex-wrap: wrap; }
.pager li a, .pager li span {
    display: block; padding: .45rem .75rem; border: 1px solid var(--line);
    border-radius: var(--r-sm); font-size: var(--t-sm); background: var(--paper);
    transition: all .12s var(--ease);
}
.pager li a:hover { border-color: var(--ink); }
.pager li.active span { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager li.disabled span { color: var(--ink-4); opacity: .6; }

/* ==========================================================================
   Product detail
   ========================================================================== */
.pdp { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--s-7); align-items: start; }
.pdp-gallery { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
.pdp-info { position: sticky; top: calc(var(--header-h) + var(--s-4)); }

.pdp-main-img { aspect-ratio: 1/1; background: var(--wash); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.pdp-main-img img { width: 100%; height: 100%; object-fit: cover; }

.pdp-thumbs { display: flex; gap: var(--s-2); margin-top: var(--s-3); flex-wrap: wrap; }
.pdp-thumb {
    width: 76px; aspect-ratio: 1/1; border-radius: var(--r-sm); overflow: hidden;
    border: 2px solid var(--line); cursor: pointer; background: var(--wash);
    transition: border-color .14s var(--ease), transform .14s var(--ease);
}
.pdp-thumb:hover { transform: translateY(-2px); border-color: var(--ink-4); }
.pdp-thumb.is-active { border-color: var(--ink); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pdp-price { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-2) 0; }
.pdp-price .amount { font-size: var(--t-3xl); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.pdp-price .unit { font-size: var(--t-base); color: var(--ink-3); font-weight: 600; }
.pdp-price .was { font-size: var(--t-lg); color: var(--ink-4); text-decoration: line-through; }
.pdp-price .save { font-size: var(--t-xs); font-weight: 750; background: var(--accent-wash); color: var(--accent); padding: .2rem .5rem; border-radius: var(--r-sm); }

.pdp-pack-total {
    display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4);
    background: var(--ink); color: #fff; border-radius: var(--r); padding: var(--s-3) var(--s-4);
}
.pdp-pack-total .lbl { font-size: var(--t-sm); color: #b9c0cb; font-weight: 600; }
.pdp-pack-total .val { font-weight: 750; font-size: var(--t-lg); letter-spacing: -.01em; }

.pdp-field { margin: var(--s-5) 0; }
.pdp-field > .lbl {
    display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3);
    font-size: var(--t-xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--ink-3); margin-bottom: var(--s-3);
}

.pills { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pill-opt { position: relative; cursor: pointer; }
.pill-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-opt .face {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    border: 1.5px solid var(--line); border-radius: var(--r-pill);
    padding: .5rem 1.1rem; font-size: var(--t-base); font-weight: 650;
    background: var(--paper); transition: all .14s var(--ease); text-align: center; line-height: 1.2;
}
.pill-opt .face .sub { font-size: .7rem; font-weight: 500; color: var(--ink-4); }
.pill-opt:hover .face { border-color: var(--ink-4); }
.pill-opt input:checked + .face { border-color: var(--ink); background: var(--ink); color: #fff; }
.pill-opt input:checked + .face .sub { color: #b9c0cb; }
.pill-opt input:focus-visible + .face { outline: 2px solid var(--ink); outline-offset: 2px; }
.pill-opt.is-out .face { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

/* Colour picker rendered as photo thumbnails. */
.colour-swatches { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.cs { position: relative; cursor: pointer; width: 78px; text-align: center; }
.cs input { position: absolute; opacity: 0; width: 0; height: 0; }
.cs .box {
    display: block; aspect-ratio: 1/1; border: 2px solid var(--line);
    border-radius: var(--r); overflow: hidden; position: relative; background: var(--wash);
    transition: border-color .14s var(--ease), transform .14s var(--ease);
}
.cs .box img { width: 100%; height: 100%; object-fit: cover; }
.cs:hover .box { transform: translateY(-2px); border-color: var(--ink-4); }
.cs input:checked + .box { border-color: var(--ink); }
.cs input:checked + .box::after {
    content: "\2713"; position: absolute; right: 4px; bottom: 4px;
    width: 20px; height: 20px; background: var(--ink); color: #fff;
    border-radius: 50%; display: grid; place-items: center; font-size: 12px;
}
.cs input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }
.cs .cs-name { display: block; font-size: var(--t-xs); margin-top: var(--s-2); color: var(--ink-3); }
.cs.is-out .box { opacity: .45; }
.cs.is-out .cs-name { color: var(--ink-4); }

/* Quantity stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--paper); }
.stepper button { width: 42px; height: 44px; border: 0; background: transparent; font-size: 1.1rem; font-weight: 700; transition: background .12s var(--ease); }
.stepper button:hover { background: var(--wash); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper input {
    width: 58px; height: 44px; text-align: center; border: 0;
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    font-weight: 700; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.buy-line { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.buy-line .hint { font-size: var(--t-sm); color: var(--ink-3); }

/* Shown when a colour has no stock at all, so the shopper is told instead of
   meeting a dead quantity box. */
.stock-alert {
  margin-top: var(--s-3); padding: .65rem .85rem;
  border: 1.5px solid #f3ddb2; border-radius: var(--r-sm);
  background: var(--warn-wash); color: var(--ink);
  font-size: var(--t-sm); line-height: 1.5;
}
.stock-alert[hidden] { display: none; }

.trust-row { display: flex; gap: var(--s-5); flex-wrap: wrap; margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.trust-row div { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-sm); color: var(--ink-3); }
.trust-row .ico { color: var(--ok); font-weight: 800; }

.acc { border-top: 1px solid var(--line); }
.acc:last-of-type { border-bottom: 1px solid var(--line); }
.acc summary {
    list-style: none; cursor: pointer; padding: var(--s-4) 0;
    font-weight: 650; font-size: var(--t-base); display: flex;
    justify-content: space-between; align-items: center; gap: var(--s-4);
    transition: color .12s var(--ease);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { color: var(--accent); }
.acc summary::after { content: "+"; font-size: 1.3rem; font-weight: 400; color: var(--ink-4); line-height: 1; }
.acc[open] summary::after { content: "\2212"; }
.acc .acc-body { padding-bottom: var(--s-4); font-size: var(--t-base); color: var(--ink-3); }
.acc .acc-body td { padding: .35rem 0; }

.breakdown { display: flex; gap: var(--s-2); flex-wrap: wrap; }
/* Size chips inside "In one pack". These inherit the dark .chip treatment from
   store.css, which left them washed-out and unreadable; override fully. */
.breakdown .chip {
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: .4rem .75rem; background: var(--paper); color: var(--ink);
  font-family: var(--font-mono, monospace); font-size: var(--t-sm);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}
.breakdown .chip b { font-size: var(--t-base); color: var(--ink); }
.breakdown .chip.muted { color: var(--ink-3); font-weight: 500; }

.sticky-atc {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: var(--s-2) var(--s-5);
    padding-bottom: calc(var(--s-2) + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(13, 15, 19, .07);
}
.sticky-atc .inner { display: flex; align-items: center; gap: var(--s-4); max-width: var(--wrap); margin: 0 auto; }
.sticky-atc .meta { flex: 1; min-width: 0; }
.sticky-atc .meta .t1 { font-size: var(--t-xs); color: var(--ink-3); }
.sticky-atc .meta .t2 { font-weight: 750; font-size: var(--t-md); }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; background: var(--wash); padding: var(--s-6) var(--s-4); }
.auth-card { width: 100%; max-width: 424px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-3); }
.auth-wide { max-width: 560px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #98a1ae; margin-top: var(--s-8); padding: var(--s-7) 0 var(--s-5); font-size: var(--t-sm); }
.footer h4 { color: #fff; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--s-3); }
.footer a { color: #98a1ae; transition: color .12s var(--ease); }
.footer a:hover { color: #fff; }
.footer p { margin-bottom: var(--s-2); }
.footer-bottom { border-top: 1px solid #262b33; margin-top: var(--s-6); padding-top: var(--s-4); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2); font-size: var(--t-xs); }

/* ---------- Admin shell ---------- */
.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: var(--wash); }
.admin-side { background: var(--ink); color: #98a1ae; padding: var(--s-4) 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-brand { padding: 0 var(--s-5) var(--s-4); font-size: 1.15rem; font-weight: 800; color: #fff; letter-spacing: .02em; }
.admin-brand span { color: var(--accent); }
.admin-group { padding: var(--s-4) var(--s-5) var(--s-1); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: #545d6b; font-weight: 700; }
.admin-side a { display: block; padding: .5rem var(--s-5); font-size: var(--t-base); border-left: 3px solid transparent; transition: all .12s var(--ease); }
.admin-side a:hover { background: #191d24; color: #fff; }
.admin-side a.active { background: #191d24; color: #fff; border-left-color: var(--accent); font-weight: 600; }
/* Subordinate link: same left edge as its siblings, set apart by size only. */
.admin-side a.sub { font-size: .86em; color: #7d8794; padding-top: .42rem; padding-bottom: .42rem; }
.admin-side a.sub:hover, .admin-side a.sub.active { color: #fff; }
/* Footer block: same horizontal rhythm as the nav, stacked with even gaps. */
.admin-side .side-foot { padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: .55rem; }
.admin-side .side-foot form { margin: 0; }
.admin-side .side-foot .btn { width: 100%; }
.admin-main { padding: var(--s-5) var(--s-6) var(--s-8); min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.admin-head h1 { font-size: var(--t-xl); margin: 0; }
.breadcrumb { font-size: var(--t-xs); color: var(--ink-4); margin-bottom: var(--s-1); }
.breadcrumb a:hover { color: var(--ink); }

/* Editor matrices */
.matrix { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.matrix table { min-width: 560px; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--s-2); }
.size-cell { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s-2); text-align: center; transition: border-color .12s var(--ease); }
.size-cell:focus-within { border-color: var(--ink); }
.size-cell .lbl { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--ink-4); }
.size-cell input { text-align: center; padding: .35rem; font-size: var(--t-sm); border: 0; background: transparent; }
.size-cell input:focus { box-shadow: none; }
.stock-input { width: 72px; text-align: center; padding: .3rem; font-size: var(--t-sm); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .pdp { grid-template-columns: 1fr; gap: var(--s-5); }
    .pdp-gallery, .pdp-info { position: static; }
}

@media (max-width: 900px) {
    .admin { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; }
    .admin-main { padding: var(--s-4); }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --header-h: 60px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .shop-layout { grid-template-columns: 1fr; }
    .filters { position: static; }
    .nav { display: none; }
    h1 { font-size: var(--t-xl); }
    .pdp-price .amount { font-size: var(--t-2xl); }
    .sticky-atc { display: block; }
    .pdp-buy { padding-bottom: 4rem; }
    .wrap { padding: 0 var(--s-4); }
    .section { padding: var(--s-6) 0; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    .cart-line { grid-template-columns: 64px 1fr; }
    .cart-line > :last-child { grid-column: 1 / -1; text-align: left; }
}

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

@media print {
    .header, .topbar, .footer, .sticky-atc, .admin-side, .admin-head .btn, form { display: none !important; }
    .admin, .admin-main { display: block; background: #fff; padding: 0; }
    body { background: #fff; }
}