/* The original dark design remains the default; photos keep their own palette. */
:root { color-scheme: dark; }
.nav-tools { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; }
.theme-toggle {
  display: inline-grid; place-items: center; flex: 0 0 44px;
  width: 44px; height: 44px; padding: 0; border: 1px solid var(--line);
  border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
}
.theme-toggle:hover { background: var(--panel); border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-moon { opacity: 0; transform: rotate(-60deg) scale(.65); }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0e8; --bg-soft: #eee8de; --panel: #e8e1d6;
  --text: #211e1b; --muted: #625b54; --line: #cfc5b8;
  --red: #9e0b0f; --red-bright: #b51016;
}
[data-theme="light"] .theme-sun { opacity: 0; transform: rotate(60deg) scale(.65); }
[data-theme="light"] .theme-toggle .theme-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] body { background: var(--bg); }
[data-theme="light"] .site-header { background: rgba(244,240,232,.95); border-color: var(--line); }
[data-theme="light"] .announcement { background: var(--bg-soft); color: var(--muted); border-color: var(--line); }
[data-theme="light"] .brand img,
[data-theme="light"] footer img { filter: invert(1); mix-blend-mode: multiply; }
[data-theme="light"] .nav-links a,
[data-theme="light"] .text-link,
[data-theme="light"] .hero-copy > p:not(.eyebrow),
[data-theme="light"] .story-copy,
[data-theme="light"] .policy-content { color: var(--muted); }
[data-theme="light"] .eyebrow { color: #65564c; }
[data-theme="light"] .hero h1 span { -webkit-text-stroke-color: #74685d; }
[data-theme="light"] .nav-action,
[data-theme="light"] .button.secondary { border-color: #958778; color: var(--text); }
[data-theme="light"] .button.secondary:hover { border-color: var(--text); background: var(--bg-soft); }
[data-theme="light"] .menu-toggle,
[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .text-link:hover,
[data-theme="light"] .product-price strong,
[data-theme="light"] .product-card:hover .arrow,
[data-theme="light"] .story-copy strong,
[data-theme="light"] .policy-content h3,
[data-theme="light"] .footer-links a:hover,
[data-theme="light"] .footer-links button:hover { color: var(--text); }
[data-theme="light"] .product-price,
[data-theme="light"] .feature-list li,
[data-theme="light"] .story-mission,
[data-theme="light"] .measure-note strong,
[data-theme="light"] .measure-table td:not(:first-child),
[data-theme="light"] .order-discount-summary strong { color: #3f3832; }
[data-theme="light"] .product-price del,
[data-theme="light"] .product-spec,
[data-theme="light"] .arrow,
[data-theme="light"] .feature-list span,
[data-theme="light"] .story-kicker p:last-child,
[data-theme="light"] .benefit p,
[data-theme="light"] footer p,
[data-theme="light"] .footer-links,
[data-theme="light"] .policy-updated,
[data-theme="light"] .measure-table th,
[data-theme="light"] .measure-table small,
[data-theme="light"] .measure-note,
[data-theme="light"] .order-intro > div > p:last-child,
[data-theme="light"] .order-facts,
[data-theme="light"] .order-field span,
[data-theme="light"] .order-item label > span,
[data-theme="light"] .order-items-heading span,
[data-theme="light"] .order-coupon > label,
[data-theme="light"] .order-coupon-status,
[data-theme="light"] .order-cep-status,
[data-theme="light"] .order-discount-summary div,
[data-theme="light"] .order-total span,
[data-theme="light"] .order-shipping,
[data-theme="light"] .order-privacy { color: var(--muted); }
[data-theme="light"] .size-guide-dialog,
[data-theme="light"] .order-dialog,
[data-theme="light"] .policy-dialog { background: var(--bg); color: var(--text); border-color: var(--line); }
[data-theme="light"] .order-intro,
[data-theme="light"] .contact-box { background: var(--bg-soft); border-color: var(--line); }
[data-theme="light"] .contact-box::after { color: rgba(50,35,20,.04); }
[data-theme="light"] .order-item,
[data-theme="light"] .order-coupon,
[data-theme="light"] .order-address { background: var(--bg-soft); border-color: var(--line); }
[data-theme="light"] .order-field input,
[data-theme="light"] .order-item select,
[data-theme="light"] .order-item input,
[data-theme="light"] .order-coupon input { background: #fffcf7; color: var(--text); border-color: #a99b8d; }
[data-theme="light"] input::placeholder { color: #74695f; opacity: 1; }
[data-theme="light"] .order-field input[readonly],
[data-theme="light"] .order-coupon input[readonly] { background: #e8e1d6; color: #62574c; }
[data-theme="light"] .size-guide-close,
[data-theme="light"] .order-close,
[data-theme="light"] .policy-close,
[data-theme="light"] .order-remove,
[data-theme="light"] .order-coupon button { background: var(--bg); color: var(--text); border-color: #a99b8d; }
[data-theme="light"] .size-guide-trigger,
[data-theme="light"] .order-add { color: var(--text); border-color: #958778; }
[data-theme="light"] .size-guide-trigger:hover,
[data-theme="light"] .order-remove:hover { color: var(--red); border-color: var(--red); }
[data-theme="light"] .measure-table-wrap,
[data-theme="light"] .measure-table th,
[data-theme="light"] .measure-table td,
[data-theme="light"] .story-mission,
[data-theme="light"] .order-facts span,
[data-theme="light"] .order-discount-summary,
[data-theme="light"] .order-total { border-color: var(--line); }
[data-theme="light"] .order-coupon-status[data-state="success"],
[data-theme="light"] .order-cep-status[data-state="success"] { color: #256339; }
[data-theme="light"] .order-coupon-status[data-state="error"],
[data-theme="light"] .order-cep-status[data-state="error"],
[data-theme="light"] .order-discount-summary .discount strong,
[data-theme="light"] .order-form-error { color: #9e0b0f; }
[data-theme="light"] .order-cep-status[data-state="loading"] { color: var(--muted); }
[data-theme="light"] .order-form-error { background: #f9e6e3; border-color: #ac393d; }
[data-theme="light"] .arrow:focus-visible,
[data-theme="light"] .size-guide-trigger:focus-visible,
[data-theme="light"] .size-guide-close:focus-visible,
[data-theme="light"] .order-close:focus-visible,
[data-theme="light"] .policy-close:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
@media (max-width: 880px) {
  .nav-tools { gap: .5rem; }
  [data-theme="light"] .nav-links { background: rgba(244,240,232,.98); }
  [data-theme="light"] .nav-links a { border-color: var(--line); }
}
@media (max-width: 580px) {
  [data-theme="light"] .mobile-cta { background: rgba(244,240,232,.96); border-color: var(--line); }
}

/* Animate only deliberate theme changes; never fade the initial page load. */
.theme-toggle svg {
  grid-area: 1 / 1;
  transition: opacity .3s ease, transform .4s ease;
}
.theme-changing body,
.theme-changing :where(.site-header, .announcement, .nav-links, .nav-links a,
  .nav-action, .theme-toggle, .menu-toggle, .button, .hero, .feature, .feature-list li,
  .story, .story-mission, .manifesto, .benefits, .benefit, .contact-box, footer,
  .mobile-cta, .size-guide-dialog, .order-dialog, .policy-dialog, .order-intro,
  .order-item, .order-coupon, .order-address, .order-close, .policy-close,
  .size-guide-close, .order-remove, .order-add, .order-facts span, .order-total,
  .order-discount-summary, .measure-table-wrap, .measure-table th, .measure-table td,
  .size-guide-trigger, .order-coupon button, input, select, h1, h2, h3, p,
  .eyebrow, .product-price, .product-price strong, .product-price del, .arrow,
  .feature-list span, .story-copy, .story-copy strong, .footer-links,
  .policy-content, .measure-note, .measure-note strong, .measure-table small,
  .order-field span, .order-item label > span, .order-coupon > label,
  .order-discount-summary strong, .order-total span, .order-facts) {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease;
}
.theme-changing .hero h1 span { transition: -webkit-text-stroke-color .4s ease; }
.theme-changing .brand img, .theme-changing footer img { transition: filter .4s ease; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle svg { transition: none; }
  .theme-changing body, .theme-changing body * { transition: none !important; }
}
