/* ==========================================================================
   Kate Kay's Toys — app.css
   Single site stylesheet. Colours are only used through the variables in
   :root; re-theme by editing :root and :root[data-theme="dark"].
   Palette lifted from the logo: candy pink / orange / yellow / green / blue /
   purple / teal on a cream page, glossy bubble type (Fredoka, vendored).
   ========================================================================== */

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../vendor/fredoka/1.0/fredoka-latin.9591efe1be62.woff2") format("woff2");
}

:root {
  /* candy palette */
  --pink: #f2508c;   --pink-deep: #d63a75;   --pink-soft: #ffe1ec;
  --orange: #f7931e; --orange-soft: #ffe9cf;
  --yellow: #ffd43b; --yellow-soft: #fff5c7;
  --green: #62c33a;  --green-soft: #e3f6d9;  --green-text: #2f7a16;
  --blue: #3fa9f5;   --blue-soft: #dcf0ff;   --blue-text: #1b6fb0;
  --purple: #a05bd3; --purple-soft: #efe0fb; --purple-text: #6d34a0;
  --teal: #2ec4b6;   --teal-soft: #d8f7f3;   --teal-text: #167a70;

  --accent: var(--pink);
  --accent-hover: var(--pink-deep);
  --accent-soft: var(--pink-soft);
  --accent-banner: #fff0f5;
  --accent-banner-border: #ffd0e0;
  --green-bg: var(--green-soft);
  --red: #d7263d;
  --red-bg: #ffe0e4;
  --amber-text: #8a5a00;
  --amber-bg: var(--yellow-soft);
  --gray-bg: #f1ecf3;
  --gray-text: #6d6478;

  --page-bg: #fff8f0;
  --surface: #ffffff;
  --surface-alt: #fff4ea;
  --border: #f0dfe6;
  --text: #2b2340;
  --muted: #7a6f8a;
  --heading: #1e1533;
  --on-accent: #ffffff;

  --sidebar-w: 240px;
  --topbar-h: 64px;
  --tabbar-h: 62px;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 2px 6px rgba(120, 60, 100, .08), 0 8px 24px rgba(120, 60, 100, .08);
  --shadow-pop: 0 10px 30px rgba(242, 80, 140, .22);
  --display: "Fredoka", "Segoe UI", Roboto, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --pink-soft: #4a1f33; --orange-soft: #4a3418; --yellow-soft: #4a4118;
  --green-soft: #1f3d18; --green-text: #9fe37f;
  --blue-soft: #163350;  --blue-text: #8fd0ff;
  --purple-soft: #35204d; --purple-text: #d9b3ff;
  --teal-soft: #143d39;  --teal-text: #7fe8dc;
  --accent-banner: #33203a;
  --accent-banner-border: #55305a;
  --red-bg: #4a1d25;
  --amber-text: #f0c96a;
  --amber-bg: #4a3a12;
  --gray-bg: #322a48;
  --gray-text: #b9b0c8;

  --page-bg: #1b1430;
  --surface: #261d40;
  --surface-alt: #2f2450;
  --border: #3d3160;
  --text: #f1ecf7;
  --muted: #b3a8c6;
  --heading: #ffffff;
  --shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-pop: 0 10px 30px rgba(242, 80, 140, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background: var(--page-bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--heading); margin: 0; line-height: 1.15; letter-spacing: .01em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
.inline-form { display: inline; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.price { font-family: var(--display); font-weight: 700; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- App frame ---------------------------------------------------------- */
.app-frame { min-height: 100%; display: flex; flex-direction: column; }
.app-shell { flex: 1; display: flex; }
.main { flex: 1; min-width: 0; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }
.page-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-sub { color: var(--muted); margin: 4px 0 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: 0 0 2px -4px; padding: 0 4px;
  color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 14px; text-decoration: none; border-radius: var(--radius-sm);
}
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { color: var(--accent); }
.back-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Topbar ------------------------------------------------------------- */
.announce {
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple));
  color: #fff; text-align: center; font-family: var(--display); font-weight: 600; font-size: 14px;
  padding: 7px 14px; text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.announce a { text-decoration: underline; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 46px; width: auto; border-radius: 12px; }
.brand-text { display: none; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--heading); }
.topnav { display: none; gap: 4px; margin-left: 8px; }
.topnav-item { padding: 8px 12px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--muted); }
.topnav-item:hover, .topnav-item.active { background: var(--accent-soft); color: var(--accent-hover); }
.topbar-search { display: none; flex: 1; max-width: 420px; margin-left: auto; }
.topbar-search input { width: 100%; }
.topbar-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid transparent;
  background: transparent; color: var(--heading); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--surface-alt); border-color: var(--border); }
.icon-btn svg { width: 24px; height: 24px; }
.cart-badge {
  position: absolute; top: 3px; right: 3px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-family: var(--display); font-weight: 700; font-size: 12px; line-height: 20px; text-align: center;
}
.user-card { display: none; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--purple-soft); color: var(--purple-text); display: grid; place-items: center; font-family: var(--display); font-weight: 700; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.1; cursor: pointer;
  background: var(--surface-alt); color: var(--heading); transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap; text-align: center;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%); color: var(--on-accent); box-shadow: var(--shadow-pop); }
.btn-primary:hover { background: var(--pink-deep); }
.btn-secondary { background: var(--surface); border-color: var(--heading); }
.btn-ghost { background: transparent; color: var(--accent-hover); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* ---- Cards -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; overflow-wrap: anywhere; }
.checkout-layout > *, .stack > *, .grid-2 > * { min-width: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-alt); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.stat { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-alt); }
.stat strong { display: block; font-family: var(--display); font-size: 26px; color: var(--heading); }
.stat span { color: var(--muted); font-size: 13px; }

/* ---- Home hero ---------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 26px 20px 30px; text-align: center;
  background:
    radial-gradient(circle at 12% 18%, var(--pink-soft) 0, transparent 34%),
    radial-gradient(circle at 88% 12%, var(--blue-soft) 0, transparent 32%),
    radial-gradient(circle at 80% 90%, var(--yellow-soft) 0, transparent 34%),
    radial-gradient(circle at 15% 85%, var(--purple-soft) 0, transparent 34%),
    var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hero img { width: min(560px, 92%); margin: 0 auto 14px; border-radius: 22px; box-shadow: var(--shadow-pop); }
.hero h1 { font-size: 26px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 520px; margin: 8px auto 16px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- Deal banners ------------------------------------------------------- */
.deal-strip { display: grid; gap: 12px; margin: 18px 0; }
.deal {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 16px; border-radius: var(--radius);
  color: #fff; font-family: var(--display); box-shadow: var(--shadow);
}
.deal > div:first-of-type { flex: 1; min-width: 180px; }
.deal-bundle { background: linear-gradient(120deg, var(--purple), var(--blue)); }
.deal-flash { background: linear-gradient(120deg, var(--orange), var(--pink)); }
.deal strong { font-size: 20px; font-weight: 700; display: block; }
.deal span { opacity: .95; font-size: 14px; }
.deal svg { width: 34px; height: 34px; flex: none; }
.countdown { margin-left: auto; display: flex; gap: 6px; }
@media (max-width: 559px) { .countdown { flex-basis: 100%; margin-left: 0; justify-content: flex-end; } }
.countdown b { display: grid; place-items: center; min-width: 46px; padding: 6px 4px; border-radius: 10px; background: rgba(255,255,255,.22); font-size: 20px; line-height: 1; }
.countdown b small { font-size: 10px; font-weight: 400; opacity: .9; }

/* ---- Chips / filters ---------------------------------------------------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px;
  border-radius: 999px; background: var(--surface); border: 2px solid var(--border);
  font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--heading); cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--heading); color: var(--surface); border-color: var(--heading); }
.chip .x { font-weight: 700; opacity: .7; }
.chip-pink.active { background: var(--pink); border-color: var(--pink); color: #fff; }
.chip-purple.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.chip-teal.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip-orange.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip-green.active { background: var(--green); border-color: var(--green); color: #fff; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.filter-bar .count { color: var(--muted); font-size: 14px; }
.filter-bar select { min-height: 40px; }
details.filters { margin-bottom: 12px; }
details.filters summary { cursor: pointer; font-family: var(--display); font-weight: 600; padding: 8px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.filters summary::-webkit-details-marker { display: none; }
details.filters summary svg { width: 20px; height: 20px; }
.facets { display: grid; gap: 14px; grid-template-columns: 1fr; padding: 10px 0; }
.facet h4 { margin-bottom: 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.facet .chips { flex-wrap: wrap; overflow: visible; padding: 0; }

/* ---- Product grid & cards ----------------------------------------------- */
.shelf { margin: 26px 0; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.shelf-head a { color: var(--accent-hover); font-family: var(--display); font-weight: 600; }
.product-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.product-card {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--heading); box-shadow: var(--shadow-pop); }
.product-card.soldout { opacity: .7; }
.product-media { position: relative; aspect-ratio: 1; background: var(--surface-alt); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.product-media .placeholder svg { width: 40%; height: 40%; opacity: .5; }
.badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.product-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-name { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--heading); line-height: 1.25; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 6px; }
.price-row .price { font-size: 18px; color: var(--heading); }
.price-row .was { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.price-row .sale .price, .price.sale { color: var(--pink-deep); }
.stock-note { font-size: 12px; color: var(--orange); font-weight: 600; }
.stock-note.out { color: var(--red); }
.product-card .add-form { position: absolute; right: 8px; bottom: 8px; }
.product-card .add-form .btn { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; }

/* ---- Badges ------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-family: var(--display); font-weight: 600; font-size: 12px; line-height: 1.3; white-space: nowrap;
  background: var(--gray-bg); color: var(--gray-text);
}
.badge-sale { background: var(--pink); color: #fff; }
.badge-flash { background: var(--orange); color: #fff; }
.badge-glow { background: var(--purple-soft); color: var(--purple-text); }
.badge-scented { background: var(--teal-soft); color: var(--teal-text); }
.badge-light { background: var(--yellow-soft); color: var(--amber-text); }
.badge-mystery { background: linear-gradient(120deg, var(--purple), var(--pink)); color: #fff; }
.badge-bundle { background: var(--blue-soft); color: var(--blue-text); }
.badge-green, .badge-paid, .badge-live { background: var(--green-soft); color: var(--green-text); }
.badge-amber, .badge-pending, .badge-draft, .badge-ready_for_pickup { background: var(--amber-bg); color: var(--amber-text); }
.badge-red, .badge-cancelled, .badge-refunded { background: var(--red-bg); color: var(--red); }
.badge-blue, .badge-shipped, .badge-picked_up { background: var(--blue-soft); color: var(--blue-text); }
.badge-archived { background: var(--gray-bg); color: var(--gray-text); }
.badge-pickup { background: var(--teal-soft); color: var(--teal-text); }

/* ---- Product page ------------------------------------------------------- */
.product-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
.gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { flex: 0 0 100%; margin: 0; scroll-snap-align: start; aspect-ratio: 1; background: var(--surface-alt); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.gallery-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.product-info h1 { font-size: 26px; }
.product-info .price-row .price { font-size: 30px; }
.product-info .price-row .was { font-size: 16px; }
.product-info .badges { position: static; flex-direction: row; flex-wrap: wrap; margin: 10px 0; }
.spec-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: 14px; }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 600; }
.description { white-space: pre-line; }
.option-group { border: 0; padding: 0; margin: 14px 0 0; }
.option-group legend { padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.option-group .chips { flex-wrap: wrap; overflow: visible; padding: 0; }
.option-chip { position: relative; }
.option-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-chip:has(input:checked) { background: var(--heading); color: var(--surface); border-color: var(--heading); }
.option-chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.option-chip:has(input:disabled) { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.option-chip .swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid var(--border); }
.buy-box { display: flex; gap: 10px; align-items: center; margin: 16px 0; }
.qty-stepper { display: inline-flex; align-items: center; border: 2px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty-stepper button { width: 42px; height: 42px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--heading); font-family: var(--display); }
.qty-stepper input { width: 44px; height: 42px; border: 0; text-align: center; font-family: var(--display); font-weight: 700; font-size: 16px; background: transparent; color: var(--heading); -moz-appearance: textfield; }
.qty-stepper input::-webkit-inner-spin-button { display: none; }
.sticky-bar {
  position: sticky; bottom: 0; z-index: 30; margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pickup-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--teal-text); background: var(--teal-soft); padding: 8px 12px; border-radius: var(--radius-sm); }
.pickup-note svg { width: 18px; height: 18px; flex: none; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---- Cart / checkout ---------------------------------------------------- */
.cart-line { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img, .cart-line .thumb { width: 76px; height: 76px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-alt); }
.cart-line .name { font-family: var(--display); font-weight: 600; color: var(--heading); }
.cart-line .controls { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.cart-line .line-total { font-family: var(--display); font-weight: 700; margin-left: auto; }
.savings { color: var(--green-text); font-size: 13px; font-weight: 600; }
.totals { display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { border-top: 2px solid var(--border); padding-top: 8px; margin-top: 4px; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--heading); }
.nudge { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--blue-text); font-size: 14px; font-weight: 600; }
.nudge.unlock { background: var(--purple-soft); color: var(--purple-text); }
.promo-form { display: flex; gap: 8px; }
.promo-form input { flex: 1; text-transform: uppercase; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.segmented label {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; cursor: pointer; text-align: center;
  border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); font-family: var(--display); font-weight: 600;
}
.segmented label svg { width: 30px; height: 30px; }
.segmented label small { font-family: var(--body); font-weight: 400; color: var(--muted); font-size: 12px; }
.segmented input { position: absolute; opacity: 0; }
.segmented input:checked + label, .segmented label:has(input:checked) { border-color: var(--pink); background: var(--pink-soft); color: var(--pink-deep); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--blue); }
.checkout-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
.order-status { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--green-soft); color: var(--green-text); font-family: var(--display); font-weight: 600; font-size: 17px; }
.order-status svg { width: 28px; height: 28px; flex: none; }

/* ---- Data table --------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---- Row lists (manager) ------------------------------------------------ */
.row-list { display: grid; }
.row-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); color: inherit; }
.row-item:last-child { border-bottom: 0; }
.row-item img, .row-item .thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-alt); }
.row-item .thumb { display: grid; place-items: center; color: var(--muted); }
.row-item .thumb svg { width: 26px; height: 26px; }
.row-item .title { font-family: var(--display); font-weight: 600; color: var(--heading); }
.row-item .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-item .right { text-align: right; font-family: var(--display); font-weight: 700; }
.row-item .right small { display: block; font-family: var(--body); font-weight: 400; color: var(--muted); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabs a { flex: none; padding: 8px 14px; border-radius: 999px; font-family: var(--display); font-weight: 600; color: var(--muted); background: var(--surface); border: 2px solid var(--border); }
.tabs a.active { background: var(--heading); color: var(--surface); border-color: var(--heading); }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.image-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.image-grid figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.image-grid img { width: 100%; height: 100%; object-fit: cover; }
.image-grid .tools { position: absolute; bottom: 4px; left: 4px; right: 4px; display: flex; justify-content: space-between; }
.image-grid .tools button { min-height: 32px; padding: 2px 10px; font-size: 12px; }
.image-grid .first { position: absolute; top: 4px; left: 4px; }
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 110px; padding: 14px;
  border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-hover);
  font-family: var(--display); font-weight: 600; cursor: pointer; text-align: center;
}
.upload-zone svg { width: 32px; height: 32px; }
.upload-zone input { display: none; }
.upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
@media (max-width: 340px) { .upload-row { grid-template-columns: 1fr; } }
.preview-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.preview-strip figure { margin: 0; position: relative; }
.preview-strip img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.preview-strip button { position: absolute; top: -6px; right: -6px; min-height: 28px; min-width: 28px; padding: 0; border-radius: 999px; font-size: 12px; }

/* ---- Forms -------------------------------------------------------------- */
input, select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 2px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; /* 16px stops iOS zoom */
}
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--pink); }
input[type="file"] { padding: 8px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .field .field-label { font-family: var(--display); font-weight: 600; color: var(--heading); font-size: 14px; }
.readonly-value { margin: 0; min-height: 44px; padding: 9px 12px; border: 2px dashed var(--border); border-radius: 12px;
  background: var(--surface-alt); color: var(--text); font-size: 16px; font-weight: 600; }
.field small, .field .helptext { color: var(--muted); font-size: 12px; }
.field .errorlist { margin: 0; padding: 0; list-style: none; color: var(--red); font-size: 13px; font-weight: 600; }
.field.check { flex-direction: row; align-items: center; gap: 10px; }
.field.check label { font-weight: 500; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.field ul li label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.field.full { grid-column: 1 / -1; }
.field .with-new { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
legend { font-family: var(--display); font-weight: 600; padding: 0 6px; color: var(--heading); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.form-actions .btn { flex: 1; }
.errorlist.nonfield { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: var(--radius-sm); list-style: none; margin: 0 0 12px; }
.toggle-row { display: flex; gap: 14px; flex-wrap: wrap; }
.toggle-row label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 2px solid var(--border); border-radius: 999px; font-family: var(--display); font-weight: 600; cursor: pointer; }
.toggle-row label:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); color: var(--purple-text); }

/* ---- Messages ----------------------------------------------------------- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.msg { padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; background: var(--gray-bg); color: var(--gray-text); }
.msg.success { background: var(--green-soft); color: var(--green-text); }
.msg.warning { background: var(--amber-bg); color: var(--amber-text); }
.msg.error { background: var(--red-bg); color: var(--red); }
.msg.info { background: var(--blue-soft); color: var(--blue-text); }

/* ---- Details list & empty state ----------------------------------------- */
.details { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.details .badge { white-space: normal; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { width: 56px; height: 56px; margin: 0 auto 10px; opacity: .5; }
.empty h3 { margin-bottom: 6px; }

/* ---- Footer ------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 13px; }
.footer .social { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.footer .social a { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--heading); }
.footer .social svg { width: 20px; height: 20px; }

/* ---- Manager bottom tab bar (phone) ------------------------------------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: var(--display); font-weight: 600; font-size: 10.5px; line-height: 1.1; text-align: center; color: var(--muted); }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--accent-hover); }
.tabbar a .pill { position: absolute; margin-left: 28px; margin-top: -26px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 11px; line-height: 18px; }
body.has-tabbar .main { padding-bottom: calc(var(--tabbar-h) + 30px); }
body.has-tabbar .sticky-bar { bottom: var(--tabbar-h); }

/* ---- Standalone (login) ------------------------------------------------- */
.standalone { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.standalone .card { width: 100%; max-width: 400px; }
.standalone .brand { justify-content: center; margin-bottom: 14px; }
.standalone .brand img { height: 64px; }

/* ---- Responsive --------------------------------------------------------- */
@media (min-width: 560px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .facets { grid-template-columns: 1fr 1fr; }
  .image-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 821px) {
  .main { padding: 26px 24px 48px; }
  .brand-text { display: block; }
  .topnav, .topbar-search { display: flex; }
  .user-card { display: flex; }
  .tabbar { display: none; }
  body.has-tabbar .main { padding-bottom: 48px; }
  body.has-tabbar .sticky-bar { bottom: 0; }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .product-layout { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .checkout-layout { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .hero { padding: 40px 30px 44px; }
  .hero h1 { font-size: 34px; }
  .sticky-bar { position: static; margin: 16px 0 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
  .facets { grid-template-columns: repeat(4, 1fr); }
  h1 { font-size: 34px; }
}
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }

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

/* ---- product form: stock grid ---- */
.variant-grid { display: grid; gap: 10px; }
.variant-row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.variant-row.has-error { border-color: var(--red); }
.variant-row .cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.variant-row .cell.sku, .variant-row .row-errors { grid-column: 1 / -1; }
.variant-row .cell-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.variant-row .with-new { grid-template-columns: 1fr; gap: 4px; }
.variant-row .qty input { max-width: 110px; }
.variant-row .remove { justify-content: flex-end; }
.variant-row .remove label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.variant-row .row-errors { color: var(--red); font-size: 13px; }
.variant-head { display: none; }
@media (min-width: 821px) {
  .variant-row { grid-template-columns: 110px repeat(3, minmax(0, 1fr)) 90px 90px; align-items: start; background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 6px 0; }
  .variant-row .cell.sku { grid-column: auto; padding-top: 10px; }
  .variant-row .cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .variant-head { display: grid; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
}
