/* ============================================================
   LAMSA — dark.css
   Theme switch: <html data-theme="dark">.
   Loaded last (after base / layout / modules) so the token
   overrides and the few component exceptions win the cascade.

   Palette stays the same five colours: #111111, #F5F5F2,
   #777777, #B7A99A, #FFFFFF. Surfaces are #111111 lifted with
   white alphas; text is #F5F5F2 / #B7A99A.
   ============================================================ */

[data-theme="dark"] {
  color-scheme: dark;

  /* ---------- primitives, roles inverted ---------- */
  /* "Solid ink" surfaces (primary buttons, badges, the WhatsApp
     pill) become light, and the text that sits on them becomes
     dark — the same relationship the light theme has. */
  --ink: #F5F5F2;
  --paper: #111111;
  --ivory: #111111;          /* text on --terra chips */
  --terra: #F5F5F2;
  --terra-deep: #F5F5F2;
  --terra-soft: #B7A99A;
  /* Translucent washes follow the theme instead of staying black. */
  --ink-rgb: 245 245 242;
  --bg-rgb: 17 17 17;
  --paper-rgb: 17 17 17;
  --graphite: rgba(245, 245, 242, 0.24);
  --graphite-soft: rgba(245, 245, 242, 0.38);
  --focus-ring: #F5F5F2;

  /* ---------- surfaces ---------- */
  --bg: #111111;
  --bg-elev: #1A1A1A;
  --bg-card: #191919;
  --bg-stone: rgba(183, 169, 154, 0.065); /* #B7A99A wash over #111111 -> #1C1B1A */
  --border: rgba(245, 245, 242, 0.16);
  --glass: rgba(17, 17, 17, 0.82);

  /* ---------- text ---------- */
  --text: #F5F5F2;
  --text-muted: #B7A99A;             /* 8.4:1 on #111111 */
  --text-faint: rgba(245, 245, 242, 0.62); /* 6.8:1 on #111111 */

  /* ---------- status (lightened for a dark field) ---------- */
  --success: #5FBF8B;                /* 8.4:1 */
  --danger: #E4796F;                 /* 6.5:1 */
  --warning: #D9A94A;                /* 8.0:1 */

  /* ---------- elevation ---------- */
  --shadow-float: 0 18px 50px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.5);
}

/* ---------- Component exceptions ---------- */

/* The announcement bar is a bar in both themes, not a white stripe. */
[data-theme="dark"] .announcement {
  background: #1A1A1A;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* The footer is always the darkest plane on the page. */
[data-theme="dark"] .site-footer {
  --bg: #0B0B0B;
  --bg-card: #0B0B0B;
  --border: rgba(245, 245, 242, 0.16);
  --text: #F5F5F2;
  --text-muted: #B7A99A;
  --text-faint: rgba(245, 245, 242, 0.62);
  --terra-soft: #F5F5F2;
  background: #0B0B0B;
  border-top-color: var(--border);
}

/* Stone chips keep dark ink on stone. */
[data-theme="dark"] .badge--terra {
  color: #111111;
}

/* Outline behind order thumbnails reads as a hole, not a highlight. */
[data-theme="dark"] .order-item__img {
  background: #1A1A1A;
}

/* Colour swatches need a light hairline on a dark card. */
[data-theme="dark"] .swatch {
  border-color: rgba(245, 245, 242, 0.32);
}

/* Overlay scrims need to be deeper over a dark page to still read
   as "behind the drawer". */
[data-theme="dark"] .drawer__backdrop,
[data-theme="dark"] .search-overlay__backdrop,
[data-theme="dark"] .pdp-drawer__overlay,
[data-theme="dark"] .modal__backdrop {
  background: rgba(0, 0, 0, 0.62);
}

/* ---------- Theme toggle ---------- */

.theme-toggle__moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__moon {
  display: block;
}

[data-theme="dark"] .theme-toggle__sun {
  display: none;
}

/* Drawer / auth variants: icon + label row, same hit area as a nav link. */
.drawer__theme {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 0;
  margin-block-start: 0.5rem;
  border-block-start: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: start;
}

.drawer__theme:hover {
  color: var(--text);
}

/* ---------- Smoother switch ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    transition: background-color var(--dur-mid) var(--ease-soft);
  }
  body,
  .site-header,
  .site-footer,
  .announcement,
  .product-card,
  .section--stone {
    transition: background-color var(--dur-mid) var(--ease-soft),
                border-color var(--dur-mid) var(--ease-soft),
                color var(--dur-mid) var(--ease-soft);
  }
}
