/* V1 storefront: persistent day/night theme, accessible contrast and AI hero art. */
body.v1-page,
body.v1-page * {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

.v1-theme-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px !important;
  border: 1px solid #d9dee7 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #202a37 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.v1-theme-toggle:hover { background: #f1f5fa !important; border-color: #aeb9c8 !important; transform: translateY(-1px); }
.v1-theme-toggle:focus-visible { outline: 3px solid #56b8ff !important; outline-offset: 3px; }
.v1-theme-toggle-icon { font-size: 15px; line-height: 1; }

.v1-hero {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  background:
    radial-gradient(ellipse at 84% 22%, rgba(104, 177, 255, .09), transparent 40%),
    linear-gradient(120deg, #fff 0%, #fbfcff 55%, #f7faff 100%) !important;
}
.v1-hero-ai-lines { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: .36; }
.v1-hero-ai-lines .ai-circuit { fill: none; stroke: url(#v1AiLineGradient); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 8 12; animation: v1-ai-flow 22s linear infinite; }
.v1-hero-ai-lines .ai-circuit-b { stroke-width: .9; animation-duration: 29s; animation-direction: reverse; opacity: .72; }
.v1-hero-ai-lines .ai-circuit-c { stroke-width: 1; animation-duration: 25s; opacity: .65; }
.v1-hero-ai-lines .ai-nodes circle { fill: #f7fbff; stroke: #66bfff; stroke-width: 1.5; animation: v1-ai-pulse 3.2s ease-in-out infinite alternate; }
.v1-hero-ai-lines .ai-nodes circle:nth-child(3n) { animation-delay: -1.4s; }
.v1-hero-grid { position: relative; z-index: 1; }
@keyframes v1-ai-flow { to { stroke-dashoffset: -400; } }
@keyframes v1-ai-pulse { from { opacity: .35; } to { opacity: 1; } }

@media (max-width: 760px) {
  .v1-theme-toggle { min-height: 33px; padding: 0 8px !important; gap: 4px; font-size: 10px !important; }
  .v1-theme-toggle-icon { font-size: 13px; }
  .v1-hero-ai-lines { opacity: .24; }
}

/* Day mode uses the established Pure White storefront palette. */
html[data-theme="light"] { color-scheme: light; }

/* Night mode: override the legacy white-only !important presentation layer. */
html[data-theme="dark"] { color-scheme: dark; background: #0a1019 !important; }
html[data-theme="dark"] body.v1-page,
html[data-theme="dark"] body.v1-page .v1-shell { background: #0a1019 !important; color: #edf3fb !important; }
html[data-theme="dark"] .v1-header {
  background: rgba(11, 17, 27, .96) !important;
  border-bottom: 1px solid #263548 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2) !important;
}
html[data-theme="dark"] .v1-header .logo,
html[data-theme="dark"] .v1-header .logo .mono,
html[data-theme="dark"] .v1-header nav > a { color: #e8eff8 !important; }
html[data-theme="dark"] .v1-header nav > a:hover,
html[data-theme="dark"] .v1-header nav > a.active { color: #79caff !important; }
html[data-theme="dark"] .v1-cart-count { background: #26364a !important; color: #f0f6ff !important; }
html[data-theme="dark"] .pwe-header-search { background: #111c2a !important; border-color: #34465c !important; }
html[data-theme="dark"] .pwe-header-search input { color: #f1f6fd !important; }
html[data-theme="dark"] .pwe-header-search input::placeholder { color: #9aabc0 !important; opacity: 1; }
html[data-theme="dark"] .v1-theme-toggle { background: #1b2838 !important; border-color: #43566e !important; color: #f4f7fc !important; }
html[data-theme="dark"] .v1-theme-toggle:hover { background: #26374b !important; border-color: #73c6ff !important; }

html[data-theme="dark"] .v1-hero {
  background:
    radial-gradient(ellipse at 80% 35%, rgba(24, 125, 196, .2), transparent 43%),
    linear-gradient(120deg, #0b121c 0%, #101a28 58%, #101827 100%) !important;
  color: #f2f6fc !important;
}
html[data-theme="dark"] .v1-hero h1 { color: #f4f7fc !important; }
html[data-theme="dark"] .v1-hero-sub { color: #b7c5d7 !important; }
html[data-theme="dark"] .v1-btn-primary { background: #63c7ff !important; color: #071522 !important; box-shadow: 0 9px 24px rgba(43, 165, 231, .22) !important; }
html[data-theme="dark"] .v1-btn-primary:hover { background: #8ad5ff !important; color: #071522 !important; }
html[data-theme="dark"] .v1-hero-badges span { background: #172333 !important; border-color: #34465b !important; color: #dce7f4 !important; }
html[data-theme="dark"] .v1-hero-badges svg { color: #a8dfff !important; }
html[data-theme="dark"] .v1-hero-ai-lines { opacity: .7; }
html[data-theme="dark"] .v1-hero-ai-lines .ai-nodes circle { fill: #122337; stroke: #69c8ff; }
html[data-theme="dark"] .v1-hero-card { background: linear-gradient(145deg, #142235, #101a28) !important; border-color: #30455d !important; box-shadow: 0 22px 58px rgba(0, 0, 0, .35) !important; }
html[data-theme="dark"] .v1-hero-chip { background: rgba(9, 16, 26, .94) !important; color: #edf6ff !important; border: 1px solid #435873; }
html[data-theme="dark"] .v1-preorder-hero-link { background: #172436 !important; border-color: #536b86 !important; color: #f1f6fc !important; }
html[data-theme="dark"] .v1-preorder-hero-link small { color: #b3c2d4 !important; }
html[data-theme="dark"] .v1-preorder-hero-mark { background: #28415d !important; color: #c6e8ff !important; }
html[data-theme="dark"] .v1-cod-hero-link { background: #172436 !important; border-color: #43566d !important; color: #f1f6fc !important; }

html[data-theme="dark"] .v1-catalog { background: #0a1019 !important; color: #edf3fb !important; }
html[data-theme="dark"] .v1-catalog .section-title,
html[data-theme="dark"] .v1-section-eyebrow { color: #eaf1fa !important; }
html[data-theme="dark"] .v1-cat { background: #121d2b !important; border-color: #2d3e52 !important; }
html[data-theme="dark"] .v1-cat-name { color: #e7eef8 !important; }
html[data-theme="dark"] .v1-cat-count { color: #a8b8cc !important; }
html[data-theme="dark"] .v1-cat-ico { background: #1d2b3c !important; color: #c4dcf4 !important; }
html[data-theme="dark"] .v1-cat.is-active { background: #246ca2 !important; border-color: #61bafa !important; }
html[data-theme="dark"] .v1-catmenu::-webkit-scrollbar-thumb { background: #42546a; }
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .filters input,
html[data-theme="dark"] .filters select,
html[data-theme="dark"] .cod-filter { background-color: #121d2b !important; border-color: #3b4d63 !important; color: #edf4fc !important; }
html[data-theme="dark"] .filters option { background: #121d2b !important; color: #edf4fc !important; }
html[data-theme="dark"] .filter-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd8e8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; }
html[data-theme="dark"] .cod-filter input { accent-color: #64c7ff; }
html[data-theme="dark"] .pwe-product-card { background: transparent !important; color: #eaf1fa !important; }
html[data-theme="dark"] .pwe-product-image { background: #f5f7fa !important; }
html[data-theme="dark"] .pwe-product-image img { background: #f5f7fa !important; mix-blend-mode: normal !important; }
html[data-theme="dark"] .pwe-product-title { color: #eaf1fa !important; }
html[data-theme="dark"] .pwe-product-title:hover { color: #82ceff !important; }
html[data-theme="dark"] .pwe-product-price { color: #f5f8fc !important; }
html[data-theme="dark"] .pwe-price-was,
html[data-theme="dark"] .v1-price-old { color: #afbdce !important; }
html[data-theme="dark"] .pwe-product-meta,
html[data-theme="dark"] .pwe-product-stats,
html[data-theme="dark"] .v1-stat-label { color: #aebdd0 !important; }
html[data-theme="dark"] .v1-stat-value { color: #f0f5fc !important; }
html[data-theme="dark"] .pwe-add-to-cart { background: #63c7ff !important; border-color: #63c7ff !important; color: #071522 !important; }
html[data-theme="dark"] .pwe-add-to-cart:hover:not([disabled]) { background: #8ad5ff !important; border-color: #8ad5ff !important; color: #071522 !important; }
html[data-theme="dark"] .pwe-add-to-cart[disabled] { background: #334155 !important; border-color: #334155 !important; color: #c3cedb !important; }
html[data-theme="dark"] .v1-preorder-badge { background: #15263a !important; border-color: #55718d !important; color: #d6edff !important; }
html[data-theme="dark"] .v1-page-buttons button,
html[data-theme="dark"] .page-btn { background: #152131 !important; border-color: #3a4b60 !important; color: #e8f0fa !important; }
html[data-theme="dark"] .page-btn.active { background: #236b9f !important; border-color: #58b8f4 !important; color: #fff !important; }
html[data-theme="dark"] .v1-empty,
html[data-theme="dark"] .pagination-info,
html[data-theme="dark"] .per-page-selector { color: #bdc9d8 !important; }
html[data-theme="dark"] .pwe-category-directory { background: #0a1019 !important; border-top-color: #28384b !important; }
html[data-theme="dark"] .pwe-category-directory h2,
html[data-theme="dark"] .pwe-category-group > a,
html[data-theme="dark"] .pwe-back-to-top { color: #edf3fb !important; }
html[data-theme="dark"] .pwe-category-directory-head p,
html[data-theme="dark"] .pwe-category-loading,
html[data-theme="dark"] .pwe-subcategory-list,
html[data-theme="dark"] .pwe-legal-footer { color: #aebdd0 !important; }
html[data-theme="dark"] .pwe-subcategory-list a { color: #bdcad9 !important; }
html[data-theme="dark"] .pwe-legal-footer { border-top-color: #28384b !important; }

@media (prefers-reduced-motion: reduce) {
  .v1-hero-ai-lines .ai-circuit,
  .v1-hero-ai-lines .ai-nodes circle { animation: none !important; }
  .v1-theme-toggle { transition: none !important; }
}
