/* The light palette stays identical on phones and computers. */
:root { color-scheme: only light; }
.theme-toggle[hidden] { display: none; }
.theme-toggle { cursor: pointer; }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }

/* Scoped to the storefront; product photos and the original logo are untouched. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #111c18;
  --theme-surface: #1b2923;
  --theme-soft: #25372d;
  --theme-text: #edf3e8;
  --theme-muted: #bccaba;
  --theme-line: #465b4c;
  --albi-paper: var(--theme-bg);
  --bg: var(--theme-bg);
  --text: var(--theme-text);
  --muted: var(--theme-muted);
  --border: var(--theme-line);
  --shell-soft: var(--theme-soft);
}
:root[data-theme="dark"] body { background: var(--theme-bg); color: var(--theme-text); }
:root[data-theme="dark"] :is(.public-header, .public-navigation, .header-search,
  .shop-card, .shop-empty, .home-empty, .filter-panel, .contact-cta-card, .panel, .card, .category-card,
  .cart-line, .cart-summary, .cart-empty, .checkout-section, .checkout-summary,
  .product-buy-panel, .trip-strip) {
  background: var(--theme-surface);
  border-color: var(--theme-line);
}
:root[data-theme="dark"] :is(.round-action, .filter-button, .shop-pills a,
  .soft-section, .albi-hero-art, .spec-chip, .reassurance-box, .quantity-control,
  .product-thumbnails button, .variant-pills span, .cart-stepper button,
  .shop-count-badge, .product-cat-tag, .product-sku-tag) {
  background: var(--theme-soft);
  color: var(--theme-text);
  border-color: var(--theme-line);
}
:root[data-theme="dark"] :is(.header-search input, .shop-search input,
  .sort-select select, .filter-panel select, .checkout-section input,
  .checkout-section select, .checkout-section textarea) {
  background-color: var(--theme-soft);
  color: var(--theme-text);
  border-color: var(--theme-line);
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: var(--theme-muted); opacity: 1; }
:root[data-theme="dark"] :is(.albi-brand, .public-navigation a, .shop-heading h1,
  .card-title a, .card-price, .card-body h3, .card-body strong, .filter-panel label,
  .contact-cta h2, .product-buy-panel h1, .product-price, .variant-fieldset legend,
  .quantity-control button, .quantity-control output, .checkout-section label,
  .home-section-heading h2, .home-section-heading > a, .category-card strong,
  .reassurance-item strong, .product-breadcrumbs .current, .shop-empty h2,
  .steps-grid h3, .trip-country, .trip-details h2, .trip-details strong,
  .trip-countdown) { color: var(--theme-text); }
:root[data-theme="dark"] :is(.shop-heading p, .filter-panel > a, .shop-image-empty,
  .shop-search .search-icon, .cart-back, .cart-heading > span, .cart-line-info p,
  .cart-note, .cart-help, .cart-empty p, .cart-image-status, .cart-line-controls .remove,
  .checkout-back, .checkout-heading > span, .checkout-section > p, .checkout-section small,
  .checkout-notice, .checkout-help, .contact-cta p, .product-description,
  .product-breadcrumbs, .product-breadcrumbs a, .reassurance-item p, .steps-grid p,
  .home-empty, .shop-empty p, .trip-details p) { color: var(--theme-muted); }
:root[data-theme="dark"] :is(.shop-eyebrow, .card-category, .cart-heading > p,
  .cart-eyebrow, .cart-item-kicker, .checkout-heading > p, .checkout-eyebrow,
  .home-section-heading > div > span, .category-icon, .cart-help a, .checkout-help a,
  .product-feedback) { color: #acd765; }
:root[data-theme="dark"] :is(.public-navigation a:hover, .public-navigation a.active,
  .filter-button:hover, .shop-pills a:hover, .category-card:hover) {
  background: var(--theme-soft);
  color: #d2eca9;
  border-color: #84b130;
}
:root[data-theme="dark"] :is(.shop-pills a.active, .variant-pills input:checked + span,
  .cart-stepper button:hover) { background: #84b130; color: #17240d; border-color: #84b130; }
:root[data-theme="dark"] :is(.apply-filters, .card-action-btn.primary, .checkout-submit,
  .cart-summary-actions .checkout-button, .cart-empty > a, .header-search button) {
  background: #84b130;
  color: #17240d;
  border-color: #84b130;
}
:root[data-theme="dark"] .card-action-btn.secondary {
  background: var(--theme-soft); color: var(--theme-text); border-color: var(--theme-line);
}
:root[data-theme="dark"] :is(.cart-line-controls, .cart-stepper, .cart-total,
  .cart-summary-actions a, .checkout-items p, .product-meta-header, .product-description,
  .variant-fieldset, .reassurance-box, .reassurance-item, .steps-grid,
  .steps-grid article, .albi-brand-strip, .public-navigation a) { border-color: var(--theme-line); }
:root[data-theme="dark"] .checkout-section h2 > span { color: #17240d; }
:root[data-theme="dark"] .quantity-control button:hover { background: var(--theme-surface); }
:root[data-theme="dark"] .spec-chip svg { color: #acd765; }
:root[data-theme="dark"] .trip-countdown strong { background: var(--theme-soft); }
:root[data-theme="dark"] input[type="checkbox"] { accent-color: #84b130; }
:root[data-theme="dark"] .variant-pills span small { color: #acd765 !important; }
:root[data-theme="dark"] .variant-pills input:checked + span small { color: #17240d !important; }
:root[data-theme="dark"] .albi-store :focus-visible { outline-color: #acd765; }

/* Give navigation enough room with the additional theme control. */
@media (min-width: 821px) and (max-width: 1100px) {
  .public-nav-wrap { grid-template-columns: auto 1fr; gap: 0 18px; padding-top: 12px; }
  .nav-actions { grid-column: 2; grid-row: 1; justify-self: end; }
  .public-navigation { grid-column: 1 / -1; grid-row: 2; }
  .public-navigation a { padding-top: 16px; }
}
/* Keep the four navigation actions within a narrow phone viewport. */
@media (max-width: 420px) {
  .public-nav-wrap { gap: 8px; }
  .albi-brand > span:last-child { display: none; }
  .nav-actions { gap: 6px; }
}
