/* ============================================================================
   X-VAPE WHOLESALE — design system
   Dark, industrial-premium, product-forward. One accent (#FF3B2F molten red
   taken from the X-VAPE device artwork). Type: Space Grotesk display / Inter body.
   ============================================================================ */

/* ---------- tokens ---------- */
:root {
  --bg:          #0A0A0B;
  --bg-elev:     #101013;
  --surface:     #141418;
  --surface-2:   #1B1B21;
  --line:        #26262E;
  --line-soft:   #1E1E25;
  --ink:         #F4F2EE;
  --ink-2:       #C9C7C2;
  --muted:       #8E8E98;
  --accent:      #FF3B2F;
  --accent-ink:  #FFFFFF;
  --gold:        #FFC24B;
  --ok:          #46D39A;
  --danger:      #FF5A5A;

  --r-sm: 8px;  --r: 12px;  --r-lg: 18px;  --r-pill: 999px;
  --pad: clamp(16px, 4vw, 32px);
  --maxw: 1240px;

  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 30px -18px rgba(0,0,0,.9);
  --font-display: "Space Grotesk", "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* `hidden` must win over the layout rules below (`.btn`, `.row`, `.stack` …). Those
   set `display`, and an author rule beats the browser's own [hidden] rule, so a
   hidden control stays on screen — which is how a dead "Email this order" button
   once sat on the checkout page. Keep this !important. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: clamp(40px, 7vw, 88px) 0; border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: 0; }
.eyebrow {
  font-family: var(--font-display); font-size: .74rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.lead { color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }
.stack > * + * { margin-top: var(--s, 16px); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.mono-num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto;
  background: linear-gradient(145deg, var(--accent), #B01F16);
  display: grid; place-items: center; color: #fff;
  font-size: 17px; font-weight: 700;
}
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 420px) { .brand small { display: none; } }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; position: relative; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 13px; border-radius: var(--r-pill); font-size: .94rem; color: var(--ink-2);
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  padding: 0 15px; height: 44px; border-radius: var(--r-pill); cursor: pointer;
}
.cart-btn:hover { border-color: #3A3A46; }
.cart-btn .badge {
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font-size: .76rem; font-weight: 700;
  display: grid; place-items: center;
}
.cart-btn .badge[hidden] { display: none; }
.nav-toggle { display: none; }

/* mobile: collapse the links into a dropdown, keep the cart visible */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; height: 44px; padding: 0 15px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-size: .92rem; }
  .nav-links {
    position: absolute; top: calc(100% + 14px); right: 0; min-width: 200px;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; }
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--ink); --btn-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 600; font-size: .95rem; cursor: pointer; text-align: center;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: transparent; }
.btn--primary:hover { --btn-bg: #FF5347; }
.btn--ghost { --btn-bg: transparent; --btn-bd: var(--line); }
.btn--quiet { --btn-bg: transparent; --btn-bd: transparent; color: var(--muted); }
.btn--quiet:hover { color: var(--ink); }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 13px; font-size: .88rem; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 104px) 0 clamp(36px, 6vw, 72px); }
.hero::before {
  content: ""; position: absolute; inset: -30% 40% 40% -10%; z-index: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255,59,47,.16), transparent 70%);
  pointer-events: none;
}
.hero .inner { position: relative; z-index: 1; display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: 1.05fr .95fr; align-items: center; }
.hero h1 { margin: 14px 0 16px; }
.hero .price-hero { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 8px; font-family: var(--font-display); }
.hero .price-hero b { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 700; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; max-width: 520px; }
.fact { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.fact b { display: block; font-family: var(--font-display); font-size: 1.06rem; }
.fact span { font-size: .78rem; color: var(--muted); }
.hero-visual { position: relative; }
.hero-visual .frame {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); aspect-ratio: 4/3;
}
.hero-visual .frame img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .hero .inner { grid-template-columns: 1fr; } .hero-visual { order: -1; } }

/* ---------- MOQ meter ---------- */
.moq {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 14px 16px; display: grid; gap: 10px;
}
.moq[data-met="true"] { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.moq .bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.moq .bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width .35s cubic-bezier(.2,.7,.2,1);
}
.moq[data-met="true"] .bar i { background: linear-gradient(90deg, var(--ok), #7BE8BE); }
.moq .label { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.moq .label b { font-family: var(--font-display); }

/* ---------- toolbar / filters ---------- */
.toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px 0 22px; border-bottom: 1px solid var(--line-soft); margin-bottom: 26px;
}
.search { position: relative; flex: 1 1 240px; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
}
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .5; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #0A0A0B; border-color: var(--ink); font-weight: 600; }
select.sort { height: 44px; padding: 0 34px 0 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 17px center, right 12px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* ---------- product grid ---------- */
.grid-products { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: border-color .16s ease, transform .16s ease;
}
.card:hover { border-color: #34343E; transform: translateY(-2px); }
.card .thumb { position: relative; aspect-ratio: 1/1; background: #EFEDEA; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .flags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.flag {
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--r-pill); background: rgba(10,10,11,.78); color: #fff;
}
.flag--accent { background: var(--accent); }
.flag--gold { background: var(--gold); color: #1A1400; }
button.linkish {
  background: none; border: 0; padding: 0; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: .8rem;
}
button.linkish:hover { color: var(--ink); }

/* ---------- photo lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(6,6,7,.92);
  display: grid; place-items: center; padding: clamp(12px, 3vw, 40px);
  animation: toast-in .18s ease both;
}
.lb-inner { position: relative; display: grid; gap: 14px; justify-items: center; width: min(100%, 900px); }
.lb-img { max-height: min(68vh, 620px); width: auto; border-radius: var(--r); background: #EFEDEA; }
.lb-meta { font-size: .95rem; text-align: center; }
.lb-close { position: absolute; top: -6px; right: -6px; background: var(--surface-2); }
.lb-thumbs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lb-thumb { width: 60px; height: 60px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: #EFEDEA; }
.lb-thumb.is-active { border-color: var(--accent); }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .flavor { font-family: var(--font-display); font-size: 1.06rem; font-weight: 600; letter-spacing: -.01em; }
.card .sub { font-size: .8rem; color: var(--muted); }
.card .price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.card .price b { font-family: var(--font-display); font-size: 1.24rem; }
.card .price span { font-size: .78rem; color: var(--muted); }
.card .actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.stepper button { width: 40px; height: 42px; background: none; border: 0; cursor: pointer; color: var(--ink); font-size: 1.05rem; }
.stepper button:hover { background: var(--line); }
.stepper input {
  width: 44px; height: 42px; text-align: center; background: none; border: 0;
  font-variant-numeric: tabular-nums; font-weight: 600;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- tables ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .93rem; }
table.tbl thead th { font-family: var(--font-display); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--bg-elev); position: sticky; top: 0; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl input.qty {
  width: 74px; height: 40px; text-align: center; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.line-item { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.line-item img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r-sm); background: #EFEDEA; flex: 0 0 auto; }

/* ---------- panels / notices ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: clamp(16px, 2.4vw, 26px); }
.panel--elev { background: var(--bg-elev); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: .9rem; }
.notice--warn { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.notice--ok   { border-color: color-mix(in srgb, var(--ok) 45%, var(--line));   background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.notice--danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.notice code, code.inline {
  background: var(--surface-2); border: 1px solid var(--line); padding: 2px 6px;
  border-radius: 6px; font-size: .84rem; word-break: break-all;
}

/* ---------- cart drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.62); opacity: 0; pointer-events: none;
  transition: opacity .25s ease; z-index: 60;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--bg-elev); border-left: 1px solid var(--line); z-index: 61;
  transform: translateX(102%); transition: transform .3s cubic-bezier(.2,.7,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.drawer .items { padding: 16px 20px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.drawer .items .line { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.drawer footer { padding: 18px 20px; border-top: 1px solid var(--line-soft); display: grid; gap: 12px; background: var(--bg-elev); }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-pill); background: none; border: 1px solid var(--line); cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 26px; align-items: start; }
@media (max-width: 880px) { .checkout-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-size: .84rem; color: var(--ink-2); }
.field input, .field textarea, .field select {
  height: 46px; padding: 0 14px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line);
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
.totals { display: grid; gap: 10px; }
.totals .line { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.totals .line--grand { border-top: 1px solid var(--line); padding-top: 12px; font-family: var(--font-display); font-size: 1.16rem; font-weight: 600; }
.steps { counter-reset: s; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.step::before {
  counter-increment: s; content: counter(s);
  width: 30px; height: 30px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); font-size: .84rem; font-weight: 700;
}
.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 600; font-family: var(--font-display); }
.faq details[open] summary { margin-bottom: 8px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 40px 0 56px; color: var(--muted); font-size: .88rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; margin-bottom: 26px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- toast ---------- */
.toast-host { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: max-content; max-width: min(92vw, 420px); }
.toast {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 16px; font-size: .9rem; box-shadow: var(--shadow);
  animation: toast-in .22s ease both;
}
.toast b { font-family: var(--font-display); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media print {
  .site-header, .site-footer, .btn, .drawer, .drawer-backdrop { display: none !important; }
  body { background: #fff; color: #000; }
}
