:root {
  color-scheme: light;
  --surface: #fff;
  --surface-raised: #f6efe5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --red: #ff766e;
  --red-dark: #ed625b;
  --cream: #241e19;
  --paper: #171514;
  --ink: #f5eee5;
  --muted: #c7bbb0;
  --line: #493e35;
  --orange: #ff9b58;
  --green: #8dc99a;
  --shadow: 0 14px 45px #0008;
  --surface: #211e1b;
  --surface-raised: #2a2622;
}

.theme-toggle { width: 48px; height: 48px; background: var(--paper); color: var(--ink); }
.theme-toggle svg { width: 21px; height: 21px; }
.theme-toggle:hover { color: var(--red); background: var(--cream); }
.theme-toggle:active { transform: scale(.96); }

:root[data-theme="dark"] .button-dark { background: #f5eee5; color: #211a15; }
:root[data-theme="dark"] .button-light,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .category-card,
:root[data-theme="dark"] .product-card,
:root[data-theme="dark"] .product-bottom button,
:root[data-theme="dark"] .search-field input,
:root[data-theme="dark"] .category-tab,
:root[data-theme="dark"] .article-card,
:root[data-theme="dark"] .info-card,
:root[data-theme="dark"] .choice > span,
:root[data-theme="dark"] .quantity-control,
:root[data-theme="dark"] .form-panel,
:root[data-theme="dark"] .confirmation-number,
:root[data-theme="dark"] .review-card,
:root[data-theme="dark"] .checkout-summary,
:root[data-theme="dark"] .product-dialog,
:root[data-theme="dark"] .cart-dialog { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .selection-section,
:root[data-theme="dark"] .location-panel { background: var(--surface-raised); }
:root[data-theme="dark"] .preview-notice { background: #352d25; color: #e5d9cb; }
:root[data-theme="dark"] .product-visual { background: #26221f; }
:root[data-theme="dark"] .hero-orbit { background: #513722; }
:root[data-theme="dark"] .review-author span:first-child { background: #47382d; }
:root[data-theme="dark"] .error-summary { background: #482724; color: #ffd9d5; border-color: #9c4b42; }
:root[data-theme="dark"] .site-footer { background: #11100f; }
:root[data-theme="dark"] .map-illustration {
  background: repeating-linear-gradient(28deg, transparent 0 47px, var(--line) 48px 49px, transparent 50px 95px), repeating-linear-gradient(-51deg, transparent 0 65px, var(--line) 66px 68px, transparent 69px 125px);
}
:root[data-theme="dark"] .favorite-button { background: #211e1bd9; color: var(--ink); }

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --red: #ff766e;
    --red-dark: #ed625b;
    --cream: #241e19;
    --paper: #171514;
    --ink: #f5eee5;
    --muted: #c7bbb0;
    --line: #493e35;
    --orange: #ff9b58;
    --green: #8dc99a;
    --shadow: 0 14px 45px #0008;
    --surface: #211e1b;
    --surface-raised: #2a2622;
  }
  :root[data-theme="system"] .button-dark { background: #f5eee5; color: #211a15; }
  :root[data-theme="system"] .button-light,
  :root[data-theme="system"] .icon-button,
  :root[data-theme="system"] .category-card,
  :root[data-theme="system"] .product-card,
  :root[data-theme="system"] .product-bottom button,
  :root[data-theme="system"] .search-field input,
  :root[data-theme="system"] .category-tab,
  :root[data-theme="system"] .article-card,
  :root[data-theme="system"] .info-card,
  :root[data-theme="system"] .choice > span,
  :root[data-theme="system"] .quantity-control,
  :root[data-theme="system"] .form-panel,
  :root[data-theme="system"] .confirmation-number,
  :root[data-theme="system"] .review-card,
  :root[data-theme="system"] .checkout-summary,
  :root[data-theme="system"] .product-dialog,
  :root[data-theme="system"] .cart-dialog { background: var(--surface); color: var(--ink); }
  :root[data-theme="system"] .selection-section,
  :root[data-theme="system"] .location-panel { background: var(--surface-raised); }
  :root[data-theme="system"] .preview-notice { background: #352d25; color: #e5d9cb; }
  :root[data-theme="system"] .product-visual { background: #26221f; }
  :root[data-theme="system"] .hero-orbit { background: #513722; }
  :root[data-theme="system"] .review-author span:first-child { background: #47382d; }
  :root[data-theme="system"] .error-summary { background: #482724; color: #ffd9d5; border-color: #9c4b42; }
  :root[data-theme="system"] .site-footer { background: #11100f; }
  :root[data-theme="system"] .map-illustration {
    background: repeating-linear-gradient(28deg, transparent 0 47px, var(--line) 48px 49px, transparent 50px 95px), repeating-linear-gradient(-51deg, transparent 0 65px, var(--line) 66px 68px, transparent 69px 125px);
  }
  :root[data-theme="system"] .favorite-button { background: #211e1bd9; color: var(--ink); }
}

@media (max-width: 900px) {
  .theme-toggle { width: 44px; height: 44px; }
}
