/* =========================================================================
   RESTORE — Dark (glass) theme: html[data-theme="dark"] — the default
   Mood taken from the brand banner: deep black, diagonal white light
   streaks, a crimson glow (the red iPhone) and frosted-glass surfaces with
   a soft neon glow on text.
   ========================================================================= */
html[data-theme="dark"] {
  --ink: #ffffff;               /* "ink" fills become white (buttons, chips, active states) */
  --paper: #000000;
  --bg: #050506;
  --surface: rgba(255, 255, 255, .06);
  --surface-2: rgba(255, 255, 255, .045);
  --surface-3: rgba(255, 255, 255, .1);
  --border: rgba(255, 255, 255, .12);
  --border-strong: rgba(255, 255, 255, .26);
  --text: #f5f5f7;
  --text-2: #cfcfd6;
  --muted: #92929c;
  --danger: #ff4d5e;
  --danger-soft: rgba(255, 77, 94, .14);
  --success: #3ddc84;
  --success-soft: rgba(61, 220, 132, .13);
  --warning: #ffb547;
  --shadow-sm: 0 8px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  --shadow: 0 20px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  --glass-blur: blur(16px) saturate(150%);
  --neon: 0 0 1px rgba(255, 255, 255, .55), 0 0 10px rgba(255, 255, 255, .32), 0 0 24px rgba(255, 255, 255, .14);
  --neon-soft: 0 0 8px rgba(255, 255, 255, .18);
  --neon-red: 0 0 1px rgba(255, 77, 94, .8), 0 0 10px rgba(255, 77, 94, .55), 0 0 22px rgba(255, 77, 94, .3);
  color-scheme: dark;
}

/* ---------- Backdrop: light streaks + crimson glow ---------- */
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55vw 45vw at 12% 38%, rgba(150, 18, 36, .32), transparent 62%),
    radial-gradient(45vw 35vw at 92% 4%, rgba(255, 255, 255, .11), transparent 60%),
    radial-gradient(40vw 30vw at 80% 95%, rgba(150, 18, 36, .18), transparent 65%),
    linear-gradient(118deg, transparent 0 34%, rgba(255, 255, 255, .06) 38%, transparent 44%),
    linear-gradient(118deg, transparent 0 58%, rgba(255, 255, 255, .045) 61%, transparent 66%),
    linear-gradient(62deg, transparent 0 70%, rgba(255, 255, 255, .04) 74%, transparent 79%),
    #050506;
}

/* ---------- Frosted glass surfaces ---------- */
html[data-theme="dark"] :is(
  .product-card, .panel, .card-panel, .summary-card, .service, .tier, .faq-item, .filters,
  .brand-chip, .cat-circle-img, .auth-card, .gateway-card, .result-card, .order-row, .profile-nav,
  .product-detail, .chip, .page-link, .step, .option-card, .installment, .address-card, .empty-state,
  .buy-box, .promo-card, .flash, .faq-intro, .slider-btn, .qty, .variant-chip
) {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-color: var(--border);
}
/* Selected colour / model: the glass rule above resets the border, so mark it clearly. */
html[data-theme="dark"] .variant-chip.active {
  border-color: #fff;
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 0 14px rgba(255, 255, 255, .18);
}
html[data-theme="dark"] :is(.product-card, .panel, .card-panel, .summary-card, .service, .tier, .faq-item,
  .filters, .brand-chip, .auth-card, .gateway-card, .result-card, .order-row, .profile-nav, .product-detail) {
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .03));
}
html[data-theme="dark"] .product-card:hover { border-color: rgba(255, 255, 255, .32); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 24px rgba(255, 255, 255, .08); }
html[data-theme="dark"] .product-card-media,
html[data-theme="dark"] .gallery-main,
html[data-theme="dark"] .bs-img,
html[data-theme="dark"] .cart-item-media,
html[data-theme="dark"] .mini-cart-media { background: rgba(0, 0, 0, .35); }
html[data-theme="dark"] .buy-box { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .spec-table dt { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .swatches { background: rgba(0, 0, 0, .55); }

/* Transparent logo (img/logo-mark.png) with a soft neon glow. */
html[data-theme="dark"] .brand-mark img { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .35)); }
html[data-theme="dark"] .auth-logo { background: transparent; filter: drop-shadow(0 0 14px rgba(255, 255, 255, .25)); }

/* ---------- Header / nav / footer ---------- */
html[data-theme="dark"] .announce { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom: 1px solid rgba(255, 255, 255, .06); }
html[data-theme="dark"] .announce b { color: #fff; text-shadow: var(--neon-soft); }
html[data-theme="dark"] .site-header { background: rgba(5, 5, 6, .62); color: #fff; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom: 1px solid rgba(255, 255, 255, .08); }
html[data-theme="dark"] .category-nav { border-top-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .nav-link.is-hot { color: #fff; text-shadow: var(--neon-soft); }
html[data-theme="dark"] .nav-link.is-hot::before { box-shadow: 0 0 8px var(--danger); }
html[data-theme="dark"] .header-actions .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .25); }
html[data-theme="dark"] .search input { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .search input:focus { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .45); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 0 18px rgba(255, 255, 255, .12); }
html[data-theme="dark"] :is(.mega, .search-results) { background: rgba(16, 16, 18, .88); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--border); }
html[data-theme="dark"] .site-footer { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-top: 1px solid rgba(255, 255, 255, .08); }
html[data-theme="dark"] :is(.footer-grid h4, .footer-name) { color: #fff; text-shadow: var(--neon); }
html[data-theme="dark"] .social { color: #fff; background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .social:hover { background: #fff; color: #000; box-shadow: 0 0 16px rgba(255, 255, 255, .45); }
html[data-theme="dark"] .contact-item { color: #fff; }
html[data-theme="dark"] .contact-item b { text-shadow: var(--neon); }
html[data-theme="dark"] .contact-item + .contact-item { border-color: rgba(255, 255, 255, .15); }
html[data-theme="dark"] .bottom-nav { background: rgba(5, 5, 6, .72); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-top-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .bottom-nav .is-active { color: #fff; text-shadow: var(--neon); }
html[data-theme="dark"] .drawer { background: rgba(14, 14, 16, .86); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-inline-start: 1px solid var(--border); }
html[data-theme="dark"] .drawer-head { background: rgba(255, 255, 255, .05); color: #fff; border-bottom: 1px solid var(--border); }
html[data-theme="dark"] .mini-cart-footer { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .drawer-overlay { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ---------- Hero / flash / promos ---------- */
html[data-theme="dark"] .hero-slider { background: rgba(0, 0, 0, .5); color: #fff; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08); }
html[data-theme="dark"] .hero-compose { background: radial-gradient(ellipse at 75% 50%, rgba(150, 18, 36, .35) 0%, transparent 55%), radial-gradient(ellipse at 20% 40%, rgba(255, 255, 255, .08), transparent 60%), rgba(0, 0, 0, .45); }
html[data-theme="dark"] .hero-slider .slider-btn { background: rgba(255, 255, 255, .1); color: #fff; }
html[data-theme="dark"] .hero-slider .slider-btn:hover { background: #fff; color: #000; }
html[data-theme="dark"] .dot span { background: #fff; box-shadow: 0 0 8px #fff; }
html[data-theme="dark"] .btn-light { background: #fff; color: #000; }
html[data-theme="dark"] .btn-light:hover { box-shadow: 0 0 22px rgba(255, 255, 255, .45); background: #fff; }
html[data-theme="dark"] .flash {
  color: #fff; border: 1px solid rgba(255, 77, 94, .35);
  background: linear-gradient(135deg, rgba(150, 18, 36, .35), rgba(255, 255, 255, .04) 55%);
  box-shadow: 0 0 40px rgba(255, 77, 94, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
}
html[data-theme="dark"] .flash-intro h2 em { color: var(--danger); text-shadow: var(--neon-red); }
html[data-theme="dark"] .countdown span { background: rgba(255, 255, 255, .92); color: #000; box-shadow: 0 0 14px rgba(255, 255, 255, .35); }
html[data-theme="dark"] .promo-card,
html[data-theme="dark"] .promo-card.is-light { color: #fff; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02)); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .promo-card:first-child { background: linear-gradient(135deg, rgba(150, 18, 36, .4), rgba(255, 255, 255, .03) 65%); }
html[data-theme="dark"] .promo-steps span { border-color: rgba(255, 255, 255, .5); }
html[data-theme="dark"] .promo-steps span:first-child { background: #fff; color: #000; box-shadow: 0 0 16px rgba(255, 255, 255, .4); }
html[data-theme="dark"] .faq-intro { color: #fff; border: 1px solid var(--border); background: linear-gradient(160deg, rgba(150, 18, 36, .3), rgba(255, 255, 255, .03)); }
html[data-theme="dark"] .service-icon { box-shadow: 0 0 18px rgba(255, 255, 255, .25); }
html[data-theme="dark"] .tier:nth-child(4) { background: linear-gradient(160deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .75)); color: #000; }
html[data-theme="dark"] .cat-circle-img { border: 1px solid var(--border); }
html[data-theme="dark"] .cat-circle:hover .cat-circle-img { border-color: #fff; box-shadow: 0 0 20px rgba(255, 255, 255, .25); }

/* ---------- Buttons & controls glow ---------- */
html[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #fff; box-shadow: 0 0 22px rgba(255, 255, 255, .45); }
html[data-theme="dark"] .btn-outline { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .btn-outline:hover { border-color: #fff; box-shadow: 0 0 16px rgba(255, 255, 255, .15); }
html[data-theme="dark"] :is(.field input, .field select, .field textarea, .input, .coupon-box input) { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] :is(.field input, .field select, .field textarea, .input):focus { background: rgba(255, 255, 255, .09); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 0 18px rgba(255, 255, 255, .1); }
html[data-theme="dark"] select option { background: #111; color: #fff; }
html[data-theme="dark"] .free-ship-bar span { box-shadow: 0 0 10px rgba(255, 255, 255, .6); }
html[data-theme="dark"] .support-fab { border-color: rgba(255, 255, 255, .3); box-shadow: 0 0 26px rgba(255, 255, 255, .35); }
html[data-theme="dark"] .debug-code { background: rgba(255, 181, 71, .1); }

/* ---------- Neon text (subtle) ---------- */
html[data-theme="dark"] :is(h1, h2, .section-head h2, .hero-copy h2, .product-title, .footer-name, .auth-card h1) { text-shadow: var(--neon); }
html[data-theme="dark"] .section-head h2::before { box-shadow: 0 0 10px #fff, 0 0 20px rgba(255, 255, 255, .5); }
html[data-theme="dark"] :is(.price strong, .summary-total strong, .bs-rank) { text-shadow: var(--neon); }
html[data-theme="dark"] :is(.product-card-title, .bs-name, .mini-cart-title, .cart-item-title, .service b, .tier b) { text-shadow: var(--neon-soft); }
html[data-theme="dark"] :is(.off-badge, .tag-discount, .badge) { box-shadow: 0 0 12px rgba(255, 77, 94, .65); }
html[data-theme="dark"] :is(.low-stock, .card-timer, .text-danger) { text-shadow: 0 0 8px rgba(255, 77, 94, .45); }
html[data-theme="dark"] .eyebrow { text-shadow: 0 0 10px rgba(255, 255, 255, .2); }
html[data-theme="dark"] .text-accent { text-shadow: 0 0 8px rgba(61, 220, 132, .45); }

/* Performance: lighter blur on small screens */
@media (max-width: 560px) {
  html[data-theme="dark"] { --glass-blur: blur(10px) saturate(140%); }
}

/* ---------- Theme switch button: shows the mode you can switch TO ---------- */
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
