/* ============================================================
   Dark mode (home + perfume pages). Loaded last.
   <html data-theme="dark"> is set before first paint by the inline
   script in <head> (saved choice, else the device setting) and
   switched by any [data-theme-toggle] button (site.js).
   ============================================================ */

/* Toggle icons: moon in light mode, sun in dark mode */
[data-theme-toggle] .i-sun { display: none; }
html[data-theme="dark"] [data-theme-toggle] .i-sun { display: block; }
html[data-theme="dark"] [data-theme-toggle] .i-moon { display: none; }

/* ---------- Drawer theme switch ---------- */
.drawer-theme {
  display: inline-flex; align-items: center; gap: 10px; justify-self: start; height: 42px; padding: 0 16px 0 12px; margin-bottom: 8px;
  border: 1px solid var(--line-d); border-radius: 999px; background: none; color: #fff; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700;
}
.drawer-theme svg { width: 18px; height: 18px; }

/* Smooth switch (only while toggling, so nothing else animates) */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease, fill .4s ease !important;
}

/* ---------- Tokens ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0C1018;
  --paper-2: #111722;
  --text: #E8ECF3;
  --muted: #9AA3B5;
  --line: rgba(255, 255, 255, .12);
}
html[data-theme="dark"] .store {
  background: #0C1018;
  --page: #0C1018;
  --surface: #131925;
  --panel: #121824;
  --panel-2: #1B2333;
  --card-line: rgba(255, 255, 255, .08);
  --tile: #E9EDF2;
}

/* ---------- Shared pieces (both pages) ---------- */
html[data-theme="dark"] .btn-ink { background: #EEF2F8; color: #0A0E17; }
html[data-theme="dark"] .btn-ink:hover { background: #fff; }
html[data-theme="dark"] .btn-line { color: var(--text); }
html[data-theme="dark"] .btn-line:hover { border-color: var(--text); }
html[data-theme="dark"] .plus { color: var(--text); }
html[data-theme="dark"] details[open] .plus { background: var(--text); border-color: var(--text); color: #0C1018; }
html[data-theme="dark"] .faq-list summary:hover { color: var(--sky); }
html[data-theme="dark"] .step::before { background: var(--text); }
html[data-theme="dark"] .step:last-child::before { background: var(--azure); }
html[data-theme="dark"] .step-icon { color: var(--text); }
html[data-theme="dark"] .step p strong { color: var(--text); }
html[data-theme="dark"] .dark { background: #070A10; }
html[data-theme="dark"] .site-footer { border-top: 1px solid rgba(255, 255, 255, .06); }
html[data-theme="dark"] .manifesto blockquote em { color: var(--sky); }

/* ---------- Perfume page: chrome ---------- */
html[data-theme="dark"] .topbar { background: #070A10; border-bottom: 1px solid rgba(255, 255, 255, .06); }
html[data-theme="dark"] .store-header { background: rgba(12, 16, 24, .9); }
html[data-theme="dark"] .store-header .logo,
html[data-theme="dark"] .store-header .menu-toggle,
html[data-theme="dark"] .store-nav a,
html[data-theme="dark"] .search-field input,
html[data-theme="dark"] .search-btn,
html[data-theme="dark"] .store-action { color: var(--text); }
html[data-theme="dark"] .store-nav a:hover { color: var(--sky); }
html[data-theme="dark"] .search-field:focus-within { background: #0F141E; }
html[data-theme="dark"] .search-field input::placeholder { color: #7D869A; }
html[data-theme="dark"] .search-results { background: #151C28; box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .75); }
html[data-theme="dark"] .sr-brand { background: transparent; color: var(--text); }
html[data-theme="dark"] .sr-thumb,
html[data-theme="dark"] .order-thumb,
html[data-theme="dark"] .sr-item:hover .sr-thumb { background: var(--tile); }
html[data-theme="dark"] .sr-add { background: transparent; border-color: var(--text); color: var(--text); }
html[data-theme="dark"] .sr-add:hover,
html[data-theme="dark"] .sr-add.added { background: var(--text); color: #0C1018; }
html[data-theme="dark"] .sr-empty a { color: var(--text); }
html[data-theme="dark"] .order-btn { background: #EEF2F8; color: #0A0E17; }
html[data-theme="dark"] .order-btn:hover { background: #fff; }
html[data-theme="dark"] .order-btn .order-count { background: rgba(10, 14, 23, .1); color: #0A0E17; }
html[data-theme="dark"] .order-btn .order-count.has-items { background: var(--azure); color: #fff; }

/* ---------- Hero, strips, categories ---------- */
html[data-theme="dark"] .promo--photo { background: linear-gradient(100deg, #161D2A 0%, #121926 48%, #0F1520 100%); color: var(--text); }
html[data-theme="dark"] .promo--photo .btn-line { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04); color: var(--text); }
html[data-theme="dark"] .promo--photo .btn-line:hover { border-color: var(--text); background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .promo--photo .ship-chip { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .promo--photo .ship-chip strong { color: var(--text); }
html[data-theme="dark"] .brand-strip span { color: var(--text); }
html[data-theme="dark"] .cat-label { color: var(--text); }
html[data-theme="dark"] .cat--men { --cat-bg: #D5E1EF; }
html[data-theme="dark"] .cat--women { --cat-bg: #EEDCE3; }
html[data-theme="dark"] .cat--unisex { --cat-bg: #DEDAF0; }
html[data-theme="dark"] .perk svg { color: var(--sky); }

/* ---------- Product cards (photos stay on a light tile: they're shot on white) ---------- */
html[data-theme="dark"] .p-card { background: var(--surface); }
html[data-theme="dark"] .p-card:hover { box-shadow: 0 28px 54px -30px rgba(0, 0, 0, .85); }
html[data-theme="dark"] .p-media { background: var(--tile); }
html[data-theme="dark"] .p-group { color: #5C6272; }
html[data-theme="dark"] .p-group.arabian { color: #A3651F; }
html[data-theme="dark"] .p-row-cell.arabian { color: #E2AE6A; }
html[data-theme="dark"] .p-row-cell.designer { color: var(--sky); }
html[data-theme="dark"] .qv-tag { background: rgba(124, 196, 245, .14); color: var(--sky); }
html[data-theme="dark"] .qv-tag.arabian { background: rgba(226, 174, 106, .14); color: #E2AE6A; }
html[data-theme="dark"] .qv-tag.best { background: var(--grad); color: #fff; }
html[data-theme="dark"] .f-opt input { border-color: rgba(232, 236, 243, .35); }
html[data-theme="dark"] .p-quick-hint { background: rgba(10, 14, 23, .9); }
html[data-theme="dark"] .p-brand,
html[data-theme="dark"] .p-price { color: var(--text); }
html[data-theme="dark"] .p-add { background: transparent; border-color: rgba(232, 236, 243, .6); color: var(--text); }
html[data-theme="dark"] .p-add:hover,
html[data-theme="dark"] .p-add.is-picked { background: var(--text); border-color: var(--text); color: #0C1018; }
html[data-theme="dark"] .s-link { color: var(--text); border-color: var(--text); }
html[data-theme="dark"] .shelf-arrow { background: var(--surface); color: var(--text); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .8); }
html[data-theme="dark"] .shelf-arrow:hover { background: var(--text); color: #0C1018; }

/* ---------- Brands + collections ---------- */
html[data-theme="dark"] .brand-tile { background: var(--surface); color: var(--text); }
html[data-theme="dark"] .brand-tile:hover { background: var(--panel-2); }
html[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); opacity: .88; }
html[data-theme="dark"] .brand-tile span { color: var(--sky); }
html[data-theme="dark"] .brand-tile.arabian span { color: #E2AE6A; }
html[data-theme="dark"] .banner-tab { background: var(--page); color: var(--text); }

/* ---------- Steps, application, panel, toast ---------- */
html[data-theme="dark"] .store .steps-section { background: var(--page); }
html[data-theme="dark"] .store .dark { border-top: 1px solid rgba(255, 255, 255, .06); border-bottom: 1px solid rgba(255, 255, 255, .06); }
html[data-theme="dark"] .order-scrim { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .order-sheet { background: #121824; box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .85); }
html[data-theme="dark"] .order-sub strong,
html[data-theme="dark"] .order-head .icon-btn,
html[data-theme="dark"] .order-remove:hover,
html[data-theme="dark"] .order-empty p strong,
html[data-theme="dark"] .order-hint strong { color: var(--text); }
html[data-theme="dark"] .order-empty svg { color: #4A5468; }
html[data-theme="dark"] .toast { background: #1B2332; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .85); }

/* ---------- Opening: the mist clears to the dark page instead of white ---------- */
html[data-theme="dark"] .intro.is-white .intro-stage { background: var(--page); }
html[data-theme="dark"] .intro-welcome { color: var(--text); }
html[data-theme="dark"] .intro-down { color: var(--text); }
html[data-theme="dark"] .intro-logo.on-white { color: #fff; }
html[data-theme="dark"] .intro-logo.on-white .logo-img--white { opacity: 1; }
html[data-theme="dark"] .intro-logo.on-white .logo-img--black { opacity: 0; }
html[data-theme="dark"] .intro-skip.on-white { color: #fff; border-color: rgba(255, 255, 255, .24); }
html[data-theme="dark"] .intro-skip.on-white:hover { background: #fff; border-color: #fff; color: var(--ink); }

/* ---------- Home: equipment, contact ---------- */
html[data-theme="dark"] .about-photo { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
html[data-theme="dark"] .contact-ways a,
html[data-theme="dark"] .contact-card { background: #121824; border-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .contact-ways a:hover { border-color: rgba(255, 255, 255, .3); }
html[data-theme="dark"] .cw-icon { background: rgba(124, 196, 245, .12); color: var(--sky); }
html[data-theme="dark"] .cw-icon.wa { background: rgba(59, 213, 138, .12); color: #3BD58A; }
html[data-theme="dark"] .contact .field label .req { color: var(--sky); }
html[data-theme="dark"] .contact .input { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); color: var(--text); }
html[data-theme="dark"] .contact .input:hover { border-color: rgba(255, 255, 255, .24); }
html[data-theme="dark"] .contact .input:focus { background: rgba(58, 151, 242, .07); }
html[data-theme="dark"] .contact .input::placeholder,
html[data-theme="dark"] .contact select.input:invalid { color: #7D869A; }
html[data-theme="dark"] .contact .field .error { color: #F59A9A; }
html[data-theme="dark"] .contact .form-note svg { color: var(--sky); }

/* ---------- Perfume page as part of the JMF site ---------- */
html[data-theme="dark"] .site-header--bar { background: #070A10; }
html[data-theme="dark"] .sub-title { color: var(--text); }
html[data-theme="dark"] .sub-parent:hover,
html[data-theme="dark"] .crumbs a:hover { color: var(--sky); }
html[data-theme="dark"] .intro-scene img { filter: brightness(.72) saturate(.9); }
/* Form error on the contact form in dark mode */
html[data-theme="dark"] .contact .form-error { color: #F6C1C1; background: rgba(227, 106, 106, .1); border-color: rgba(227, 106, 106, .45); }
html[data-theme="dark"] .contact .form-error strong, html[data-theme="dark"] .contact .form-error a { color: #fff; }
