/*
 * theme.css — dark mode for every page. theme.js sets <html data-theme>.
 * Each page keeps its own light colours in :root; this file swaps them
 * (and the few colours written straight into the pages) when dark.
 * The cards themselves are never changed: they are the product.
 */

/* The sun/moon button in the menu (same size as the account button). */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 1px solid #C9C8C3; background: none; color: var(--text-dim, #3A3A3E);
  cursor: pointer; font: inherit;
}
.theme-btn:hover { color: var(--text, #0C0C0E); border-color: var(--text-dim, #3A3A3E); }
.theme-btn svg { display: block; }
nav ul li.nav-theme { list-style: none; display: block !important; }
@media (max-width: 600px) { .theme-btn { width: 28px; height: 28px; } }

html[data-theme="dark"] {
  color-scheme: dark;
  /* Pet Pack "Sunny Sofa" at night: warm cocoa, tangerine accent. */
  --bg-0: #1C1612;
  --bg-1: #241D18;
  --bg-2: #30271F;
  --bg-3: #3B3027;
  --line: #3A3028;
  --line-strong: #5A4A3C;
  --text: #FFF3E3;
  --text-dim: #E2D2BE;
  --text-faint: #B5A28C;
  --accent: #F5AB66;
  --accent-bright: #F8BE86;
  --accent-soft: rgba(242, 154, 74, 0.18);
  --biscuit: #3B2A1C;
}
html[data-theme="dark"] body { background: var(--bg-0); color: var(--text); }
html[data-theme="dark"] .theme-btn,
html[data-theme="dark"] .lang-switch,
html[data-theme="dark"] .account-btn,
html[data-theme="dark"] .sn-account { border-color: #5A4A3C !important; }

/* Colours written straight into the pages. */
html[data-theme="dark"] nav.top { background: rgba(28, 22, 18, 0.88) !important; }
html[data-theme="dark"] .site-nav { background: var(--bg-0) !important; }
html[data-theme="dark"] .mobile-order-bar { background: rgba(36, 29, 24, 0.96) !important; }
@media (max-width: 850px) {
  html[data-theme="dark"] .preview { background: rgba(28, 22, 18, 0.94) !important; }
}
/* Admin orders as cards on phones (mobile.css). */
html[data-theme="dark"] table.orders-table tr { border-color: var(--line) !important; background: var(--bg-1) !important; }

/* Text fields and menus. */
html[data-theme="dark"] { --ok: #5FC48A; --bad: #F08A8A; --success: #5FC48A; --error: #F08A8A; }
html[data-theme="dark"] form.acct input[type=email],
html[data-theme="dark"] form.acct input[type=text],
html[data-theme="dark"] form.acct select { background: var(--bg-2); border-color: var(--line-strong); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #75757B; }

/* Notices and status badges (account, cart, builder). */
html[data-theme="dark"] .acct-error,
html[data-theme="dark"] .fb-error,
html[data-theme="dark"] .photo-quality.bad { background: #2D1717; border-color: #6B2E2E; color: #F2B8B0; }
html[data-theme="dark"] .acct-ok { background: #142A1D; border-color: #2D5A3E; color: #A8DDBA; }
html[data-theme="dark"] .photo-quality.warn { background: #2D2312; border-color: #6B5320; color: #F0CD8A; }
html[data-theme="dark"] .badge.act { background: #33200F; color: #FFB27A; }
html[data-theme="dark"] .badge.done { background: #142A1D; color: #A8DDBA; }
html[data-theme="dark"] .badge.bad { background: #2D1717; color: #F2B8B0; }
html[data-theme="dark"] .promo-ok { color: var(--ok); }
html[data-theme="dark"] .link-btn:hover { color: var(--bad); }

/* Homepage cursor glow: multiply blend vanishes on a near-black background,
   so in dark mode the Ember light is added on top with screen instead. */
html[data-theme="dark"] .bg-glow {
  mix-blend-mode: screen;
  background: radial-gradient(
    26vmax circle at var(--mx, 50%) var(--my, 40%),
    rgba(255, 90, 31, 0.24) 0%,
    rgba(255, 90, 31, 0.10) 25%,
    transparent 60%
  );
}

/* Pet Pack menu pills and buttons (brand.css) on the dark background. */
html[data-theme="dark"] .cta-pill, html[data-theme="dark"] .site-nav .sn-cta { background: var(--sun) !important; color: #2B2118 !important; }
html[data-theme="dark"] .cta-pill:hover, html[data-theme="dark"] .site-nav .sn-cta:hover { background: var(--sun-bright) !important; }
html[data-theme="dark"] .showroom-pill, html[data-theme="dark"] .site-nav .sn-showroom { border-color: var(--text) !important; color: var(--text) !important; }
html[data-theme="dark"] .btn-primary { box-shadow: none !important; }
html[data-theme="dark"] .sun-spot { background: #3B2A1C !important; }
