/* Shared appearance roles. Light mode retains the existing palette. */
:root {
  color-scheme: light;
  --bottega-surface-raised: #fff;
  --bottega-text-strong: #171717;
  --bottega-link: var(--bottega-accent);
  --bottega-link-strong: var(--bottega-accent-hover);
  --bottega-error: #92382c;
  --bottega-error-surface: #fff1eb;
  --bottega-success: #276640;
  --bottega-image-surface: #f7f0e6;
  --bottega-image-ink: var(--bottega-accent-hover);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bottega-text: #f1eee5;
  --bottega-text-strong: #faf7f0;
  --bottega-text-muted: #bcb9ad;
  --bottega-accent: #476b52;
  --bottega-accent-hover: #36543f;
  --bottega-choice-active: #496b51;
  --bottega-link: #b4d3a8;
  --bottega-link-strong: #c9e0bf;
  --bottega-surface: #151915;
  --bottega-surface-soft: #1f261f;
  --bottega-surface-raised: #242c25;
  --bottega-surface-selected: #334333;
  --bottega-border: #455044;
  --bottega-control-border: #82917e;
  --bottega-focus: #c1d9b4;
  --bottega-navigation: #2d342c;
  --bottega-navigation-text: #faf3e7;
  --bottega-on-accent: #faf3e7;
  --bottega-image-ink: #36543f;
  --bottega-nav-selected: #3e4f3c;
  --bottega-nav-selected-text: #f1eee5;
  --bottega-error: #ffb5a6;
  --bottega-error-surface: #3a2723;
  --bottega-success: #b5d8b3;
  --sage: #b4d3a8;
  --success: var(--bottega-success);
  --link-button-color: var(--bottega-link-strong);
  --link-button-border: #82917e;
  --shadow-strong: 0 24px 64px #0006;
  scrollbar-color: #697764 var(--bottega-surface);
}

.theme-toggle { cursor: pointer; }
.theme-toggle > svg { width: 22px; height: 22px; flex: none; }
.theme-toggle .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__moon { display: none; }
.norja-mobile-menu .theme-toggle--menu { display: none; }
.theme-toggle:focus-visible { background: var(--bottega-surface-selected); color: var(--bottega-link-strong); }

@media (max-width: 1000px) {
  .norja-header .theme-toggle--header { display: none; }
  .norja-mobile-menu .theme-toggle--menu { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; }
}

:root[data-theme="dark"],
:root[data-theme="dark"] body,
:root[data-theme="dark"] .bottega-site {
  background: var(--bottega-surface);
  color: var(--bottega-text);
}

:root[data-theme="dark"] ::selection { background: #b4d3a8; color: #151915; }
:root[data-theme="dark"] .bottega-skip { background: var(--bottega-accent); color: #faf3e7; }
:root[data-theme="dark"] .norja-header { background: #181e18f5; border-color: var(--bottega-border); }
:root[data-theme="dark"] .norja-navigation { background: var(--bottega-navigation); border-color: var(--bottega-border); }
:root[data-theme="dark"] .norja-navigation a.is-active { background: var(--bottega-surface-selected); color: var(--bottega-text); }
:root[data-theme="dark"] .norja-header .bcl-header-wordmark { color: var(--bottega-text); }
:root[data-theme="dark"] .bottega-site .bottega-hero__copy .button--primary { background: #faf3e7; border-color: #faf3e7; color: var(--bottega-image-ink); }
:root[data-theme="dark"] .bottega-site .bottega-hero__copy .button--primary:hover { background: var(--bottega-category-capsules); border-color: var(--bottega-category-capsules); }
:root[data-theme="dark"] .bottega-hero__category:hover { color: var(--bottega-link); }
:root[data-theme="dark"] .bottega-hero__category[data-category="Pads"] { --hero-category-surface: #355640; }
:root[data-theme="dark"] .bottega-hero__category[data-category="Bohnen"] { --hero-category-surface: #3b5b49; }
:root[data-theme="dark"] .bottega-hero__category[data-category="Kapseln"] { --hero-category-surface: #304d3d; }
:root[data-theme="dark"] .bottega-hero__category[data-category="Maschinen"] { --hero-category-surface: #405c4c; }
:root[data-theme="dark"] .bottega-hero__category-media { color: #fff; }

/* Original packshots and manufacturer logos retain their original colours. */
:root[data-theme="dark"] .bottega-site .bottega-product { background: var(--bottega-surface-soft); border-color: var(--bottega-border); }
:root[data-theme="dark"] .bottega-site .bottega-product .bottega-product__visual { overflow: hidden; background: var(--bottega-image-surface); }
:root[data-theme="dark"] .bottega-site .bottega-product .bottega-product__tools button { background: #fffaf2; color: var(--bottega-image-ink); }
:root[data-theme="dark"] .bottega-site .bottega-product .bottega-product__tools button.is-active { color: #a0362b; }
:root[data-theme="dark"] :is(.product-gallery__main, .product-gallery__thumbs button, .product-lightbox__image, .compare-product__image, .coffee-finder__product-image, .drawer__item-media) { background: var(--bottega-image-surface); }
:root[data-theme="dark"] :is(.product-gallery, .bottega-product__media, .coffee-finder__product-image, .drawer__item-media) img { mix-blend-mode: normal; }
:root[data-theme="dark"] .brand-mark img { background-color: #f7f0e6; border-radius: 8px; }
:root[data-theme="dark"] .bottega-site .bottega-product .bottega-product__brand { color: var(--bottega-link); }
:root[data-theme="dark"] :is(.product-detail__desc, .product-information__panel, .product-information__description) { color: var(--bottega-text); }
:root[data-theme="dark"] .bottega-site .product-information__panel { background: var(--bottega-surface-raised); }
:root[data-theme="dark"] .bottega-product__stock-tooltip { background: #0b100b; color: #faf3e7; border-color: var(--bottega-control-border); }
:root[data-theme="dark"] .bottega-site .product-purchase-bar { background: var(--bottega-surface-raised); border-color: var(--bottega-border); color: var(--bottega-text); }

/* Consistent surfaces for content, forms and floating tools. */
:root[data-theme="dark"] :is(
  .legal-page__content, .customer-reviews__overview, .customer-reviews__card,
  .coffee-guide-landing__chapter, .coffee-guide-landing .content-guide-directory__grid > a,
  .search-overlay__form, .catalog-filter-dialog, .catalog-filter-dialog__search,
  .catalog-filter-dialog__option,
  .account-login-card, .account-login-panel, .account-orders li,
  .checkout-success, .checkout-summary, .checkout-handoff, .checkout-choice,
  .checkout-account-dialog, .product-specifications, .product-payment-methods
) { background: var(--bottega-surface-raised); border-color: var(--bottega-border); color: var(--bottega-text); }

:root[data-theme="dark"] :is(input:not([type="range"], [type="checkbox"], [type="radio"], [type="hidden"]), textarea, select) {
  background-color: var(--bottega-surface-raised);
  border-color: var(--bottega-control-border);
  color: var(--bottega-text);
  caret-color: var(--bottega-text);
  accent-color: var(--bottega-link);
}
:root[data-theme="dark"] :is(input, textarea)::placeholder { color: var(--bottega-text-muted); opacity: 1; }
:root[data-theme="dark"] :is(input, textarea, select):focus-visible { border-bottom-color: var(--bottega-focus) !important; caret-color: var(--bottega-text); }
:root[data-theme="dark"] input:-webkit-autofill { -webkit-text-fill-color: var(--bottega-text); box-shadow: 0 0 0 1000px var(--bottega-surface-raised) inset; }
:root[data-theme="dark"] :is(button, a)[aria-label]:has(> .icon):not(:has(> span, > strong)):focus-visible { color: var(--bottega-link-strong) !important; }

:root[data-theme="dark"] :is(.bottega-wp-content a, .coffee-finder__help a, .coffee-finder__format, .product-detail__brand, .product-detail__back, .catalog-description-sidebar a) { color: var(--bottega-link); }
:root[data-theme="dark"] .bottega-site :is(.button--primary, .bottega-product__add, .checkout-next, .checkout-submit, .account-login-button) { background: var(--bottega-accent); border-color: var(--bottega-accent); color: #faf3e7; }
:root[data-theme="dark"] .bottega-site :is(.button--primary, .bottega-product__add, .checkout-next, .checkout-submit, .account-login-button):hover { background: var(--bottega-accent-hover); border-color: var(--bottega-accent-hover); }
:root[data-theme="dark"] .bottega-site .link-button { color: var(--bottega-link-strong); }
:root[data-theme="dark"] .bottega-site :is(.bottega-product__badges a, .product-breadcrumbs a, .breadcrumbs a) { background: var(--bottega-surface-selected); border-color: var(--bottega-border); color: var(--bottega-text); }
:root[data-theme="dark"] :is(.catalog-reset, .catalog-sort__options button, .catalog-view button, .catalog-facet-trigger) { border-color: var(--bottega-control-border); color: var(--bottega-text); }
:root[data-theme="dark"] .catalog-filter-dialog__option[aria-pressed="true"] { background: var(--bottega-surface-selected); color: var(--bottega-text); border-color: var(--bottega-control-border); }
:root[data-theme="dark"] .catalog-filter-dialog { --size-dialog-border: var(--bottega-control-border); --size-dialog-active: var(--bottega-choice-active); --size-dialog-active-text: #faf3e7; }
:root[data-theme="dark"] .catalog-filter-dialog__option-sort { color: var(--bottega-text); }
:root[data-theme="dark"] .catalog-sidebar__choices .catalog-category-choice:hover { color: var(--bottega-link-strong); }
:root[data-theme="dark"] .catalog-popular h2 { color: var(--bottega-text); }
:root[data-theme="dark"] .catalog-facet.catalog-facet--search { background: var(--bottega-surface-raised); border-color: var(--bottega-control-border); color: var(--bottega-text); }
:root[data-theme="dark"] .catalog-facet.catalog-facet--search > .icon { color: var(--bottega-text-muted); }
:root[data-theme="dark"] .catalog-facet.catalog-facet--search input { background: transparent; color: var(--bottega-text); }
:root[data-theme="dark"] .catalog-facet.catalog-facet--search:focus-within { background: var(--bottega-surface-selected); border-color: var(--bottega-focus); }
:root[data-theme="dark"] .catalog-facet.catalog-facet--search input:focus-visible { background: transparent !important; }
:root[data-theme="dark"] :is(.catalog-description-sidebar, .catalog-description-sidebar__category) { color: var(--bottega-text); }
:root[data-theme="dark"] .catalog-description-sidebar :is(p, li, summary) { color: var(--bottega-text-muted); }

/* Checkout is the existing shared form, with the same state and totals. */
:root[data-theme="dark"] .bottega-site { --checkout-bg: var(--bottega-surface); --checkout-surface: var(--bottega-surface-raised); --checkout-text: var(--bottega-text); --checkout-muted: var(--bottega-text-muted); --checkout-line: var(--bottega-border); --checkout-accent: var(--bottega-accent); --checkout-accent-dark: var(--bottega-accent-hover); }
:root[data-theme="dark"] .checkout-refresh :is(.checkout-handoff, .checkout-summary, .checkout-account-dialog, .checkout-choice, .checkout-demo-payment select) { background: var(--bottega-surface-raised); color: var(--bottega-text); }
:root[data-theme="dark"] .checkout-refresh :is(.checkout-choice:has(input:checked), .checkout-step__number.is-complete, .checkout-payment__delivery) { background: var(--bottega-surface-selected); color: var(--bottega-text); }
:root[data-theme="dark"] .checkout-refresh :is(.checkout-error, .checkout-field__error, .checkout-error-summary) { background: var(--bottega-error-surface); color: var(--bottega-error); border-color: #a06c5f; }
:root[data-theme="dark"] .checkout-refresh :is(.checkout-address-extra > summary, .checkout-step__edit, .checkout-account-link button, .checkout-account-dialog__message, .checkout-account-dialog__alternatives button, .checkout-account-dialog__guest) { color: var(--bottega-link); }
:root[data-theme="dark"] .checkout-refresh :is(.checkout-order-line, .checkout-order-line .qty-control, .checkout-order-line .qty-control button, .checkout-order-line .qty-control span, .checkout-account-dialog__social button) { background: var(--bottega-surface-raised); color: var(--bottega-text); border-color: var(--bottega-border); }
:root[data-theme="dark"] .checkout-refresh .checkout-order-line__media { background: var(--bottega-image-surface); }
:root[data-theme="dark"] .checkout-refresh .checkout-live-methods__logos { padding: 6px; border-radius: 8px; background: var(--bottega-image-surface); }
:root[data-theme="dark"] .bottega-site :is(.cart-bundle-benefit, .product-bundle-benefit, .coffee-guide-tool__results > div, .customer-reviews__summary) { color: var(--bottega-link-strong); }

/* Drawers and sales dialogs also live outside StoreShell. */
:root[data-theme="dark"] #cart-drawer,
:root[data-theme="dark"] #cart-drawer :is(.drawer__header, .drawer__content, .drawer__shipping, .drawer__footer) { background: var(--bottega-surface-soft); color: var(--bottega-text); border-color: var(--bottega-border); }
:root[data-theme="dark"] #cart-drawer :is(h2, h3, strong, .drawer__line, .qty-control, .qty-control button) { color: var(--bottega-text); }
:root[data-theme="dark"] #cart-drawer :is(.drawer__count, .drawer__item-size, .drawer__item-warehouse, .drawer__item-unit, .drawer__shipping p, .drawer__footer > p, .drawer__remove, .drawer__close) { color: var(--bottega-text-muted); }
:root[data-theme="dark"] #cart-drawer :is(.drawer__warehouse-plan, .qty-control, .qty-control button, .drawer__continue) { background: var(--bottega-surface-raised); border-color: var(--bottega-border); color: var(--bottega-text); }
:root[data-theme="dark"] #cart-drawer .drawer__saving { background: var(--bottega-surface-selected); color: var(--bottega-success); }
:root[data-theme="dark"] #cart-drawer .cart-bundle-benefit { color: var(--bottega-link-strong); }
:root[data-theme="dark"] #cart-drawer .drawer__warehouse-chips span { background: var(--bottega-surface-raised); color: var(--bottega-text); border-color: var(--bottega-border); }
:root[data-theme="dark"] #cart-drawer .drawer__warehouse-plan.is-blocked { background: var(--bottega-error-surface); color: var(--bottega-error); }
:root[data-theme="dark"] #cart-drawer .drawer__shipping-track { background: var(--bottega-border); }
:root[data-theme="dark"] #cart-drawer .drawer__shipping-track span { background: var(--bottega-link); }
:root[data-theme="dark"] #cart-drawer .drawer__recommendation { background: var(--bottega-surface-raised); border-color: var(--bottega-border); color: var(--bottega-text); }
:root[data-theme="dark"] #cart-drawer .drawer__recommendation-image { background: var(--bottega-image-surface); }
:root[data-theme="dark"] #cart-drawer .drawer__recommendation-info h4 a:hover { color: var(--bottega-link); }
:root[data-theme="dark"] #cart-drawer .drawer__recommendation-more { background: var(--bottega-surface-selected); border-color: var(--bottega-control-border); color: var(--bottega-link-strong); }
:root[data-theme="dark"] #cart-drawer .drawer__recommendation-more:hover { background: var(--bottega-surface-raised); border-color: var(--bottega-focus); color: var(--bottega-link-strong); }
:root[data-theme="dark"] #cart-drawer .button--primary { background: var(--bottega-accent); color: #faf3e7; }
:root[data-theme="dark"] :is(.sales-slide, .sales-stock, .sales-mail) { background: var(--bottega-surface-soft); color: var(--bottega-text); border-color: var(--bottega-border); }
:root[data-theme="dark"] :is(.sales-newsletter, .sales-stock, .sales-save) input:not([type="checkbox"]) { background: var(--bottega-surface-raised); color: var(--bottega-text); border-color: var(--bottega-control-border); }
:root[data-theme="dark"] :is(.sales-newsletter details > summary, .sales-stock > summary) { color: var(--bottega-link-strong); }
:root[data-theme="dark"] .sales-error { background: var(--bottega-error-surface); color: var(--bottega-error); }

:root[data-theme="dark"] .account-page { background: transparent; color: var(--bottega-text); }
:root[data-theme="dark"] .account-page :is(.account-login-panel h1, .account-login-form > label, .account-login-security strong, .account-orders h2, .account-orders__detail h3) { color: var(--bottega-text); }
:root[data-theme="dark"] .account-page :is(.account-login-provider, .account-login-security, .account-orders__more) { background: var(--bottega-surface-soft); color: var(--bottega-text); border-color: var(--bottega-border); }
:root[data-theme="dark"] .account-page :is(.account-login-remember, .account-login-register, .account-orders p, .account-orders li > div span) { color: var(--bottega-text-muted); }
:root[data-theme="dark"] :is(.account-login-error, .coffee-guide-tool .coffee-guide-tool__error) { color: var(--bottega-error); }
:root[data-theme="dark"] :is(.account-login-message, .account-orders__details-button) { color: var(--bottega-link); }
:root[data-theme="dark"] .compare-page .compare-table :is(th, td) { background-color: var(--bottega-surface-soft); color: var(--bottega-text); border-color: var(--bottega-border); }
:root[data-theme="dark"] .compare-page .compare-table thead th { background: var(--bottega-surface-raised); }
:root[data-theme="dark"] .customer-reviews__stars > span:last-child { color: #e4be85; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}
