/* Jaipur Handloomia — border-driven minimalist theme.
   Gallery-white canvas, hairline-bordered cards, zero shadows (except one
   brand-tinted glow on the primary button). One chromatic accent: --brand,
   editable live from admin settings (with --accent as a soft secondary). */

* { box-sizing: border-box; margin: 0; padding: 0; }
/* The [hidden] attribute is how PDP JS toggles per-variant UI (price/discount/stock notes).
   Author display: rules otherwise win over the UA's [hidden]{display:none} default, so any
   class that sets display would silently defeat a JS-set `.hidden = true` without this. */
[hidden] { display: none !important; }

:root {
  /* ---- Primitive layer: raw brand values (only place hex lives) ---- */
  --brand-600: #B03A2E;       /* overridden per-request from admin settings */
  --accent-300: #E8DAB2;      /* overridden per-request from admin settings */
  --neutral-900: #1d1d1f;
  --neutral-600: #6e6e73;
  --neutral-300: #c9cbcc;
  --neutral-100: #e8e8ed;
  --neutral-50: #f5f5f7;
  --white: #ffffff;
  --black-panel: #121212;
  --amber-500: #d4a017;

  /* ---- Semantic layer: purpose aliases consumed everywhere else ---- */
  --brand: var(--brand-600);
  --accent: var(--accent-300);
  --ink: var(--neutral-900);        /* primary text */
  --slate: var(--neutral-600);      /* secondary text — 4.7:1+ on canvas/white, passes WCAG AA */
  --concrete: var(--neutral-300);   /* disabled / tertiary */
  --hairline: var(--neutral-100);   /* the border that replaces shadows */
  --canvas: var(--neutral-50);      /* page background */
  --card: var(--white);             /* card/input surface */
  --dark-panel: var(--black-panel); /* announcement bar */
  --amber: var(--amber-500);        /* star ratings only */
  --focus-ring: var(--brand);       /* keyboard focus indicator */

  /* ---- Component layer: shape + rhythm tokens ---- */
  --radius-card: 14px;
  --radius-image: 10px;
  --radius-input: 10px;
  --radius-pill: 999px;
  --tap-min: 44px;                  /* WCAG/HIG minimum touch target */

  --track-tight: -0.022em;
  --track-snug: -0.014em;
  --track-body: -0.006em;

  /* ---- Spacing scale: 8px-base rhythm — new code should reach for these instead of
     ad-hoc px values (existing rules migrate opportunistically, not in one sweep) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* ---- Semantic status colors — the values already in use across the app, now named
     so every success/warning/danger surface (badges, alerts, form errors) reads from
     one source instead of repeating hex literals ---- */
  --success-ink: #1e7d32;
  --success-bg: #e3f3e6;
  --warning-ink: #9a6b00;
  --warning-bg: #fff5e0;
  --danger-ink: #b64400;
  --danger-bg: #fdeee7;

  /* ---- Motion — micro-interaction timing, respected only where prefers-reduced-motion
     allows it (see the media query at the end of this file) ---- */
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

html { -webkit-text-size-adjust: 100%; }
body {
  /* --font-body/--font-heading come from the per-request <style> override in head.ejs when
     the body_font/heading_font settings are set (src/design-tokens.js's vetted stacks only);
     unset, the fallback below is the original system stack — zero behavior change. */
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Inter", Arial, sans-serif);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.47;
  font-size: 15px;
  letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
code { font-size: 12px; background: var(--card); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 5px; }

h1, h2, h3 { letter-spacing: var(--track-tight); line-height: 1.1; font-weight: 700; font-family: var(--font-heading, inherit); }

/* Visible keyboard focus on every interactive element — the border-driven system removes
   default browser outlines in a few places, so this replacement must not be skipped. Only
   shows for keyboard nav (:focus-visible), never on mouse/touch click. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Chrome: announcement, header, footer ---------- */

.announce {
  background: var(--dark-panel);
  color: #fff;
  text-align: center;
  padding: 9px 16px;
  font-size: 12.5px;
  letter-spacing: var(--track-body);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.logo { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo-img { height: 46px; width: 46px; object-fit: contain; flex: none; }
.logo span {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: var(--track-tight);
  color: var(--brand);
}
.logo:hover span { color: var(--brand); opacity: .85; }
.site-header-links { display: flex; align-items: center; gap: 22px; }
.site-header-links a { font-size: 13.5px; color: var(--ink); letter-spacing: var(--track-snug); }
.site-header-icons { display: flex; align-items: center; gap: 18px; }
.site-header-icons a { display: flex; align-items: center; color: var(--ink); }
.site-header-icons a:hover { color: var(--brand); }
.cart-icon-link { position: relative; }
.cart-badge {
  position: absolute; top: -8px; right: -10px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* Header search — pill with embedded round submit */
.header-search {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 16px;
  transition: border-color .15s ease;
}
.header-search:focus-within { border-color: var(--ink); }
.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 7px 8px 7px 0;
  font-size: 13.5px;
  color: var(--ink);
}
.header-search input::placeholder { color: var(--slate); }
.header-search button {
  flex: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer {
  margin-top: 64px;
  padding: 48px 28px 56px;
  background: var(--card);
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 13px;
  color: var(--slate);
}
.site-footer > p:first-child { color: var(--ink); font-weight: 600; letter-spacing: var(--track-snug); margin-bottom: 6px; }
.footer-links { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; margin: 14px 0 18px; font-size: 12.5px; }
.footer-links a { color: var(--slate); }
.footer-links a:hover { color: var(--ink); }

.footer-newsletter { max-width: 380px; margin: 0 auto 18px; }
.footer-newsletter label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.footer-newsletter-row { display: flex; gap: 8px; }
.footer-newsletter-row input[type="email"] {
  flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); background: var(--canvas); font-size: 14px; color: var(--ink);
}
.footer-newsletter-row input[type="email"]:focus { border-color: var(--ink); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min); /* 44px — every primary CTA meets the touch-target minimum */
  background: var(--brand);
  color: #fff;
  padding: 11px 26px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: var(--track-snug);
  cursor: pointer;
  transition: opacity .15s ease, transform .1s ease;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--brand) 28%, transparent);
}
.btn:hover { color: #fff; opacity: .88; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

/* Secondary: outlined pill — white fill, ink border, no shadow */
.btn.small {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: none;
  font-size: 12.5px;
  padding: 7px 16px;
  font-weight: 500;
}
.btn.small:hover { opacity: 1; background: var(--ink); color: #fff; }

button.link {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12.5px;
  font-family: inherit;
  letter-spacing: var(--track-body);
}
form.inline { display: inline; }

/* ---------- Hero + homepage ---------- */

.hero {
  text-align: center;
  padding: 88px 24px 72px;
  background: var(--canvas);
}
.hero h1 {
  font-size: clamp(38px, 6.5vw, 76px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.05;
  max-width: 850px;
  margin: 0 auto 18px;
}
.hero p {
  font-size: 17px;
  font-weight: 400;
  color: var(--slate);
  letter-spacing: var(--track-body);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

/* ---------- Hero banner carousel (admin-editable slides) ---------- */

.hero-carousel { position: relative; overflow: hidden; height: min(72vh, 560px); background: var(--dark-panel); }
.hero-slide { position: absolute; inset: 0; opacity: 0; }
.hero-slide.active { opacity: 1; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .hero-slide { transition: opacity 700ms ease; }
}
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slide-scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,10,8,.58), rgba(15,10,8,.12) 62%); }
.hero-slide-content { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 8vw; max-width: 600px; }
.hero-slide-content h1 { color: #fff; font-size: clamp(30px, 4.5vw, 52px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; margin-bottom: var(--space-3); }
.hero-slide-content p { color: #fff; opacity: .92; font-size: 15.5px; margin-bottom: var(--space-5); line-height: 1.5; }
.hero-dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: var(--space-2); z-index: 2; }
.hero-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); border: none; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.hero-dot.active { width: 22px; background: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .hero-dot { transition: width var(--dur-base) var(--ease-out); }
}

/* ---------- Horizontal product carousel (bestsellers) ---------- */

.carousel-wrap { position: relative; max-width: 1200px; margin: 0 auto; }
.carousel { display: flex; gap: var(--space-5); overflow-x: auto; scroll-snap-type: x mandatory; padding: var(--space-4) 46px var(--space-7); scroll-behavior: smooth; }
.carousel-item { flex: 0 0 240px; scroll-snap-align: start; }
/* Center on the card PHOTO (padding-top + half of .card img's fixed 240px height), not the
   whole card including price text below — arrows overlaying the image reads correctly,
   arrows overlaying the price text does not. */
.carousel-arrow {
  position: absolute; top: calc(var(--space-4) + 120px); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--hairline); background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.carousel-arrow-prev { left: 2px; }
.carousel-arrow-next { right: 2px; }
/* The last card is deliberately left "peeking" at the scroll edge to hint there's more to
   scroll — without a fade, its title text just gets hard-clipped mid-word, which reads as
   a bug rather than an intentional peek. Fade it out instead. */
.carousel-wrap::before, .carousel-wrap::after {
  content: ""; position: absolute; top: 0; bottom: var(--space-7); width: 46px; z-index: 2; pointer-events: none;
}
.carousel-wrap::before { left: 0; background: linear-gradient(to right, var(--canvas), transparent); }
.carousel-wrap::after { right: 0; background: linear-gradient(to left, var(--canvas), transparent); }

.page-head { text-align: center; padding: 52px 24px 12px; }
/* Search echoes the raw query into this h1 ("Results for '…'") — a long unbroken query
   (no spaces) doesn't wrap by default and pushes the page wider than the viewport. */
.page-head h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; overflow-wrap: break-word; }
.page-head h2 { font-size: 24px; }
.page-head p { color: var(--slate); }
.page-head .breadcrumb { justify-content: center; margin-bottom: 14px; }

.blog-cover { max-width: 800px; margin: 8px auto 0; padding: 0 24px; }
.blog-cover img { width: 100%; border-radius: var(--radius-card); display: block; }

.muted { color: var(--slate); font-size: 13px; letter-spacing: var(--track-body); }
.error { color: var(--danger-ink); }
.success { color: var(--success-ink); }

/* Category chips — outlined pills, ink-filled when active */
.categories { display: flex; flex-wrap: wrap; gap: 8px; padding: 24px; justify-content: center; }
.chip {
  border: 1px solid var(--hairline);
  background: var(--card);
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  font-size: 13px;
  letter-spacing: var(--track-snug);
  color: var(--ink);
  transition: border-color .15s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Product grid + cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 16px 28px 56px;
  max-width: 1200px;
  margin: 0 auto;
}
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
  color: var(--ink);
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--concrete); color: var(--ink); }
.card img { height: 240px; width: 100%; object-fit: cover; background: var(--canvas); }
.card-image { position: relative; }
/* Only dim for an availability badge (sold out / low stock) — a discount badge is good
   news, dimming the photo under it reads as "unavailable" and undercuts the deal. */
.card-image:has(.card-badge:not(.card-badge-discount)) img { opacity: 0.55; }
@media (prefers-reduced-motion: no-preference) {
  .card-image img { transition: transform 450ms var(--ease-out); }
  .card:hover .card-image img { transform: scale(1.06); }
}
.card-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(20, 20, 20, 0.85); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--radius-pill);
}
.card-badge-discount { background: var(--brand); }
.card-body { padding: 14px 16px 18px; }
.card-body .muted { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.card-body h3 { font-size: 14.5px; font-weight: 600; letter-spacing: var(--track-snug); margin: 5px 0 6px; line-height: 1.3; }
.card-body strong { font-size: 13.5px; font-weight: 600; }
.card-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.card-compare-price { font-size: 12px; color: var(--slate); text-decoration: line-through; }

.home-view-all { text-align: center; margin: -24px auto 32px; }

/* Brand motif divider (partials/motif-divider.ejs) — Sanganeri floral-sprig block-print
   repeat, low-opacity accent tone. Purely decorative, so it's hidden from assistive tech
   via aria-hidden on the wrapper. */
.motif-divider { color: var(--brand); opacity: 0.28; margin: 0; line-height: 0; }
.motif-divider svg ellipse, .motif-divider svg circle { fill: currentColor; }

/* Scroll-reveal (src/public/reveal.js) — fade + lift the first time an element enters the
   viewport. .reveal-stagger children get a small per-item delay (30-60ms) so a grid/row
   fills in as a sequence rather than popping in all at once. */
.reveal, .reveal-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 550ms var(--ease-out), transform 550ms var(--ease-out);
}
.reveal.is-visible, .reveal-stagger > *.is-visible { opacity: 1; transform: none; }
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 120ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 180ms; }
.reveal-stagger > *:nth-child(n+5) { transition-delay: 220ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { transition: none !important; opacity: 1; transform: none; }
}

.stars { color: var(--amber); font-size: 11px; letter-spacing: 1px; }
.stars-count { margin-left: 4px; font-size: 11px; }

/* ---------- Homepage sections ---------- */

.section-banner {
  text-align: center;
  padding: 44px 28px;
  margin: 8px auto 28px;
  max-width: 1144px;
  border-radius: 20px;
}
.section-banner h2 { font-size: 26px; margin-bottom: 8px; }
.section-banner p { margin-bottom: 16px; }

.section-badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 28px 28px; }
.section-badges .badge {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: var(--track-snug);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
}

.section-testimonial { text-align: center; padding: 44px 24px; margin: 0 auto 24px; max-width: 720px; }
.section-testimonial blockquote {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: var(--track-tight);
  line-height: 1.3;
  margin-bottom: 12px;
}

/* ---------- Product page ---------- */

.product-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  padding: 48px 28px 28px;
  max-width: 1080px;
  margin: 0 auto;
}
/* Grid items default to min-width:auto — without this, .product-info's nested 3-column
   trust-icon grid (each cell needs ~107px to fit "Genuine Handloom" etc. without wrapping)
   forces .product-page's whole column wider than the viewport on narrow phones (<360px).
   Same bug class as the shop page's filter grid; same fix. */
.product-image, .product-info { min-width: 0; }
/* Plain single-image PDPs (bundle.ejs) — a direct <img> child of .product-image, no
   gallery wrapper. Gallery images (product.ejs) live deeper (.pdp-gallery-zoom /
   .pdp-thumbs-rail) and get their own explicit sizing below so this floor doesn't leak in. */
.product-image > img { border-radius: var(--radius-image); border: 1px solid var(--hairline); background: var(--canvas); width: 100%; min-height: 320px; object-fit: cover; }

/* Thumb rail (col 1) + main image (col 2, row 1) + mobile dots (col 2, row 2) — scoped to
   the id (not the bare .product-image class) so bundle.ejs's plain single-image wrapper
   keeps its simple block layout. min-width:0 on both tracks so a long product title
   elsewhere on the page can never pull this grid wider than its column (same class of bug
   fixed on the shop page's filter grid). */
#pdp-gallery.product-image { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: var(--space-2) var(--space-3); position: sticky; top: 80px; }
.pdp-thumbs-rail { grid-column: 1; grid-row: 1 / 3; display: flex; flex-direction: column; gap: var(--space-2); max-height: 520px; overflow-y: auto; min-width: 0; }
.pdp-thumbs-rail img {
  width: 64px; height: 64px; min-height: 0; object-fit: cover;
  border-radius: 8px; cursor: pointer; flex: none;
  border: 1px solid var(--hairline); background: var(--canvas);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.pdp-thumbs-rail img:hover { border-color: var(--ink); }
.pdp-thumbs-rail img.active { border-color: var(--ink); }
.pdp-gallery { grid-column: 2; grid-row: 1; position: relative; overflow: hidden; min-width: 0; }
.pdp-gallery-zoom { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-image); border: 1px solid var(--hairline); background: var(--canvas); overflow: hidden; cursor: zoom-in; }
.pdp-gallery-slide { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; opacity: 0; transition: opacity var(--dur-base) var(--ease-out); border: none; border-radius: 0; }
.pdp-gallery-slide.active { opacity: 1; }
.pdp-gallery-slide.zoomed { transform: scale(1.8); transition: transform 80ms ease-out; }
.pdp-gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--hairline); background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.pdp-gallery-arrow-prev { left: 10px; }
.pdp-gallery-arrow-next { right: 10px; }
.pdp-discount-badge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 5px 10px; border-radius: 6px;
}
.pdp-dots { grid-column: 2; grid-row: 2; display: none; gap: 6px; justify-content: center; }
.pdp-dot { width: 8px; height: 8px; border-radius: 4px; border: none; background: var(--concrete); cursor: pointer; padding: 0; transition: width var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.pdp-dot.active { width: 22px; background: var(--ink); }

.pdp-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: var(--space-4); }
.pdp-price { font-size: 26px; font-weight: 700; letter-spacing: var(--track-snug); }
.pdp-compare-price { font-size: 16px; color: var(--slate); text-decoration: line-through; }
.pdp-discount-pill { background: var(--danger-bg); color: var(--danger-ink); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.pdp-tax-note { color: var(--slate); font-size: 12.5px; margin-top: 6px; }
.pdp-divider { border: none; border-top: 1px solid var(--hairline); margin: 18px 0; }

.pdp-size-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pdp-size-guide-link { font-size: 12.5px; color: var(--ink); background: none; border: none; cursor: pointer; padding: 0; text-decoration: underline; }
.pdp-variant-options { display: flex; gap: 8px; flex-wrap: wrap; }
.pdp-variant-pill {
  min-width: var(--tap-min); min-height: var(--tap-min); padding: 8px 14px;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--hairline); background: var(--card); color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.pdp-variant-pill.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.pdp-variant-pill.disabled, .pdp-variant-pill:disabled { color: var(--concrete); opacity: 0.5; cursor: not-allowed; }

.pdp-size-block { margin-bottom: var(--space-5); }
.pdp-design-block { margin-bottom: var(--space-5); }
.pdp-design-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pdp-design-swatch {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  border: 1.5px solid var(--hairline); display: block; flex: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.pdp-design-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-design-swatch:hover { border-color: var(--concrete); }
.pdp-design-swatch[aria-current="true"] { border-color: var(--ink); border-width: 2px; }
.pdp-qty-block { display: flex; align-items: center; gap: 14px; margin-bottom: var(--space-5); }
.pdp-qty-stepper { display: flex; align-items: center; border: 1px solid var(--hairline); border-radius: var(--radius-input); overflow: hidden; }
.pdp-qty-stepper button { width: 38px; height: 38px; border: none; background: var(--card); cursor: pointer; font-size: 16px; color: var(--ink); }
.pdp-qty-stepper button:hover { background: var(--canvas); }
.pdp-qty-stepper span { width: 36px; text-align: center; font-size: 14px; font-weight: 600; }

.pdp-actions { display: flex; gap: 10px; max-width: 400px; }
.pdp-actions .btn { flex: 1; min-height: 48px; }
.btn-accent { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn-accent:hover { opacity: .88; }
.pdp-wishlist-link {
  display: flex; align-items: center; gap: 7px; margin-top: 14px;
  background: none; border: none; cursor: pointer; padding: 0; font-size: 13px; color: var(--ink);
}
.pdp-wishlist-link.active, .pdp-wishlist-link:hover { color: var(--brand); }
.pdp-whatsapp-share { display: inline-block; }
.pdp-share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pdp-payment-request {
  margin-top: 16px; padding: 14px 16px; max-width: 400px;
  background: var(--success-bg); border: 1px solid var(--success-ink); border-radius: var(--radius-card);
}
.pdp-payment-request p { font-size: 13.5px; color: var(--ink); margin-bottom: 10px; }

.pdp-delivery-box { margin-top: var(--space-5); padding: var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius-image); background: var(--card); max-width: 400px; }
.pdp-delivery-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.pdp-delivery-row { display: flex; gap: 8px; }
.pdp-delivery-row input { flex: 1; min-width: 0; }
.pdp-delivery-result { color: var(--success-ink); font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.pdp-delivery-facts { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.pdp-delivery-facts span { font-size: 12.5px; color: var(--slate); }

.pdp-trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--hairline); max-width: 400px; }
.pdp-trust-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: var(--slate); min-width: 0; }
.pdp-trust-item svg { color: var(--brand); }
.pdp-trust-item span { font-size: 11px; line-height: 1.25; }

/* ---------- PDP tabs ---------- */
.pdp-tabs-section { max-width: 1080px; margin: 8px auto 0; padding: 16px 28px 0; }
/* On mobile the tab row overflows (5 tabs don't fit 375px) with only a bare scrollbar as a
   hint — easy to miss, and the last tabs read as cut off rather than "scroll for more". A
   wrapping element (non-scrolling) hosts edge-fade overlays that don't scroll with the
   tabs themselves; scrollbar-color/width give a visible-but-quiet native affordance too. */
.pdp-tabs-nav-wrap { position: relative; border-bottom: 1px solid var(--hairline); }
.pdp-tabs-nav-wrap::before, .pdp-tabs-nav-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 20px; z-index: 1; pointer-events: none;
}
.pdp-tabs-nav-wrap::before { left: 0; background: linear-gradient(to right, var(--canvas), transparent); }
.pdp-tabs-nav-wrap::after { right: 0; background: linear-gradient(to left, var(--canvas), transparent); }
.pdp-tabs-nav {
  display: flex; gap: 18px; overflow-x: auto;
  scrollbar-width: thin; scrollbar-color: var(--concrete) transparent;
}
.pdp-tabs-nav::-webkit-scrollbar { height: 4px; }
.pdp-tabs-nav::-webkit-scrollbar-thumb { background: var(--concrete); border-radius: 999px; }
.pdp-tab { padding: 12px 4px; background: none; border: none; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--slate); cursor: pointer; white-space: nowrap; }
.pdp-tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.pdp-tab-content { padding: 20px 0 8px; max-width: 760px; }
.pdp-tab-content p { color: var(--slate); font-size: 14.5px; line-height: 1.65; }

/* ---------- PDP "Style It With" / "Complete the Look" / "Recently Viewed" ---------- */
.pdp-style-with, .pdp-complete-look, .pdp-recently-viewed { max-width: 1160px; margin: 28px auto 0; padding: 0 28px; }
.pdp-style-with h2, .pdp-complete-look h2, .pdp-recently-viewed h2 { font-size: 18px; margin-bottom: 14px; font-weight: 700; letter-spacing: var(--track-tight); }
.pdp-style-with-grid, .pdp-recently-viewed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; min-width: 0; }
.pdp-style-with-card, .pdp-recently-viewed-card { color: var(--ink); display: block; }
.pdp-style-with-card img, .pdp-recently-viewed-card img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius-image); border: 1px solid var(--hairline); background: var(--canvas); display: block; }
.pdp-style-with-title, .pdp-recently-viewed-title { font-size: 12.5px; font-weight: 600; margin-top: 8px; line-height: 1.3; }
.pdp-style-with-price { font-size: 12.5px; color: var(--slate); margin-top: 2px; }

.pdp-complete-look-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0;
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 18px;
}
.pdp-complete-look-item { display: flex; flex-direction: column; }
.pdp-complete-look-item img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; display: block; }
.pdp-complete-look-item-title { font-size: 11.5px; margin-top: 6px; max-width: 76px; line-height: 1.25; }
.pdp-complete-look-item-price { font-size: 11.5px; color: var(--slate); margin-top: 2px; }
.pdp-complete-look-plus { font-size: 18px; color: var(--slate); }
.pdp-complete-look-total { margin-left: auto; text-align: right; }
.pdp-complete-look-total-price { font-size: 18px; font-weight: 700; }
.pdp-complete-look-total .btn { margin-top: 8px; }

/* ---------- PDP mobile sticky add-to-cart bar ---------- */
.pdp-mobile-bar { display: none; }

/* ---------- PDP size guide modal ---------- */
.pdp-size-guide-modal { position: fixed; inset: 0; z-index: 70; }
.pdp-size-guide-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.pdp-size-guide-sheet {
  position: relative; z-index: 1; background: var(--card); border-radius: var(--radius-card);
  padding: 24px; max-width: 420px; width: calc(100% - 40px); max-height: 80vh; overflow-y: auto;
  margin: 10vh auto 0;
}
.pdp-size-guide-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pdp-size-guide-head h3 { font-size: 16px; margin: 0; }
.pdp-size-guide-head button { border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--slate); }
.pdp-size-guide-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pdp-size-guide-table th { text-align: left; padding: 8px 4px; color: var(--slate); font-weight: 600; border-bottom: 1px solid var(--hairline); }
.pdp-size-guide-table td { padding: 8px 4px; border-bottom: 1px solid var(--hairline); }
.pdp-size-guide-note { margin-top: 12px; font-size: 11.5px; }

/* ---------- Phase 19: plugin storefront widgets ---------- */
.jh-plugin-whatsapp-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 500;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  transition: transform var(--dur-fast) var(--ease-out);
}
.jh-plugin-whatsapp-bubble:hover { transform: scale(1.08); }
/* Reviewer-reported bug: this fixed bubble sits over whatever content happens to scroll
   into its bottom-right corner (filter buttons, cross-sell cards, the tax note) on every
   page. Rather than chase every page layout, fade it out while the page is actively
   scrolling and back in ~500ms after it settles — it's never in the way of a tap mid-scroll,
   and reappears once the user has stopped to actually look/tap. Keyboard focus always wins. */
.jh-plugin-whatsapp-bubble.jh-plugin-whatsapp-bubble-scrolling {
  opacity: 0; transform: scale(0.7); pointer-events: none;
}
.jh-plugin-whatsapp-bubble:focus { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
@media (prefers-reduced-motion: no-preference) {
  .jh-plugin-whatsapp-bubble { transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
}
@media (max-width: 640px) {
  /* Smaller footprint on small screens so the fixed bubble has less chance of sitting on
     top of a button/line that scrolls into its bottom-right corner (still ≥44px touch target). */
  .jh-plugin-whatsapp-bubble { width: 46px; height: 46px; right: 14px; bottom: 14px; }
  .jh-plugin-whatsapp-bubble svg { width: 22px; height: 22px; }
}

/* ---------- Phase 20: footer block builder ---------- */
.footer-builder-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; text-align: left; max-width: 900px; margin: 0 auto 20px; }
.footer-builder-column h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; color: var(--ink); }
.footer-builder-column a { display: block; font-size: 13px; color: var(--slate); margin-bottom: 6px; }
.footer-builder-column a:hover { color: var(--ink); }
.footer-builder-social { display: flex; justify-content: center; gap: 16px; margin-bottom: 16px; }
.footer-builder-custom { font-size: 13px; color: var(--slate); margin-bottom: 12px; }

.footer-column-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-column-row { display: flex; align-items: flex-start; gap: 10px; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-input); padding: 10px; }
.footer-column-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Phase 22: invoice UPI QR ---------- */
.invoice-upi-qr { text-align: center; margin: 20px 0; padding-top: 16px; border-top: 1px dashed var(--hairline); }
.invoice-upi-qr canvas { border-radius: 8px; }

/* ---------- Phase 22: modern invoice template ---------- */
.invoice-modern .invoice-sheet { border-top: 6px solid var(--brand); }
.invoice-modern .invoice-head h1 { color: var(--brand); }
.invoice-modern .invoice-meta h2 { background: var(--brand); color: #fff; display: inline-block; padding: 4px 14px; border-radius: var(--radius-pill); font-size: 13px; }

/* ---------- Phase 23: SEO health list ---------- */
.seo-health-list { list-style: none; margin: 4px 0 20px; padding: 0; }
.seo-health-list li { padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.product-info h1 { font-size: clamp(26px, 3.5vw, 36px); margin: 10px 0 10px; }
.product-info > p { color: var(--slate); font-size: 14.5px; line-height: 1.55; margin-top: 10px; }
.product-info form { display: flex; flex-direction: column; gap: 14px; max-width: 340px; } /* bundle.ejs's single add-to-cart form */

.breadcrumb { font-size: 12.5px; color: var(--slate); display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb [aria-current] { color: var(--ink); }

.low-stock-note {
  display: inline-block; margin-top: 12px; padding: 5px 12px;
  background: var(--warning-bg); color: var(--warning-ink);
  border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600;
}

.related-products { max-width: 1200px; margin: 8px auto 0; padding: 0 0 24px; }
.related-products h2 { font-size: 20px; margin: 0 28px 4px; }

/* ---------- Inputs ---------- */

select, input, textarea {
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  font-size: 14px;
  font-family: inherit;
  letter-spacing: var(--track-body);
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s ease;
}
select:focus, input:focus, textarea:focus { border-color: var(--ink); }
/* No outline: none here — the global :focus-visible rule above supplies the keyboard
   focus ring; browsers already suppress it on mouse/touch clicks natively. */
input::placeholder, textarea::placeholder { color: var(--slate); }
input[type="color"] { padding: 4px; height: 40px; width: 64px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; }

/* ---------- Content containers ---------- */

.cart, .checkout, .pay { max-width: 960px; margin: 0 auto; padding: 16px 24px 72px; }
.cart-recommend-heading { font-size: 18px; margin: 28px 0 16px; }
.no-results-note { text-align: center; padding: 8px 24px 4px; overflow-wrap: break-word; }
.cart-recommend-grid { padding: 0; max-width: none; margin: 0; }
.pay { text-align: center; }
.pay p { margin-bottom: 20px; color: var(--slate); }

.content-page { max-width: 680px; margin: 0 auto; padding: 8px 24px 64px; }
.content-page p { margin-bottom: 18px; line-height: 1.65; font-size: 15.5px; color: var(--ink); }

.faq-list { max-width: 680px; margin: 0 auto; padding: 8px 24px 64px; }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 400;
  color: var(--slate);
  transition: transform .15s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--brand); }
.faq-item p { padding: 0 4px 18px; line-height: 1.65; font-size: 15px; color: var(--slate); }

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
  font-size: 13.5px;
}
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
  background: var(--canvas);
}
tr:last-child td { border-bottom: none; }
td a { color: var(--brand); }

/* ---------- Cart & checkout ---------- */

.cart-empty { text-align: center; padding: 24px 24px 16px; color: var(--slate); }
.cart-empty .btn { margin-top: 20px; }
.cart-lines { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); overflow: hidden; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.cart-lines .cart-line:last-child { border-bottom: none; }
.cart-line img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--hairline); flex: none; }
.cart-line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-line-info span { font-size: 12.5px; }
.cart-line-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.cart-remove-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--card);
  color: var(--slate); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cart-remove-btn:hover { color: var(--danger-ink); border-color: var(--danger-ink); }
.cart-line-total { font-size: 14.5px; width: 90px; text-align: right; flex: none; }
.qty-form input { width: 64px; padding: 7px 10px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 16px; flex-wrap: wrap; }
.cart-total strong { font-size: 17px; letter-spacing: var(--track-snug); }
.cart-summary-block { text-align: right; }
.cart-summary-block p { font-size: 13px; margin-bottom: 4px; }
.cart-checkout-row { text-align: right; margin-top: 16px; }

.cart-shipping-progress { margin-top: 20px; padding: 14px 16px; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); }
.cart-shipping-progress-msg { font-size: 13px; margin-bottom: 8px; }
.cart-shipping-progress-msg-done { color: var(--brand); font-weight: 600; }
.cart-shipping-progress-bar { background: var(--canvas); border-radius: 999px; height: 6px; overflow: hidden; }
.cart-shipping-progress-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width var(--dur-med) var(--ease-out); }

.coupon-form {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.coupon-form label { font-size: 13px; font-weight: 500; display: flex; flex-direction: column; gap: 8px; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; border-radius: var(--radius-pill); padding-left: 16px; }

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  padding: 28px;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
}
.checkout-form h2 { font-size: 18px; margin-top: 10px; }
.checkout-form h2:first-child { margin-top: 0; }
.checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; }
.checkout-form .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.checkout-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 400 !important; font-size: 14px !important; flex-wrap: wrap; }
.checkout-trust-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--slate); text-align: center; }
/* A radio row with an inline follow-up field (e.g. the gift card's "Custom amount" input)
   otherwise renders at the browser's default input width, pushing the row past the viewport
   on narrow phones — let it shrink/wrap instead. */
.radio input:not([type="radio"]):not([type="checkbox"]) { flex: 1 1 120px; min-width: 0; }
.radio input[type="checkbox"], .radio input[type="radio"] { flex: none; }

.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.checkout-side { display: flex; flex-direction: column; gap: 16px; }
.checkout-side-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 20px; }
.checkout-side-card h2 { font-size: 15px; margin-bottom: 12px; }
.checkout-summary-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 8px; }
.checkout-summary-line:last-child { margin-bottom: 0; }

.summary {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  padding: 16px 20px;
  border-radius: var(--radius-image);
  font-size: 14px;
}
.summary p { margin-bottom: 4px; color: var(--slate); }
.summary strong { font-size: 16px; letter-spacing: var(--track-snug); color: var(--ink); }

/* ---------- Account: wishlist grid ---------- */

.wishlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 16px 0 32px; }
.wishlist-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); overflow: hidden; }
.wishlist-card img { height: 160px; width: 100%; object-fit: cover; background: var(--canvas); }
.wishlist-card-body { padding: 12px 14px; }
.wishlist-card-body h3 { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; color: var(--ink); }
.wishlist-card-row { display: flex; justify-content: space-between; align-items: center; }
.wishlist-card-row strong { font-size: 13px; }

/* ---------- Bundles ---------- */

.bundle-items { list-style: none; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.bundle-items li { font-size: 14px; color: var(--slate); }
.bundle-items a { color: var(--ink); font-weight: 500; }
.bundle-items a:hover { color: var(--brand); }

/* ---------- Reviews ---------- */

.reviews { max-width: 680px; margin: 0 auto; padding: 24px 24px 64px; }
.reviews h2 { font-size: 22px; margin-bottom: 14px; }
.review { border-bottom: 1px solid var(--hairline); padding: 16px 0; display: flex; gap: 12px; }
.review-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--brand); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.review-body { min-width: 0; }
.review strong { font-size: 13.5px; }
.review p { margin-top: 6px; font-size: 14px; color: var(--slate); line-height: 1.5; }
.review-form-toggle { margin-top: 24px; }
.review-form-toggle summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: var(--track-snug);
}
.review-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; max-width: 420px; }
.review-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; }

/* ---------- Search & sort ---------- */

.search-page-form { display: flex; gap: 8px; justify-content: center; margin-top: 14px; max-width: 420px; margin-left: auto; margin-right: auto; }
.search-page-form input { flex: 1; min-width: 0; border-radius: var(--radius-pill); padding-left: 18px; }
.sort-form { margin-top: 10px; }
.sort-form select { border-radius: var(--radius-pill); padding: 7px 14px; font-size: 13px; }

/* ---------- Admin ---------- */

.admin-login {
  max-width: 380px;
  margin: 72px auto;
  background: var(--card);
  padding: 32px;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
}
.admin-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.admin-login-brand img { height: 40px; width: 40px; object-fit: contain; flex: none; }
.admin-login-brand span { font-size: 16px; font-weight: 700; color: var(--brand); letter-spacing: var(--track-tight); }
.admin-login h1 { font-size: 22px; margin-bottom: 4px; }
.admin-login > .muted { font-size: 13px; }
.admin-login form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.admin-login label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; }
.admin-login-back { display: block; text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--slate); }
.admin-login-back:hover { color: var(--ink); }

/* ---------- Admin sidebar shell ---------- */

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 224px;
  background: var(--card);
  border-right: 1px solid var(--hairline);
  overflow-y: auto;
  padding: 20px 0 12px;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.admin-sidebar-brand { padding: 0 20px 18px; }
.admin-sidebar-brand a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.admin-sidebar-brand img { height: 28px; width: 28px; object-fit: contain; flex: none; }
.admin-sidebar-brand span { font-size: 14px; font-weight: 700; color: var(--brand); letter-spacing: var(--track-tight); line-height: 1.2; }
.admin-sidebar-nav { flex: 1; }
.admin-sidebar-group { padding: 0 12px; margin-bottom: 18px; }
.admin-sidebar-label {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  padding: 4px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
}
.admin-sidebar-label:hover { color: var(--ink); background: var(--canvas); }
.admin-sidebar-label svg { flex: none; }
.admin-sidebar-chevron { margin-left: auto; transition: transform 0.15s ease; }
@media (prefers-reduced-motion: reduce) { .admin-sidebar-chevron { transition: none; } }
/* display:contents keeps links behaving as direct children of the group (desktop block
   list AND the mobile horizontal bar) while still letting collapse hide them all. */
.admin-sidebar-links { display: contents; }
.admin-sidebar-group.collapsed .admin-sidebar-links { display: none; }
.admin-sidebar-group.collapsed .admin-sidebar-chevron { transform: rotate(-90deg); }
.admin-sidebar-group.collapsed { margin-bottom: 6px; }
.admin-sidebar-group a {
  display: block;
  padding: 8px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: var(--track-snug);
}
.admin-sidebar-group a:hover { background: var(--canvas); color: var(--ink); }
.admin-sidebar-group a.active { background: var(--brand); color: #fff; }
.admin-sidebar-footer {
  padding: 12px 20px 0;
  border-top: 1px solid var(--hairline);
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-sidebar-footer a, .admin-sidebar-footer button.link {
  font-size: 12.5px;
  color: var(--slate);
  text-decoration: none;
  text-align: left;
  font-family: inherit;
}
.admin-sidebar-footer a:hover, .admin-sidebar-footer button.link:hover { color: var(--ink); }

.admin { margin-left: 224px; max-width: 1120px; padding: 16px 32px 72px; }
.admin h1 { display: flex; align-items: center; gap: 16px; margin: 26px 0 18px; font-size: 28px; flex-wrap: wrap; }
.admin h2 { margin: 32px 0 12px; font-size: 18px; }
.admin > .muted, .admin p.muted { margin-bottom: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 18px;
  font-size: 12px;
  color: var(--slate);
  letter-spacing: var(--track-body);
}
.stat-live { position: relative; border-color: var(--success-ink); }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success-ink); margin-left: 6px; vertical-align: middle;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: live-pulse 1.6s ease-in-out infinite; }
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.stat span {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: var(--track-tight);
  color: var(--ink);
  margin-bottom: 2px;
}

.low-stock-alert {
  background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning-ink) 25%, transparent);
  border-radius: var(--radius-image);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.low-stock-alert a { color: var(--brand); margin-right: 4px; }

.tab-switch { font-size: 12.5px; font-weight: 400; margin-left: 12px; letter-spacing: var(--track-body); }
.tab-switch a { margin-right: 12px; color: var(--slate); }
.tab-switch a.active { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dash-cols table { margin-bottom: 18px; }

/* ---------- Admin dashboard: CSS bar charts (no chart library) ---------- */

.dash-bar-card {
  position: relative; height: 260px; background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--radius-card); padding: 20px 20px 12px; margin-bottom: 20px;
}
.dash-bar-card h2 { font-size: 14px; margin: 0 0 14px; font-weight: 600; }
.dash-bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; }
.dash-bar-col { flex: 1; min-width: 2px; display: flex; align-items: flex-end; height: 100%; }
.dash-bar { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .dash-bar { transition: opacity var(--dur-fast) var(--ease-out); }
}
.dash-bar-col:hover .dash-bar { opacity: 1 !important; }
.dash-bar-range { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10.5px; color: var(--slate); }

.dash-panel { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 20px; }
.dash-panel h2 { font-size: 14px; margin: 0 0 14px; font-weight: 600; }

.dash-segments { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.dash-legend { display: flex; flex-direction: column; gap: 8px; }
.dash-legend-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.dash-legend-row span:first-child { display: flex; align-items: center; gap: 8px; }
.dash-legend-row i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.dash-progress-list { display: flex; flex-direction: column; gap: 12px; }
.dash-progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.dash-progress-track { background: var(--canvas); border-radius: 999px; height: 7px; overflow: hidden; }
.dash-progress-fill { width: 0; height: 100%; border-radius: 999px; background: var(--brand); }
.dash-progress-fill-ink { background: var(--ink); }
.dash-channel-note { margin-top: 12px; }

.dash-split-label { font-size: 11px; margin-bottom: 6px; }
.dash-split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.dash-split-legend { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 16px; }
.dash-split-legend:last-of-type { margin-bottom: 0; }
.dash-stock-warning { text-align: right; color: var(--warning-ink); font-weight: 600; }

.chart-card {
  position: relative;
  height: 260px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 10px;
}
.chart-card-sm { height: 200px; }
.chart-card-xs { height: 120px; }
.chart-table-toggle { margin-bottom: 24px; }
.chart-table-toggle summary { cursor: pointer; color: var(--slate); font-size: 12.5px; font-weight: 500; margin-bottom: 8px; }
.chart-table-toggle summary:hover { color: var(--ink); }
.chart-table-toggle table { margin-top: 8px; }

.product-form, .theme-form, .status-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  margin-bottom: 28px;
  /* A flex container in normal block flow shrink-to-fits its width by default (unlike a
     plain block box, which always fills its parent) — so wide field content can force this
     wider than its column on narrow screens. width:100% makes it behave like a normal block. */
  width: 100%;
}
.product-form label, .theme-form label, .status-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  text-transform: capitalize;
}
.product-form h2, .theme-form h2 { margin: 14px 0 0; font-size: 16px; }
.variant-table input { width: 100%; }
.variant-table { border-radius: var(--radius-image); margin-bottom: 12px; }

.image-preview-row { display: flex; flex-wrap: wrap; gap: 10px; }
.image-preview-item { position: relative; width: 84px; height: 84px; border-radius: var(--radius-image); overflow: hidden; border: 1px solid var(--hairline); background: var(--canvas); }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-preview-main {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(20,20,20,.78); color: #fff;
  font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; padding: 2px 0;
}
.status-form { flex-direction: row; align-items: end; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.order-detail-back { font-size: 12.5px; color: var(--slate); display: inline-block; margin-top: 22px; }
.order-detail-back:hover { color: var(--ink); }
/* display:grid in normal block flow shrink-to-fits by default (like display:flex above) —
   width:100% makes it fill its container instead of growing to fit its widest content. */
.order-detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; width: 100%; }
.order-detail-grid table { margin-bottom: 12px; }
.order-detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.order-detail-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 20px; }
.order-detail-card h2 { font-size: 14px; margin: 0 0 12px; }
.order-detail-card form { display: flex; flex-direction: column; gap: 12px; }
.order-detail-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; }
.order-detail-address-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 18px 20px; font-size: 13.5px; line-height: 1.7; margin-bottom: 24px; }

.order-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.order-filter-tabs a {
  background: var(--card); color: var(--ink); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 7px 16px; font-size: 12.5px; font-weight: 500;
}
.order-filter-tabs a:hover { border-color: var(--ink); color: var(--ink); }
.order-filter-tabs a.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.admin-product-cell { display: flex; align-items: center; gap: 10px; }
.admin-product-cell img { width: 38px; height: 38px; object-fit: cover; border-radius: 7px; border: 1px solid var(--hairline); flex: none; }
.admin-product-cell span, .admin-product-title { font-weight: 600; }
.admin-product-title { color: var(--ink); text-decoration: none; }
.admin-product-title:hover { text-decoration: underline; }

/* List toolbar (search + filters) and bulk-action bar — products list, reusable elsewhere */
.admin-list-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-list-toolbar input[type="search"] { flex: 0 1 260px; min-width: 160px; }
.admin-list-toolbar select { width: auto; }
.admin-list-count { margin-left: auto; font-size: 13px; }
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 10px 14px; margin-bottom: 12px; }
.bulk-bar strong { font-size: 13.5px; }
.check-col { width: 34px; }
.check-col input { display: block; }

/* Switch toggle — instant on/off controls (product visibility etc.) */
.jh-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.jh-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.jh-switch-track { width: 36px; height: 21px; border-radius: 11px; background: var(--concrete); transition: background 0.15s ease; flex: none; pointer-events: none; }
.jh-switch-track::after { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: #fff; margin: 2px; transition: transform 0.15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.jh-switch input:checked + .jh-switch-track { background: var(--success-ink); }
.jh-switch input:checked + .jh-switch-track::after { transform: translateX(15px); }
.jh-switch input:focus-visible + .jh-switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.jh-switch input:disabled + .jh-switch-track { opacity: 0.5; }
@media (prefers-reduced-motion: reduce) { .jh-switch-track, .jh-switch-track::after { transition: none; } }

/* Editor toolbar above a textarea (insert image etc.) + email branding card */
.editor-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; font-weight: 400; }
.editor-toolbar .muted { font-size: 12px; }
.email-branding-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 20px 22px; margin: 14px 0 24px; max-width: 640px; }
.email-branding-card h2 { font-size: 15.5px; margin-bottom: 6px; }
.email-branding-card > .muted { font-size: 13px; margin-bottom: 14px; }

/* Ghost button + danger link — secondary/destructive actions in admin lists */
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--hairline); box-shadow: none; }
.btn.ghost:hover { background: var(--canvas); color: var(--ink); opacity: 1; }
button.link.danger { color: var(--danger-ink); }
.form-actions { display: flex; align-items: center; gap: 16px; }

/* Homepage sections manager — pinned cards, section cards, type-picker cards */
.section-pinned-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 26px; }
.section-pinned-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 16px 18px; text-decoration: none; color: var(--ink); }
.section-pinned-card:hover { border-color: var(--concrete); }
.section-pinned-card strong { font-size: 14.5px; }
.section-pinned-card p { font-size: 12.5px; margin-top: 2px; }
.section-pinned-icon { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--brand); border-radius: 10px; }
.section-pinned-go { margin-left: auto; font-size: 22px; color: var(--slate); }
.section-list-heading { font-size: 15px; margin: 22px 0 10px; }
.section-list-heading .muted { font-size: 12.5px; font-weight: 400; }
.section-card-list { display: flex; flex-direction: column; gap: 10px; }
.section-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 12px 16px; }
.section-card-hidden { opacity: 0.6; }
.section-card-order { display: flex; flex-direction: column; gap: 2px; flex: none; }
.section-move { border: 1px solid var(--hairline); background: var(--card); border-radius: 6px; width: 26px; height: 22px; font-size: 10px; color: var(--slate); cursor: pointer; line-height: 1; }
.section-move:hover:not(:disabled) { color: var(--ink); border-color: var(--concrete); }
.section-move:disabled { opacity: 0.35; cursor: default; }
.section-card-body { flex: 1; min-width: 0; }
.section-card-type { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.section-card-preview { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-card-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.section-empty { padding: 18px 0; }
.section-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.section-add-card { display: block; background: var(--card); border: 1px dashed var(--concrete); border-radius: var(--radius-card); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.section-add-card:hover { border-color: var(--brand); background: var(--accent); }
.section-add-card strong { font-size: 13.5px; }
.section-add-card p { font-size: 12.5px; margin-top: 4px; }
@media (max-width: 720px) {
  .section-card { flex-wrap: wrap; }
  .section-card-actions { width: 100%; justify-content: flex-end; }
}

/* Design-group picker on the product form — click to link instead of typing */
.design-group-picker { display: flex; flex-direction: column; gap: 6px; margin: -6px 0 4px; }
.design-group-picker > p { font-size: 12.5px; }
.design-group-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-input); padding: 8px 12px; cursor: pointer; font-family: inherit; }
.design-group-chip:hover { border-color: var(--concrete); }
.design-group-chip.selected { border-color: var(--brand); background: var(--accent); }
.design-group-chip.selected::after { content: "✓ linked"; font-size: 11.5px; font-weight: 700; color: var(--brand); }
.design-group-chip strong { font-size: 13px; }
.design-group-chip .muted { font-size: 12px; }

.settings-shell { display: flex; gap: 32px; align-items: flex-start; }
.settings-subnav { flex: 0 0 200px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; }
.settings-subnav a { padding: 9px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
.settings-subnav a:hover { background: var(--canvas); }
.settings-subnav a.active { background: var(--brand); color: #fff; }
.settings-content { flex: 1; min-width: 0; max-width: 640px; }
.settings-content h1 { margin: 0 0 4px; font-size: 26px; }

.integration-card { margin-bottom: 20px; }
.integration-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.integration-card-head h3 { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 8px; }
.integration-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.integration-status.on { background: var(--success-bg); color: var(--success-ink); }
.integration-status.off { background: var(--canvas); color: var(--slate); border: 1px solid var(--hairline); }
.integration-status.env { background: var(--warning-bg); color: var(--warning-ink); }
.integration-enable-row { flex-direction: row !important; align-items: center; gap: 8px !important; text-transform: none !important; }
.integration-card-actions { display: flex; align-items: center; gap: 16px; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .site-header { padding: 12px 16px; gap: 12px; }
  .site-header-links { display: none; } /* category quick-links: desktop-only, search + icons take priority */
  .grid { padding: 12px 16px 48px; }
  .hero { padding: 60px 20px 48px; }

  /* Sidebar becomes a horizontally-scrolling top bar — admin is desktop-first but must
     still work on a phone. */
  .admin-sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding: 10px 12px;
  }
  .admin-sidebar-brand { padding: 0 14px 0 0; flex: none; }
  .admin-sidebar-nav { display: flex; flex: none; }
  .admin-sidebar-group { display: flex; align-items: center; gap: 2px; margin-bottom: 0; padding: 0 4px; white-space: nowrap; }
  .admin-sidebar-label { display: none; }
  /* Group headers are hidden on mobile, so a collapsed group must still show its links. */
  .admin-sidebar-group.collapsed .admin-sidebar-links { display: contents; }
  .admin-sidebar-group a { padding: 6px 10px; }
  .admin-sidebar-footer {
    flex-direction: row;
    border-top: none;
    border-left: 1px solid var(--hairline);
    margin-top: 0;
    padding: 0 0 0 14px;
    flex: none;
    white-space: nowrap;
  }
  .admin { margin-left: 0; }
}

/* ---------- Status pill (order status, everywhere it's shown as a list/table value) ---------- */

.status-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.status-pill.status-new { background: var(--accent); color: var(--brand); }
.status-pill.status-packed, .status-pill.status-shipped { background: var(--warning-bg); color: var(--warning-ink); }
.status-pill.status-delivered { background: var(--success-bg); color: var(--success-ink); }
.status-pill.status-cancelled { background: var(--danger-bg); color: var(--danger-ink); }

.order-info-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 960px; margin: 0 auto 24px; padding: 0 24px; }
.order-info-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 20px; }
.order-info-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate); margin-bottom: 8px; }
.order-info-card p { font-size: 13.5px; line-height: 1.6; margin-bottom: 10px; }
.order-continue-shopping { text-align: center; margin: 24px 0 56px; }

/* ---------- Order status tracker ---------- */

.order-stepper { display: flex; justify-content: space-between; max-width: 960px; margin: 0 auto 36px; padding: 0 24px; position: relative; }
.order-stepper::before { content: ""; position: absolute; top: 15px; left: 12%; right: 12%; height: 2px; background: var(--hairline); z-index: 0; }
.order-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.order-step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--card); color: var(--slate);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 2px solid var(--hairline);
}
.order-step.done .order-step-dot { background: var(--brand); color: #fff; border-color: var(--brand); }
.order-step-label { font-size: 11.5px; color: var(--slate); text-align: center; }
.order-step.current .order-step-label, .order-step.done .order-step-label { color: var(--ink); font-weight: 600; }

.order-status-cancelled { text-align: center; margin: 0 auto 28px; }
.order-status-icon-circle {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.order-status-icon-circle.cancelled { background: var(--danger-bg); color: var(--danger-ink); }

/* ---------- GST Invoice ---------- */

.invoice { max-width: 860px; margin: 0 auto; padding: 24px 24px 72px; }
.invoice-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.invoice-sheet { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 32px; }
.invoice-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--hairline); margin-bottom: 20px; }
.invoice-head h1 { font-size: 20px; margin-bottom: 4px; }
.invoice-head p { font-size: 13px; color: var(--slate); margin: 2px 0; }
.invoice-meta { text-align: right; }
.invoice-meta h2 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.invoice-meta p { font-size: 13px; margin: 2px 0; }
.invoice-parties { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.invoice-parties p { font-size: 13.5px; margin: 2px 0; }
.invoice-table { margin-bottom: 20px; font-variant-numeric: tabular-nums; }
.invoice-table td:not(:first-child), .invoice-table th:not(:first-child) { text-align: right; }
.invoice-table tfoot td { font-weight: 600; background: var(--canvas); border-top: 1px solid var(--hairline); border-bottom: none; }
.invoice-summary { text-align: right; margin-bottom: 20px; font-variant-numeric: tabular-nums; }
.invoice-summary p { font-size: 14px; margin: 4px 0; }
.invoice-grand { font-size: 17px; font-weight: 700; margin-top: 8px !important; }
.invoice-footnote { text-align: center; }

/* ---------- Phase 12+: saved addresses ---------- */
.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 16px 0 24px; }
.address-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 16px; }
.address-card p { margin: 0 0 6px; font-size: 13.5px; }
.address-card-actions { display: flex; gap: 12px; margin-top: 10px; }

/* ---------- Phase 18: admin product-image drag reorder ---------- */
.image-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.image-list-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-input); padding: 8px 10px; cursor: grab; }
.image-list-row:active { cursor: grabbing; }
.image-drag-handle { color: var(--slate); font-size: 16px; line-height: 1; user-select: none; }
.image-list-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--canvas); flex-shrink: 0; }
.image-list-url { flex: 1; min-width: 0; }

/* ---------- Media library ---------- */
.media-dropzone {
  border: 2px dashed var(--hairline); border-radius: var(--radius-card);
  padding: 28px; text-align: center; margin: 16px 0; transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.media-dropzone.dragover { border-color: var(--brand); background: var(--canvas); }
.media-dropzone p { margin: 4px 0; font-size: 13.5px; color: var(--slate); }
.media-dropzone label { color: var(--brand); cursor: pointer; font-weight: 600; }
.media-tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.media-tabs button {
  border: 1px solid var(--hairline); background: var(--card); border-radius: var(--radius-pill);
  padding: 6px 16px; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--slate);
}
.media-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); overflow: hidden; padding-bottom: 10px; }
.media-card-thumb { aspect-ratio: 1/1; background: var(--canvas); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-card-icon { font-size: 32px; color: var(--slate); }
.media-card-name { font-size: 12px; font-weight: 500; padding: 8px 10px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card-meta { font-size: 11px; color: var(--slate); padding: 0 10px 8px; }
.media-card-actions { display: flex; justify-content: space-between; padding: 0 10px; gap: 8px; }

/* Multi-select mode (jhOpenMediaPicker({ multiple: true })) — clickable card + checkmark */
.media-card-pickable { cursor: pointer; }
.media-card-pickable .media-card-thumb { position: relative; }
.media-card-check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: 2px solid var(--hairline);
}
.media-card-selected { outline: 2px solid var(--brand); outline-offset: -2px; }
.media-card-selected .media-card-check {
  background: var(--brand); border-color: var(--brand);
}
.media-card-selected .media-card-check::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.media-picker-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline);
}
.media-picker-footer span { font-size: 13px; color: var(--slate); }

/* margin:auto restores native <dialog> centering — the global `* { margin: 0 }` reset removes it */
.media-picker-modal { border: none; border-radius: var(--radius-card); padding: 20px; width: min(720px, 92vw); max-height: 82vh; box-shadow: 0 20px 60px rgba(0,0,0,.25); margin: auto; }
.media-picker-modal::backdrop { background: rgba(0,0,0,.45); }
.media-picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.media-picker-modal .media-grid { max-height: 46vh; overflow-y: auto; padding: 4px 2px; }

.media-field-row { display: flex; gap: 8px; align-items: center; }
.media-field-row input { flex: 1; min-width: 0; }
.media-field-preview { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--canvas); border: 1px solid var(--hairline); flex-shrink: 0; }

@media print {
  .site-header, .announce, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .invoice { padding: 0; max-width: none; }
  .invoice-sheet { border: none; padding: 0; }
}

@media (max-width: 720px) {
  /* Logo + account/cart icons share row 1; search drops to its own full-width row 2 —
     at this width there isn't room for all three inline. */
  .site-header { flex-wrap: wrap; row-gap: 10px; }
  .site-header-icons { flex-shrink: 0; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; }
  /* 16px on every text input/select/textarea — anything smaller triggers iOS Safari's
     auto-zoom-on-focus across every form in the app, not just the header search. */
  select, input, textarea { font-size: 16px; }
  .hero-carousel { height: min(60vh, 420px); }
  .hero-slide-content { padding: 0 24px; }
  /* Amazon/Flipkart-style 2-up grid on phones — the desktop auto-fill(240px) track only
     ever fits 1 column under ~500px, which wastes half the screen and means a lot of
     scrolling once there are more than a couple of products. */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 12px 14px 48px; }
  .card img { height: 44vw; max-height: 200px; }
  .card-body { padding: 10px 12px 14px; }
  .card-body h3 { font-size: 13px; margin: 4px 0 5px; }
  .card-body strong { font-size: 13px; }
  .card-compare-price { font-size: 11px; }
  .card-badge { font-size: 10px; padding: 4px 8px; top: 8px; left: 8px; }
  .product-page { grid-template-columns: minmax(0, 1fr); padding: 28px 20px 12px; gap: 28px; }
  #pdp-gallery.product-image { grid-template-columns: minmax(0, 1fr); position: static; top: auto; }
  .pdp-thumbs-rail { display: none; }
  .pdp-gallery { grid-column: 1; }
  .pdp-dots { grid-column: 1; grid-row: 2; display: flex; }
  .pdp-tabs-section { padding: 16px 20px 0; }
  .pdp-style-with, .pdp-complete-look, .pdp-recently-viewed { padding: 0 20px; }
  /* Sticky add-to-cart/buy-now bar replaces the inline actions on mobile — leave room for
     it at the bottom of the page so the last section isn't hidden behind it. */
  .pdp-actions, .pdp-wishlist-link { display: none; }
  body:has(.pdp-mobile-bar) { padding-bottom: 84px; }
  .pdp-mobile-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--card); border-top: 1px solid var(--hairline);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 10px; align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  }
  .pdp-mobile-wishlist-btn {
    width: 44px; height: 44px; flex: none; border-radius: 50%;
    border: 1px solid var(--hairline); background: var(--card);
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
  }
  .pdp-mobile-wishlist-btn.active { color: var(--brand); }
  .pdp-mobile-bar .btn { flex: 1; min-height: 44px; }
  /* The floating WhatsApp widget (Phase 19, admin-toggleable) sits at bottom:20px site-wide —
     on the PDP the sticky cart bar now occupies that same bottom-right corner, so push the
     bubble up above it here rather than letting two fixed elements overlap. */
  body:has(.pdp-mobile-bar) .jh-plugin-whatsapp-bubble { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .checkout-form .row, .checkout-form .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .checkout-grid { grid-template-columns: minmax(0, 1fr); }
  .order-info-cols { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .order-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .status-form { flex-direction: column; align-items: stretch; }
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  /* align-items:flex-start (desktop default) keeps the sticky subnav's height natural in
     row layout; stacked to a column here, it also stops .settings-content stretching to
     the full width and shrink-to-fits its content instead, overflowing the viewport. */
  .settings-shell { flex-direction: column; align-items: stretch; }
  .settings-subnav { flex-direction: row; flex-wrap: wrap; position: static; width: 100%; }
  .cart, .checkout, .pay, .admin { padding: 12px 16px 56px; }
  .admin h1 { font-size: 23px; }
  table { display: block; overflow-x: auto; }
  .invoice { padding: 12px 16px 56px; }
  .invoice-sheet { padding: 20px; }
  .invoice-head, .invoice-parties { flex-direction: column; gap: 16px; }
  .invoice-meta { text-align: left; }
}

/* ---------- MCP connectors ---------- */
.inline-form { display: flex; gap: 10px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.inline-form input[type="text"] { flex: 1; min-width: 220px; }
.mcp-token-box {
  border: 1px solid var(--brand); background: var(--card); border-radius: var(--radius-card);
  padding: 16px 18px; margin: 16px 0;
}
.mcp-token-value {
  display: block; margin: 8px 0; padding: 10px 12px; font-size: 13px; word-break: break-all;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--radius-input);
}

/* ---------- Business calendar ---------- */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--hairline); border: 1px solid var(--hairline); border-radius: var(--radius-card);
  overflow: hidden; margin-top: 16px;
}
.calendar-dow {
  background: var(--canvas); padding: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  color: var(--slate); text-align: center;
}
.calendar-day {
  background: var(--card); min-height: 90px; padding: 6px; display: flex; flex-direction: column; gap: 3px;
}
.calendar-day-outside { background: var(--canvas); opacity: 0.5; }
.calendar-day-today { box-shadow: inset 0 0 0 2px var(--brand); }
.calendar-day-number { font-size: 12px; font-weight: 600; color: var(--slate); }
.calendar-event {
  display: block; font-size: 10.5px; color: #fff; padding: 2px 6px; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
}
@media (max-width: 700px) {
  .calendar-day { min-height: 60px; font-size: 11px; }
  .calendar-dow { font-size: 9px; }
}

/* Shop page filter sidebar (category + price + search) — desktop sidebar, mobile <details>
   disclosure, no client-side JS required: every filter is a plain GET form. */
.shop-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--space-6);
  align-items: start;
}
/* Grid items default to min-width:auto, so without this the nested product grid's
   auto-fill track sizing (below) forces .shop-results to its max-content width — several
   240px columns wide — which blows out .shop-layout past the viewport on mobile. */
.shop-filters, .shop-results { min-width: 0; }
.shop-filters-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}
.shop-filters-panel summary {
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-1) 0;
}
.filter-form { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-3); }
.filter-group { display: flex; flex-direction: column; gap: var(--space-2); }
.filter-label { font-size: 13px; font-weight: 600; color: var(--slate); }
.filter-form input[type="search"],
.filter-form input[type="number"],
.filter-form select {
  min-height: var(--tap-min);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  padding: var(--space-2) var(--space-3);
  font-size: 16px;
}
.filter-price-row { display: flex; align-items: center; gap: var(--space-2); }
.filter-price-row input { min-width: 0; flex: 1; }
.filter-categories { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.filter-clear { text-align: center; font-size: 13px; color: var(--slate); }
.filter-clear:hover { color: var(--ink); }

@media (max-width: 768px) {
  .shop-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- AI Copilot drawer (every admin page; src/public/copilot.js) ---------- */
.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; }
.copilot-fab { position: fixed; right: 18px; bottom: 18px; z-index: 950; width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.24); }
.copilot-fab:hover { background: #333; }
.copilot-fab.drawer-open { display: none; }
.copilot-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 960; width: min(430px, 100vw); background: var(--card); border-left: 1px solid var(--hairline); box-shadow: -14px 0 36px rgba(0,0,0,0.14); display: flex; flex-direction: column; transform: translateX(105%); visibility: hidden; transition: transform 0.25s ease, visibility 0.25s; }
.copilot-drawer.open { transform: translateX(0); visibility: visible; }
@media (prefers-reduced-motion: reduce) { .copilot-drawer { transition: none; } }
.copilot-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--hairline); flex: none; }
.copilot-drawer-head-actions { display: flex; align-items: center; gap: 14px; }
.copilot-drawer-close { border: none; background: none; font-size: 24px; line-height: 1; color: var(--slate); cursor: pointer; padding: 2px 8px; }
.copilot-drawer-close:hover { color: var(--ink); }
.copilot-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.copilot-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55; overflow-wrap: break-word; }
.copilot-msg p { margin-bottom: 6px; }
.copilot-msg p:last-child { margin-bottom: 0; }
.copilot-msg-assistant, .copilot-msg-typing { background: var(--canvas); align-self: flex-start; border-bottom-left-radius: 4px; }
.copilot-msg-user { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.copilot-msg-system { background: none; color: var(--slate); font-size: 12.5px; align-self: center; padding: 2px 8px; }
.copilot-msg-error { background: var(--danger-bg); color: var(--danger-ink); align-self: flex-start; }
.copilot-msg-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.copilot-msg-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }
.copilot-typing-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--concrete); margin-right: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .copilot-typing-dot { animation: copilot-blink 1.2s ease-in-out infinite; }
  .copilot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .copilot-typing-dot:nth-child(3) { animation-delay: 0.4s; }
}
@keyframes copilot-blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.copilot-actions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 85%; }
.copilot-action-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--success-bg); color: var(--success-ink); font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: var(--radius-pill); }
.copilot-action-error { background: var(--danger-bg); color: var(--danger-ink); }
.copilot-action-link { font-weight: 700; text-decoration: underline; color: inherit; }
.copilot-attachments { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px 0; border-top: 1px solid var(--hairline); }
.copilot-attach-chip { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--hairline); }
.copilot-attach-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.copilot-attach-chip button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.copilot-input-row { display: flex; align-items: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--hairline); }
.copilot-attach-btn { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--hairline); border-radius: var(--radius-input); cursor: pointer; color: var(--slate); background: var(--card); }
.copilot-attach-btn:hover { color: var(--ink); border-color: var(--concrete); }
.copilot-input-row textarea { flex: 1; min-height: 42px; max-height: 140px; resize: vertical; border: 1px solid var(--hairline); border-radius: var(--radius-input); padding: 10px 12px; font-size: 16px; font-family: inherit; }
.copilot-hint { padding: 6px 18px 10px; font-size: 12px; flex: none; }
@media (max-width: 860px) {
  .copilot-msg { max-width: 92%; }
  .copilot-fab { right: 14px; bottom: 14px; }
}
