/* ============================================================
   Space Camp — design system
   ============================================================ */

:root {
  --purple: #f5c518;
  --purple-bright: #ffe566;
  --purple-dim: rgba(245, 197, 24, 0.22);
  --bg: #000000;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --text: #f8f6f0;
  --muted: rgba(255, 255, 255, 0.58);
  --line: rgba(245, 197, 24, 0.15);
  --ok: #34d399;
  --err: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --shell: 1120px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  --glow: 0 0 24px rgba(245, 197, 24, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 78% 32%, rgba(245, 197, 24, 0.4), transparent),
    radial-gradient(1px 1px at 44% 72%, rgba(255, 255, 255, 0.35), transparent);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

button { font: inherit; cursor: pointer; }

input, textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--purple); }

/* Layout */
.page { min-height: 100vh; padding-top: calc(var(--nav-h) + var(--space-4)); }
.shell { width: min(var(--shell), 100% - var(--space-4) * 2); margin-inline: auto; }
.shell-sm { width: min(440px, 100% - var(--space-4) * 2); margin-inline: auto; }

.eyebrow {
  color: var(--purple-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #8a7010, var(--purple-bright));
  color: #fff;
  box-shadow: var(--glow);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.error { color: var(--err); font-size: 13px; margin-top: var(--space-2); min-height: 18px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Nav */
.nav {
  position: fixed;
  top: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: min(var(--shell), calc(100% - var(--space-4)));
  height: var(--nav-h);
  padding: 0 var(--space-4);
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  background: rgba(10, 8, 16, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: 0.02em; }
.brand span { color: var(--purple-bright); }
.brand.brand-img {
  display: flex;
  align-items: center;
  line-height: 0;
}
.brand.brand-img img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 0 10px rgba(245, 197, 24, 0.35));
}
.nav-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.tier-pill {
  display: none;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple-bright);
  background: var(--purple-dim);
  border: 1px solid rgba(245, 197, 24, 0.35);
}

/* Gate */
.gate {
  min-height: calc(100vh - var(--nav-h) - var(--space-6));
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.gate-card {
  padding: var(--space-5);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
  text-align: center;
}
.gate-card h1 {
  margin: var(--space-2) 0;
  font-size: clamp(28px, 6vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.gate-card p { color: var(--muted); margin: 0 0 var(--space-4); }
.gate-form {
  display: grid;
  gap: var(--space-2);
  max-width: 320px;
  margin-inline: auto;
}

/* Hero (compact) */
.hero {
  padding-block: var(--space-4) var(--space-5);
}
.hero-copy { max-width: 640px; }
.hero h1 {
  margin: var(--space-2) 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.hero-copy > p { color: var(--muted); margin: 0; font-size: 16px; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }

/* Menu */
.menu-block { padding-bottom: var(--space-6); }
.menu-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.menu-heading { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.menu-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.type-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.type-tab.active {
  background: var(--purple-dim);
  border-color: rgba(245, 197, 24, 0.55);
  color: #fff;
}

.menu-section + .menu-section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}
.section-head { margin-bottom: var(--space-4); }
.section-head h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.price-line { margin-top: 6px; color: var(--purple-bright); font-size: 13px; font-weight: 700; }

.drop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.drop-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.drop-card:hover {
  border-color: rgba(245, 197, 24, 0.5);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}
.drop-image-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #0a0810;
}
.drop-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.strain-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}
.strain-badge.indica { background: rgba(37, 99, 235, 0.45); }
.strain-badge.sativa { background: rgba(22, 163, 74, 0.45); }
.strain-badge.hybrid { background: rgba(245, 197, 24, 0.45); }
.strain-badge.vape { background: rgba(236, 72, 153, 0.4); }
.strain-badge.rosin { background: rgba(234, 179, 8, 0.35); }
.strain-badge.extract { background: rgba(14, 165, 233, 0.4); }

.drop-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  margin-top: auto;
}

.drop-card-bottom > div:first-child {
  flex: 1;
  min-width: 0;
}
.drop-card-bottom h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.drop-card-bottom p { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.drop-card.is-sold-out {
  opacity: 0.72;
  pointer-events: auto;
}
.drop-card.is-sold-out .drop-image-wrap img {
  filter: grayscale(0.85) brightness(0.65);
}
.drop-card.is-sold-out .drop-card-bottom p {
  color: #f87171;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.sold-out-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  padding: 10px 18px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid #f87171;
  color: #fecaca;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  pointer-events: none;
}
.add-circle.sold-out-btn {
  display: grid;
  place-items: center;
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.detail-stock-line {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--purple-bright, #c084fc);
}
.detail-stock-line.is-sold-out {
  color: #f87171;
}
.detail-add:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.add-circle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: #fff;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  flex-shrink: 0;
  align-self: center;
  box-sizing: border-box;
}
.add-circle:hover { background: var(--purple-dim); border-color: var(--purple); }

.order-empty {
  grid-column: 1 / -1;
  padding: var(--space-5);
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

/* Footer */
.site-footer { padding-bottom: var(--space-6); }
.feature-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.feature-box {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}
.feature-box strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.feature-box span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple);
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}
.overlay[hidden] { display: none !important; }
.overlay-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.overlay-drawer { display: flex; justify-content: flex-end; }

.modal-sheet {
  width: min(480px, 100%);
  max-height: calc(100vh - var(--space-4) * 2);
  overflow: auto;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: #0e0c14;
  padding: var(--space-4);
  box-shadow: var(--shadow);
}
.modal-lg { width: min(960px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; }

.access-modal-panel {
  width: min(420px, 100%);
  max-height: none;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: #0e0c14;
  padding: var(--space-4);
  box-shadow: var(--shadow);
}

.order-drawer {
  width: min(420px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: var(--space-4);
  background: #0e0c14;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.order-head span {
  display: block;
  color: var(--purple-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.order-head h2 { margin: 6px 0 0; font-size: 28px; letter-spacing: -0.03em; line-height: 1; }

.order-items { display: grid; gap: var(--space-2); max-height: 280px; overflow-y: auto; margin-bottom: var(--space-3); }
.order-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}
.order-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.order-item strong { font-size: 13px; line-height: 1.25; }
.order-item span { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.order-price { text-align: right; }
.order-price b { font-size: 14px; }
.order-price button {
  display: block;
  margin-top: 4px;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  padding: 0;
}
.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  border-radius: var(--radius);
  background: var(--purple-dim);
  border: 1px solid rgba(245, 197, 24, 0.3);
}
.order-total span { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.order-total strong { font-size: 24px; }
.order-form { display: grid; gap: var(--space-2); }
.order-form-hint {
  margin: -4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.order-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.order-toggle button {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.order-toggle button.active {
  background: var(--purple-dim);
  border-color: rgba(245, 197, 24, 0.55);
  color: #fff;
}

.order-fulfillment-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* Product detail (in modal) */
.detail-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
.detail-main-image {
  border-radius: var(--radius);
  min-height: 280px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
}
.detail-main-image img {
  width: min(100%, 360px);
  max-height: 360px;
  object-fit: contain;
}
.detail-panel {
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.detail-panel h1 {
  margin: var(--space-2) 0 var(--space-3);
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.detail-description { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.detail-group { margin-top: var(--space-4); }
.detail-group > label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--space-2);
}
.size-card {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  min-height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: #fff;
}
.size-card small { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.size-card b { display: block; margin-top: 4px; font-size: 20px; }
.size-card.active {
  background: var(--purple-dim);
  border-color: rgba(245, 197, 24, 0.65);
}

.selected-price-sub {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.qty-slider-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qty-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--purple-main);
}

.qty-val {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

.qty-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-row button {
  width: auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.pill-row button.active {
  background: var(--purple-dim);
  border-color: rgba(245, 197, 24, 0.55);
  color: #fff;
}
.detail-actions { margin-top: var(--space-4); }

/* Success */
.success-panel {
  width: min(400px, 100%);
  padding: var(--space-5);
  text-align: center;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: #0e0c14;
  box-shadow: var(--shadow);
}
.success-icon {
  width: 72px;
  height: 72px;
  margin-inline: auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, #8a7010, var(--purple-bright));
}
.success-panel > span {
  display: block;
  margin-top: var(--space-3);
  color: var(--purple-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.success-panel h3 { margin: var(--space-2) 0; font-size: 28px; letter-spacing: -0.03em; }
.success-panel p { color: var(--muted); margin: 0 0 var(--space-4); font-size: 14px; }

/* Admin */
.admin-page {
  background: #08060e;
  min-height: 100vh;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 6, 14, 0.92);
  backdrop-filter: blur(12px);
}
.admin-header-brand { display: flex; align-items: center; gap: var(--space-2); }
.admin-header-actions { display: flex; align-items: center; gap: var(--space-2); }
.admin-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--purple-bright);
  background: var(--purple-dim);
  border: 1px solid rgba(245, 197, 24, 0.35);
}

.admin-main-wrap { min-height: calc(100vh - 56px); }

/* Only one view at a time: login OR editor (never stacked) */
.admin-page:not(.admin-unlocked) .admin-shell { display: none !important; }
.admin-page:not(.admin-unlocked) #lockAdminBtn { display: none !important; }
.admin-page.admin-unlocked .admin-login { display: none !important; }

/* Login — full screen when locked */
.admin-login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
  padding: var(--space-5) var(--space-4);
}
.admin-login-card {
  width: min(400px, 100%);
  padding: var(--space-5);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.admin-login-logo {
  display: block;
  width: min(260px, 78%);
  height: auto;
  margin: 0 auto var(--space-4);
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 0 16px rgba(245, 197, 24, 0.3));
}
.admin-login-card h1 {
  margin: var(--space-2) 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.admin-login-card > p { color: var(--muted); margin: 0 0 var(--space-4); font-size: 14px; }
.admin-login-form { display: grid; gap: var(--space-3); }

/* Shell layout */
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
  padding-bottom: 72px;
}
.admin-sidebar {
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
  padding: var(--space-4) var(--space-3);
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}
.admin-sidebar-label {
  margin: 0 0 var(--space-2);
  padding: 0 var(--space-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-link:hover { background: var(--surface); color: var(--text); }
.admin-nav-link.is-active {
  background: var(--purple-dim);
  color: var(--purple-bright);
  font-weight: 700;
}

.admin-content {
  padding: var(--space-4);
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.admin-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  scroll-margin-top: 72px;
}
.admin-card-muted { background: rgba(255, 255, 255, 0.02); }
.admin-card-head { margin-bottom: var(--space-4); }
.admin-card-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.admin-card-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.admin-card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  gap: var(--space-3);
}
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field textarea { resize: vertical; min-height: 72px; }
.field-action { display: flex; flex-direction: column; justify-content: flex-end; }
.field-check { justify-content: flex-end; }
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.check-label input { width: auto; accent-color: var(--purple); }

.admin-rows { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.admin-row-fields { flex: 1; min-width: 0; }
.admin-empty {
  margin: 0;
  padding: var(--space-4);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.admin-add-box {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.admin-add-title {
  margin: 0 0 var(--space-3);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple-bright);
}
.admin-add-box .btn { margin-top: var(--space-3); }

/* Vendor filter (admin) */
.admin-filter-label {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-bright);
}
.admin-vendor-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.admin-vendor-tab {
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.admin-vendor-tab:hover {
  color: var(--text);
  border-color: rgba(245, 197, 24, 0.45);
}
.admin-vendor-tab.is-active {
  color: #000;
  background: var(--purple);
  border-color: var(--purple-bright);
  box-shadow: var(--glow);
}
.admin-row-meta {
  flex: 1 1 100%;
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px 4px;
  margin-top: -6px;
}

/* Per-section pricing editor (access codes) */
.form-grid-5 { grid-template-columns: repeat(5, 1fr); }
.cp-mode-tag {
  display: inline-flex;
  align-items: center;
  height: 38px;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-bright);
}
.cp-section-prices {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  margin-top: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.cp-hint { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.cp-section-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.cp-section-row:first-of-type { border-top: none; }
.cp-section-head { display: flex; flex-direction: column; gap: 2px; }
.cp-section-head strong { font-size: 14px; color: var(--text); }
.cp-section-head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cp-section-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}
.cp-price-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cp-price-input > span {
  font-weight: 700;
  color: var(--muted);
}
.cp-price-input > input { flex: 1; min-width: 0; }

@media (max-width: 720px) {
  .form-grid-5 { grid-template-columns: 1fr; }
  .cp-section-row { grid-template-columns: 1fr; gap: 8px; }
}

/* Product list */
.prod-list { display: flex; flex-direction: column; gap: var(--space-2); }
.prod-list-item {
  display: grid;
  grid-template-columns: minmax(118px, auto) 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.22));
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.prod-list-item:hover {
  border-color: rgba(245, 197, 24, 0.22);
}
.prod-list-item.is-inactive {
  opacity: 0.72;
  border-color: rgba(255, 255, 255, 0.07);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.28));
}
.prod-list-item.is-inactive .prod-list-meta strong {
  color: var(--muted);
}
.prod-list-item:not(.is-inactive) {
  border-color: rgba(245, 197, 24, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Active switch */
.prod-active-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.prod-active-switch:hover {
  border-color: rgba(245, 197, 24, 0.4);
  background: rgba(0, 0, 0, 0.6);
}
.prod-active-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.prod-active-track {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.prod-active-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #d4d4d4 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.prod-active-label {
  min-width: 44px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1;
  transition: color 0.2s;
}
.prod-active-input:checked + .prod-active-track {
  background: linear-gradient(135deg, #8a7010, var(--purple));
  border-color: rgba(255, 229, 102, 0.55);
  box-shadow: 0 0 16px rgba(245, 197, 24, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.prod-active-input:checked + .prod-active-track .prod-active-knob {
  transform: translateX(20px);
}
.prod-active-input:checked ~ .prod-active-label {
  color: var(--purple-bright);
}
.prod-active-input:focus-visible + .prod-active-track {
  outline: 2px solid var(--purple-bright);
  outline-offset: 2px;
}
.prod-list-item:not(.is-inactive) .prod-active-switch {
  border-color: rgba(245, 197, 24, 0.28);
  background: rgba(245, 197, 24, 0.07);
}

.prod-list-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #0a0a0a;
}
.prod-list-item img.is-broken { opacity: 0.3; }
.prod-list-meta { flex: 1; min-width: 0; }
.prod-list-meta strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-list-meta span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.admin-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.invoice-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.invoice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.invoice-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.invoice-row-main strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.invoice-row-date {
  font-size: 12px;
  color: var(--muted);
}

.invoice-row-meta {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.invoice-row-meta strong {
  color: #fff;
  font-size: 14px;
}

.invoice-row-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  gap: 8px;
}

.invoice-detail-modal {
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.invoice-detail-body {
  overflow-y: auto;
  padding: 0 var(--space-4) var(--space-3);
  flex: 1;
}

.invoice-detail-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.invoice-detail-dl div {
  margin: 0;
}

.invoice-detail-dl dt {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.invoice-detail-dl dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: var(--space-3);
}

.invoice-items-table th,
.invoice-items-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.invoice-items-table th {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.invoice-items-table .num {
  text-align: right;
  white-space: nowrap;
}

.invoice-items-table tfoot td {
  border-bottom: none;
  padding-top: 12px;
}

.invoice-summary-pre {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--muted);
  max-height: 200px;
  overflow-y: auto;
}

/* Invoice editor (add/remove products, live preview) */
#phoneLineModal { z-index: 120; }

.invoice-edit-modal {
  width: min(900px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.invoice-edit-body {
  overflow-y: auto;
  padding: 0 var(--space-4) var(--space-3);
  flex: 1;
}
.invoice-edit-cols {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-4);
  align-items: start;
}
.invoice-edit-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.invoice-edit-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.invoice-edit-qty-val {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.invoice-edit-preview {
  position: sticky;
  top: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}
.invoice-edit-preview-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.invoice-edit-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--space-2);
}
.invoice-edit-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
}
.invoice-edit-totals strong { color: #fff; font-size: 15px; }
.invoice-edit-delta {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.invoice-edit-delta strong.is-up { color: #fca5a5; }
.invoice-edit-delta strong.is-down { color: #86efac; }

@media (max-width: 720px) {
  .invoice-edit-cols { grid-template-columns: 1fr; }
  .invoice-edit-preview { position: static; }
}

.invoice-source-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.invoice-source-badge.phone {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
}
.invoice-source-badge.online {
  color: var(--purple-bright, #c084fc);
  border-color: rgba(192, 132, 252, 0.35);
  background: rgba(168, 85, 247, 0.12);
}

/* Phone order builder (admin) */
.phone-order-builder {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.phone-order-step {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.phone-order-step-title {
  margin: 0 0 var(--space-3);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.phone-order-lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.phone-order-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.phone-order-line-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.phone-order-line-main strong {
  font-size: 14px;
}
.phone-order-line-qty,
.phone-order-line-badge {
  font-size: 12px;
  color: var(--muted);
}
.phone-order-line-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.phone-order-line-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.phone-order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.phone-order-total-row strong {
  font-size: 22px;
  color: #fff;
}
.phone-line-modal {
  width: min(520px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
}
.phone-line-modal-body {
  padding: 0 var(--space-4) var(--space-3);
}
.phone-pricing-fieldset {
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.phone-pricing-fieldset legend {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 4px;
}
.phone-pricing-note {
  margin: 4px 0 var(--space-2) 24px;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: var(--space-2) 0 0;
  cursor: pointer;
}
.phone-tier-wrap,
.phone-custom-wrap {
  margin: var(--space-2) 0 var(--space-2) 24px;
}
.phone-unit-price-line {
  margin: var(--space-2) 0 0;
  font-size: 13px;
}
.phone-unit-price-line .muted {
  color: var(--muted);
  font-weight: 400;
}
.phone-line-preview {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: rgba(168, 85, 247, 0.12);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .invoice-row {
    grid-template-columns: 1fr;
  }
  .invoice-row-actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-end;
  }
  .phone-order-line-side {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.prod-list-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Product editor modal */
.product-editor-modal {
  width: min(960px, 100%);
  max-height: calc(100vh - var(--space-4) * 2);
  overflow-y: auto;
}
.product-editor-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: var(--space-4);
  align-items: start;
}
.product-editor-preview-col {
  position: sticky;
  top: 0;
}
.preview-card {
  pointer-events: none;
  max-width: 240px;
  margin-inline: auto;
}
.preview-card .drop-image-wrap { aspect-ratio: 4 / 5; }
.preview-note { margin: var(--space-3) 0 0; text-align: center; font-size: 12px; }

.image-dropzone {
  position: relative;
  border: 2px dashed rgba(245, 197, 24, 0.45);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  cursor: pointer;
  background: rgba(245, 197, 24, 0.06);
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: var(--space-3);
  min-height: 120px;
  display: grid;
  place-items: center;
}
.image-dropzone:hover,
.image-dropzone.is-dragover {
  border-color: var(--purple-bright);
  background: rgba(245, 197, 24, 0.14);
}
.image-dropzone.has-image { padding: var(--space-2); }
.dropzone-inner { pointer-events: none; }
.dropzone-icon {
  font-size: 28px;
  margin-bottom: var(--space-2);
  color: var(--purple-bright);
}
.dropzone-inner p { margin: 0; font-size: 13px; color: var(--text); }
.dropzone-hint { margin-top: 6px !important; font-size: 11px !important; color: var(--muted) !important; }
.dropzone-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.image-dropzone.has-image .dropzone-inner { display: none; }

.media-dropzone {
  position: relative;
  min-height: 120px;
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 2px dashed var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: var(--space-3);
}

.media-dropzone:hover,
.media-dropzone.is-dragover {
  border-color: rgba(245, 197, 24, 0.55);
  background: rgba(245, 197, 24, 0.06);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.media-grid-empty {
  margin: 0;
  padding: var(--space-3);
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}

.media-card {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.media-card.is-cover {
  border-color: rgba(245, 197, 24, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.25);
}

.media-card-thumb {
  aspect-ratio: 4 / 5;
  background: #000;
}

.media-card-thumb img,
.media-card-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card-badge {
  display: block;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.media-card-actions {
  display: flex;
  gap: 4px;
  padding: 0 6px 8px;
  flex-wrap: wrap;
}

.media-card-actions .btn {
  min-width: 0;
  padding: 4px 8px;
  font-size: 11px;
}

.media-url-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-2);
  align-items: center;
}

.media-storage-note {
  margin-top: var(--space-2);
}

.detail-media-thumbs {
  display: flex;
  gap: 10px;
  margin-top: var(--space-3);
  overflow-x: auto;
  padding-bottom: 4px;
}

.detail-media-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.detail-media-thumb.active {
  border-color: rgba(245, 197, 24, 0.75);
  box-shadow: 0 0 16px rgba(245, 197, 24, 0.25);
}

.detail-media-thumb img,
.detail-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.detail-media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.detail-main-image video {
  width: 100%;
  max-height: min(70vh, 520px);
  border-radius: 16px;
  background: #000;
  object-fit: contain;
}
/* Product modal — pricing & inventory panel */
.field-units-pricing > label {
  display: none;
}

.units-pricing-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.units-pricing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 197, 24, 0.04);
}

.units-pricing-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 0 0 4px;
}

.units-pricing-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 28rem;
}

.units-pricing-badge {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple-bright);
  background: var(--purple-dim);
  border: 1px solid rgba(245, 197, 24, 0.35);
}

.product-units-stack {
  display: block;
}

.product-units-stack .units-pricing-thead,
.product-units-stack .product-unit-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.15fr) minmax(110px, 1fr) minmax(100px, 0.85fr);
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-2) var(--space-4);
}

.product-units-stack .units-pricing-thead {
  align-items: center;
  padding-top: var(--space-3);
  padding-bottom: var(--space-2);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--line);
}

.product-units-stack .units-pricing-thead span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-units-stack .product-unit-row {
  border-bottom: 1px solid rgba(245, 197, 24, 0.08);
}

.product-units-stack .product-unit-row:last-child {
  border-bottom: none;
  padding-bottom: var(--space-3);
}

.product-units-stack .units-unit-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  padding-bottom: 10px;
}

.product-units-stack .units-field-label {
  display: none;
}

.product-units-stack .units-input-wrap {
  position: relative;
  width: 100%;
}

.product-units-stack .units-input-wrap input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.product-units-stack .units-input-wrap input:focus {
  border-color: var(--purple);
  background: rgba(0, 0, 0, 0.5);
}

.product-units-stack .units-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.product-units-stack .units-input-money input {
  padding-left: 1.65rem;
}

.product-units-stack .units-input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}

/* Per-flavor stock inputs */
.product-units-stack.is-per-flavor .units-pricing-thead,
.product-units-stack.is-per-flavor .product-unit-row {
  align-items: start;
}

.product-units-stack.is-per-flavor .units-field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 641px) {
  .product-units-stack.is-per-flavor .units-pricing-thead .units-col-stock,
  .product-units-stack.is-per-flavor .units-col-stock .units-field-label {
    /* thead already labels the column on desktop; avoid double label */
  }
}

.units-flavor-stock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.units-flavor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(78px, 110px);
  gap: 8px;
  align-items: center;
}

.units-flavor-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.units-flavor-row .units-input-wrap input {
  padding: 8px 10px;
  font-size: 13px;
}

/* Sold-out flavor pickers (storefront + phone builder) */
.option-card.is-sold-out,
.option-chip.is-sold-out {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: line-through;
}

@media (max-width: 640px) {
  .units-pricing-header {
    flex-direction: column;
    align-items: stretch;
  }

  .units-pricing-badge {
    align-self: flex-start;
  }

  .product-units-stack .units-pricing-thead {
    display: none;
  }

  .product-units-stack .product-unit-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "unit unit"
      "price stock";
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .product-units-stack .units-col-unit {
    grid-area: unit;
  }

  .product-units-stack .units-col-price {
    grid-area: price;
  }

  .product-units-stack .units-col-stock {
    grid-area: stock;
  }

  .product-units-stack .units-unit-name {
    padding-bottom: 0;
    margin-bottom: var(--space-1);
  }

  .product-units-stack .units-field-label {
    display: block;
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

.product-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.admin-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.admin-steps strong { color: var(--text); }
.admin-steps code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

/* Sticky save bar */
.admin-savebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-top: 1px solid var(--line);
  background: rgba(8, 6, 14, 0.95);
  backdrop-filter: blur(12px);
  padding: var(--space-3) var(--space-4);
}
.admin-savebar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
}
@media (min-width: 901px) {
  .admin-savebar-inner {
    margin-left: 220px;
    max-width: 920px;
    padding-right: var(--space-4);
  }
}
.admin-savebar-note {
  flex: 1;
  min-width: 180px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.admin-savebar-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.admin-toast {
  font-size: 13px;
  font-weight: 700;
  color: var(--ok);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.admin-toast[hidden] { display: none; }

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.28); }

.note code {
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

/* Responsive */
@media (max-width: 900px) {
  .detail-shell { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr 1fr; }
  .menu-toolbar { flex-direction: column; align-items: stretch; }
  .type-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }

  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: var(--space-3);
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }
  .admin-nav-link { white-space: nowrap; font-size: 12px; padding: 8px 12px; }
  .admin-sidebar-label { display: none; }
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .admin-row { flex-direction: column; }
  .admin-row .btn { align-self: flex-end; }
  .product-editor-layout { grid-template-columns: 1fr; }
  .product-editor-preview-col { position: static; }
  .preview-card { max-width: 220px; }
  .prod-list-item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .prod-active-switch { grid-column: 1; grid-row: 1; justify-self: start; }
  .prod-list-actions { grid-column: 2; grid-row: 1; }
  .prod-list-item img { grid-column: 1; grid-row: 2; width: 48px; height: 48px; }
  .prod-list-meta { grid-column: 2; grid-row: 2; }
}
@media (max-width: 600px) {
  :root { --nav-h: 56px; }
  .nav { padding: 0 var(--space-3); }
  .tier-pill { display: none !important; }
  .brand { font-size: 15px; }
  .feature-row { grid-template-columns: 1fr; }
  .footer-bar { flex-direction: column; align-items: flex-start; }
  .drop-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .order-drawer, .modal-lg { width: 100%; border-radius: 0; }
  .overlay-drawer .order-drawer { border-left: none; }
}
