/* Gando 9.7.60 — unified dark-mode consistency layer.
   Root causes addressed here:
   1) semantic tokens changed in dark mode while later component CSS still used
      literal light surfaces/foregrounds;
   2) native controls/status chips were not consistently inheriting dark tokens;
   3) some archive/search/drawer/content controls were added after earlier dark
      audits and therefore escaped the existing component overrides.
   Product/media canvases that intentionally stay light are NOT normalized. */

html[data-theme="dark"]{
  color-scheme:dark;
  --surface:var(--paper,#141b16);
  --surface-raised:#172019;
  --surface-soft:var(--soft,#17221a);
  --surface-input:#101713;
  --text:var(--ink,#f1f5f2);
  --text-muted:var(--mut,#a0aaa3);
  --border:var(--line,#2a342d);
  --accent-soft:#1b3022;
  --accent-text:#b9e1c5;
  --danger-soft:#2d1716;
  --danger-text:#ffaaa2;
  --warning-soft:#2b2414;
  --warning-text:#f0d18a;
}

/* Native controls: keep browser widgets, placeholder and labels on the same
   semantic surface. Media/product color inputs are deliberately excluded. */
html[data-theme="dark"] body :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  select,
  textarea
){
  color:var(--text);
  caret-color:var(--text);
  border-color:var(--border);
}
html[data-theme="dark"] body :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  textarea
)::placeholder{color:#84938a;opacity:1}
html[data-theme="dark"] body select option{background:#101713;color:var(--text)}
html[data-theme="dark"] body :where(input,select,textarea):disabled{color:#7f8d84;opacity:.72}

/* Catalog/archive UI — semantic surfaces rather than light literals. */
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .drawer-footer,
html[data-theme="dark"] .drawer-close,
html[data-theme="dark"] .filter-options button,
html[data-theme="dark"] .filter-btn:not(.on),
html[data-theme="dark"] .sort-btn,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .seo-box,
html[data-theme="dark"] .catalog-sort,
html[data-theme="dark"] .catalog-sort__trigger,
html[data-theme="dark"] .catalog-sort__menu,
html[data-theme="dark"] .catalog-load-more :is(button,a){
  background:var(--surface-raised)!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .drawer-footer{box-shadow:0 -12px 24px rgba(0,0,0,.16)}
html[data-theme="dark"] .drawer-head,
html[data-theme="dark"] .filter-section{border-color:var(--border)}
html[data-theme="dark"] .filter-section h4,
html[data-theme="dark"] .catalog-result b,
html[data-theme="dark"] .seo-box summary{color:var(--text)!important}
html[data-theme="dark"] .catalog-sort>span,
html[data-theme="dark"] .catalog-sort>.ui-icon,
html[data-theme="dark"] .catalog-load-more :is(button,a)>small,
html[data-theme="dark"] .seo-box p{color:var(--text-muted)!important}
html[data-theme="dark"] .active-filter{background:#203128;color:#bde2c8}
html[data-theme="dark"] .pill:hover{background:#1d2a22;color:#c8e7d1}
html[data-theme="dark"] .pill.active,
html[data-theme="dark"] .filter-options button.on{background:#2c7147!important;border-color:#2c7147!important;color:#fff!important}
html[data-theme="dark"] .catalog-load-more :is(button,a):hover{background:#1d2a22!important;border-color:#42584a!important}

/* Term content / authored content labels. */
html[data-theme="dark"] .tax-product_cat .category-term-description__inner,
html[data-theme="dark"] .tax-product_cat .category-term-description__content{color:var(--text-muted)}
html[data-theme="dark"] .tax-product_cat .category-term-description__content :where(h2,h3,h4,strong,b){color:var(--text)}
html[data-theme="dark"] .tax-product_cat .category-term-description__content a{color:var(--accent-text)}

/* Search/auth modal and generic overlays. */
html[data-theme="dark"] .ui-modal,
html[data-theme="dark"] .search-modal,
html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] .search-modal__field,
html[data-theme="dark"] .quick-tags a,
html[data-theme="dark"] .search-products>a,
html[data-theme="dark"] .auth-panel input{
  background:var(--surface-raised)!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .auth-panel label,
html[data-theme="dark"] .auth-panel p,
html[data-theme="dark"] .auth-footer,
html[data-theme="dark"] .quick-tags>span,
html[data-theme="dark"] .search-products small{color:var(--text-muted)!important}
html[data-theme="dark"] .auth-tabs button.active{background:#223027!important;color:#bfe4ca!important;box-shadow:none!important}
html[data-theme="dark"] .search-products img{background:#f1f0ec} /* intentional product-image canvas */

/* WooCommerce notices/forms rendered by the theme. */
html[data-theme="dark"] .woocommerce-message,
html[data-theme="dark"] .woocommerce-info{
  background:#14231a;
  border-color:#31503c;
  color:#c8e6d1;
}
html[data-theme="dark"] .woocommerce-error{
  background:var(--danger-soft);
  border-color:#5a302c;
  color:var(--danger-text);
}
html[data-theme="dark"] .woocommerce :where(.form-row,label){color:var(--text)}
html[data-theme="dark"] .woocommerce :where(.input-text,select,textarea){background:var(--surface-input);border-color:var(--border);color:var(--text)}

/* Coupon/cart labels that still carried light-theme green/gray literals. */
html[data-theme="dark"] .gando-cart-coupon,
html[data-theme="dark"] .gando-cart-coupon__applied-item,
html[data-theme="dark"] .gando-quick-cart-coupon__applied-item{
  background:#132019!important;
  border-color:#294332!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .gando-cart-coupon__copy strong,
html[data-theme="dark"] .gando-quick-cart-coupon__form>label{color:var(--text)!important}
html[data-theme="dark"] .gando-cart-coupon__copy p,
html[data-theme="dark"] .gando-cart-coupon__applied-item small,
html[data-theme="dark"] .gando-quick-cart-coupon__applied-copy small{color:#9eaca3!important}

/* Common content cards added by page-specific modules. Page-specific dark rules
   still win when they intentionally use another tone. */
html[data-theme="dark"] :where(
  .article-intro-card,
  .article-note,
  .article-checklist li,
  .article-hero__facts>div,
  .static-card,
  .faq-list details,
  .gando-care-step,
  .gando-care-faq details
){border-color:var(--border)}

/* Focus visibility remains high in both themes. */
html[data-theme="dark"] body :where(a,button,input,select,textarea,summary):focus-visible{
  outline-color:rgba(255,163,0,.58);
}

/* 9.7.79: avoid applying a global transition to every control when the root theme changes.
   Components keep their own hover/focus transitions; theme swaps are handled atomically. */

