/* === Lighting Up With Pipsqueak === */

:root {
  --pink-50:  #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-300: #f9a8d4;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;

  --purple-300: #c4b5fd;
  --purple-500: #8b5cf6;
  --purple-700: #6d28d9;
  --purple-800: #5b21b6;
  --purple-900: #3b0764;

  --bg:         #fff7fc;
  --surface:    #ffffff;
  --surface-2:  #fdf4ff;
  --ink:        #2a0a3d;
  --ink-soft:   #5b3a76;
  --line:       #f4d4ec;
  --shadow:     0 6px 24px rgba(91, 33, 182, 0.10);
  --shadow-lg:  0 18px 48px rgba(91, 33, 182, 0.18);
  --radius:     16px;
  --radius-sm:  10px;

  /* Semantic colors that change between themes */
  --heading:    var(--purple-900);
  --soft-tint:  var(--pink-100);
  --soft-tint-text: var(--purple-800);
  --navbar-bg:  rgba(255, 247, 252, 0.85);
  --hero-glow-a: rgba(236, 72, 153, 0.10);
  --hero-glow-b: rgba(139, 92, 246, 0.10);
  --footer-fade: rgba(139, 92, 246, 0.08);
  --modal-bg:   rgba(43, 11, 62, 0.55);
  --pdp-art-bg: linear-gradient(135deg, var(--pink-200), var(--purple-300));

  --tier-bronze-bg: #fef3c7; --tier-bronze-fg: #92400e;
  --tier-silver-bg: #e2e8f0; --tier-silver-fg: #475569;
  --tier-gold-bg:   #fde68a; --tier-gold-fg:   #92400e; --tier-gold-ring: #f59e0b;

  --status-success-bg: #dcfce7; --status-success-fg: #166534;
  --status-error-bg:   #fee2e2; --status-error-fg:   #991b1b;

  --google-btn-bg: #ffffff;
  --google-btn-fg: #1f1f1f;

  --font: 'Quicksand', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;

  color-scheme: light;
}

/* ============================ DARK THEME ============================ */
[data-theme="dark"] {
  --bg:         #120524;
  --surface:    #1e0e36;
  --surface-2:  #281244;
  --ink:        #f3e6f7;
  --ink-soft:   #b89ec8;
  --line:       #3a1f5c;
  --shadow:     0 6px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg:  0 18px 48px rgba(0, 0, 0, 0.65);

  --heading:    #fcebf6;
  --soft-tint:  rgba(236, 72, 153, 0.16);
  --soft-tint-text: var(--pink-200);
  --navbar-bg:  rgba(18, 5, 36, 0.85);
  --hero-glow-a: rgba(236, 72, 153, 0.18);
  --hero-glow-b: rgba(139, 92, 246, 0.20);
  --footer-fade: rgba(0, 0, 0, 0.35);
  --modal-bg:   rgba(8, 2, 18, 0.78);
  --pdp-art-bg: linear-gradient(135deg, #4a1d6e, #2c134c);

  --tier-bronze-bg: rgba(217, 119, 6, 0.20); --tier-bronze-fg: #fcd34d;
  --tier-silver-bg: rgba(148, 163, 184, 0.18); --tier-silver-fg: #e2e8f0;
  --tier-gold-bg:   rgba(245, 158, 11, 0.22); --tier-gold-fg:   #fde68a; --tier-gold-ring: #f59e0b;

  --status-success-bg: rgba(22, 163, 74, 0.18); --status-success-fg: #86efac;
  --status-error-bg:   rgba(220, 38, 38, 0.20); --status-error-fg:   #fca5a5;

  --google-btn-bg: #ffffff;
  --google-btn-fg: #1f1f1f;

  color-scheme: dark;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--hero-glow-a), transparent 60%),
    radial-gradient(1000px 500px at 110% 5%, var(--hero-glow-b), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--purple-700); text-decoration: none; }
a:hover { color: var(--pink-600); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--heading);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { color: var(--ink-soft); line-height: 1.65; margin: 0 0 1em; }

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

/* === Layout helpers === */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }

main { flex: 1; }

/* === Navbar === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--heading);
  font-size: 1.05rem;
}

.brand img { height: 40px; width: 40px; border-radius: 10px; object-fit: cover; }
.brand-text { line-height: 1.05; }
.brand-text small { display: block; font-family: var(--font); font-weight: 500; color: var(--pink-500); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover { background: var(--soft-tint); color: var(--pink-400); }
.nav-links a.active { background: var(--pink-500); color: #fff; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-700));
  color: #fff !important;
  padding: 10px 18px !important;
  border-radius: 999px;
  font-weight: 700 !important;
  box-shadow: var(--shadow);
}

.nav-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--purple-800);
}

.nav-toggle:hover { background: var(--soft-tint); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    padding: 12px 24px 18px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink-500), var(--purple-700));
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); color: #fff; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-outline {
  background: transparent;
  color: var(--purple-800);
  border: 2px solid var(--purple-700);
}

.btn-outline:hover { background: var(--purple-700); color: #fff; }

.btn-ghost {
  background: var(--soft-tint);
  color: var(--soft-tint-text);
}

.btn-ghost:hover { background: var(--soft-tint); filter: brightness(0.96); }

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover { background: #dc2626; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* === Hero === */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 100px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--soft-tint);
  color: var(--soft-tint-text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 18px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--pink-500), var(--purple-700));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  font-size: 1.15rem;
  margin: 18px 0 28px;
  max-width: 520px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-art {
  position: relative;
  aspect-ratio: 1;
  border-radius: 32px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 60%),
    var(--pdp-art-bg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-art img { width: 70%; height: auto; filter: drop-shadow(0 10px 30px rgba(91, 33, 182, 0.25)); }

.hero-art::before,
.hero-art::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  filter: blur(20px);
}
.hero-art::before { width: 180px; height: 180px; top: -40px; right: -40px; }
.hero-art::after  { width: 140px; height: 140px; bottom: -30px; left: -30px; }

@media (max-width: 860px) {
  .hero { padding: 48px 0 60px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-art { max-width: 360px; margin: 0 auto; }
}

/* === Cards / Sections === */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature {
  text-align: left;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink-200), var(--purple-300));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.feature-icon img { width: 30px; height: 30px; filter: brightness(0) invert(1); }

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}

.section-head .eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--pink-500);
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

/* === Product grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.product-thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--pdp-art-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-thumb .placeholder-icon { width: 40%; opacity: 0.55; filter: brightness(0) invert(1); }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--purple-800);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.product-body {
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--heading);
  margin: 0;
}

.product-desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}

.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 10px;
}

.product-price { font-weight: 800; color: var(--pink-600); font-size: 1.15rem; }
.product-size {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* === Forms === */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--purple-800);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--pink-500);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.15);
}

.textarea { min-height: 120px; resize: vertical; }

/* === Toast / status === */
.status-msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin: 10px 0;
}

.status-msg.success { background: var(--status-success-bg); color: var(--status-success-fg); }
.status-msg.error   { background: var(--status-error-bg);   color: var(--status-error-fg); }
.status-msg.info    { background: var(--soft-tint); color: var(--soft-tint-text); }

/* === Footer === */
.footer {
  margin-top: 60px;
  padding: 36px 0 28px;
  background: linear-gradient(180deg, transparent, var(--footer-fade));
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
  text-align: left;
  margin-bottom: 28px;
}

.footer h4 {
  font-family: var(--font);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--pink-600);
}

.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 6px; }
.footer a { color: var(--ink-soft); font-size: 0.92rem; }
.footer a:hover { color: var(--purple-700); }
.footer-bottom { font-size: 0.85rem; color: var(--ink-soft); }

/* === Decorative weed icon === */
.deco-leaf {
  position: absolute;
  opacity: 0.12;
  pointer-events: none;
  filter: invert(28%) sepia(67%) saturate(2418%) hue-rotate(257deg) brightness(83%) contrast(102%);
}

.deco-leaf.tl { top: 40px; left: -40px; width: 180px; transform: rotate(-22deg); }
.deco-leaf.br { bottom: 40px; right: -50px; width: 220px; transform: rotate(18deg); }

/* === Dashboard === */
.dash-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding: 32px 0;
  align-items: start;
}

.dash-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.dash-user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--pink-200);
}

.dash-user-name { font-weight: 700; color: var(--purple-900); font-size: 0.95rem; }
.dash-user-email { font-size: 0.78rem; color: var(--ink-soft); }

.dash-nav { display: flex; flex-direction: column; gap: 2px; }

.dash-nav button {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s ease, color 0.12s ease;
}

.dash-nav button:hover { background: var(--soft-tint); color: var(--pink-400); }
.dash-nav button.active { background: var(--purple-800); color: #fff; }
.dash-nav button.admin-only::after {
  content: 'ADMIN';
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  background: var(--pink-500);
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: auto;
}

.dash-pane { display: none; }
.dash-pane.active { display: block; }

@media (max-width: 860px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; }
}

/* === Table === */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.table th {
  background: var(--surface-2);
  color: var(--soft-tint-text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
}

.table tr:last-child td { border-bottom: none; }

/* === Reward tier badges === */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tier-bronze { background: var(--tier-bronze-bg); color: var(--tier-bronze-fg); }
.tier-silver { background: var(--tier-silver-bg); color: var(--tier-silver-fg); }
.tier-gold   { background: var(--tier-gold-bg); color: var(--tier-gold-fg); box-shadow: 0 0 0 2px var(--tier-gold-ring) inset; }

/* === Cart preview / line items === */
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.cart-line:last-child { border-bottom: none; }

.cart-summary {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 16px;
}

.cart-summary .row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  font-size: 0.92rem;
}

.cart-summary .row.total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--heading);
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}

/* === Modal === */
.modal-bg {
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-bg.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 { margin-top: 0; }

/* === Quantity stepper === */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.qty button {
  background: var(--surface);
  border: none;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--purple-800);
  font-weight: 800;
}

.qty button:hover { background: var(--soft-tint); }
.qty span { padding: 0 10px; font-weight: 700; min-width: 28px; text-align: center; }

/* === Reviews === */
.review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.review-stars { color: #f59e0b; letter-spacing: 0.06em; }
.review-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-400), var(--purple-500));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}

/* === Page header === */
.page-header {
  padding: 56px 0 24px;
  text-align: center;
  position: relative;
}

.page-header h1 { margin-bottom: 10px; }
.page-header p { max-width: 560px; margin: 0 auto; font-size: 1.05rem; }

/* === Misc === */
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.tag {
  display: inline-block;
  background: var(--soft-tint);
  color: var(--soft-tint-text);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hidden { display: none !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  display: block;
}
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* When a table cell hosts long strings, this caps width and lets `.truncate`
   inside actually have something to clip against. */
.cell-tight { max-width: 220px; }
.cell-tighter { max-width: 160px; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
  border: none;
}

.center { text-align: center; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.spaced { justify-content: space-between; }

/* === Theme toggle button (auto-injected into navbar) === */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--heading);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--soft-tint); color: var(--pink-400); border-color: var(--pink-400); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 860px) {
  /* In the mobile dropdown, the toggle stretches and reads like the other menu items */
  .nav-links .theme-toggle {
    width: 100%;
    border-radius: 999px;
    height: 44px;
    justify-content: flex-start;
    padding: 0 16px;
    gap: 10px;
  }
  .nav-links .theme-toggle::after {
    content: 'Theme';
    font-weight: 600;
    font-size: 0.95rem;
  }
}

/* === Two-column "split" layout that stacks on mobile === */
.split-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .split-2 { grid-template-columns: 1fr; gap: 28px; }
}

/* === Responsive form helpers === */
.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-2col .span-2 { grid-column: span 2; }
@media (max-width: 540px) {
  .form-2col { grid-template-columns: 1fr; }
  .form-2col .span-2 { grid-column: 1; }
}

/* === Tables: keep readable on small screens by allowing horizontal scroll === */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  margin: 0 -4px;
  padding: 0 4px;
}
.table-wrap .table { min-width: 540px; }
@media (max-width: 540px) {
  .table th, .table td { padding: 10px 10px; font-size: 0.85rem; }
}

/* === Mobile fine-tuning (≤ 640 px) === */
@media (max-width: 640px) {
  .container { padding: 0 18px; }

  .section        { padding: 40px 0; }
  .section-tight  { padding: 28px 0; }
  .page-header    { padding: 36px 0 12px; }
  .page-header p  { font-size: 0.98rem; }

  h1 { font-size: clamp(1.7rem, 7vw, 2.3rem); }
  h2 { font-size: clamp(1.3rem, 5vw, 1.7rem); }

  .hero        { padding: 36px 0 40px; }
  .hero-lede   { font-size: 1rem; }
  .hero-cta    { gap: 8px; }
  .hero-cta .btn { flex: 1 1 auto; }

  .card                  { padding: 18px; }
  .feature               { padding: 18px; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .product-title { font-size: 1rem; }
  .product-desc  { font-size: 0.8rem; }
  .product-price { font-size: 1rem; }
  .product-row .btn-sm { padding: 6px 10px; font-size: 0.78rem; }

  /* Modal: edge-to-edge feel on phones */
  .modal-bg { padding: 12px; }
  .modal    { padding: 20px; border-radius: 14px; max-height: 92vh; }

  /* Nav: brand collapses to icon only */
  .brand-text small { display: none; }
  .brand-text       { font-size: 0.95rem; }
  .nav-inner        { padding: 12px 18px; gap: 10px; }
  .nav-links a, .nav-links button.nav-cta { font-size: 0.95rem; padding: 10px 14px; }

  /* Footer columns -> single column */
  .footer-grid     { grid-template-columns: 1fr; gap: 18px; text-align: center; }
  .footer-grid ul  { padding-left: 0; }

  .pdp-promises { grid-template-columns: 1fr; }

  /* Status messages a touch tighter */
  .status-msg { padding: 10px 12px; font-size: 0.85rem; }

  /* Tap targets - keep the qty buttons big enough for fingers */
  .qty button       { width: 36px; height: 36px; }
  .pdp-qty button   { width: 48px; height: 48px; }

  /* Decorative leaves are distracting on phones */
  .deco-leaf { display: none; }
}

/* === Extra small phones (≤ 380 px) === */
@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
}

/* === Dashboard sidebar -> chip row on mobile === */
@media (max-width: 860px) {
  .dash-shell  { gap: 16px; padding: 18px 0; }
  .dash-sidebar { padding: 14px; }

  /* The user header stays as-is but tighter */
  .dash-user { padding: 4px 4px 12px; margin-bottom: 10px; }

  /* Turn the vertical nav into a horizontal scroll of pills */
  .dash-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .dash-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .dash-nav button.admin-only::after { display: none; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
