/* Webs Shop 3.3.37 — strict contrast layer.
   Principle: neutral surfaces get deterministic text; branded/inverted surfaces keep explicit theme colors. */
body[class*="template-"]{
  --cg-surface:#FFFFFF;--cg-text:#172024;--cg-muted:#5E6B70;--cg-border:#D7DFE2;
}
html[data-theme="dark"] body[class*="template-"]{
  --cg-surface:#171D20;--cg-text:#F0F4F5;--cg-muted:#AAB5B9;--cg-border:#36434A;
}
/* Theme-native neutral tokens. */
body.template-basic,body.template-modern,body.template-beauty,body.template-home,body.template-pet,body.template-tools,body.template-auto,body.template-kids,body.template-outdoor,body.template-gifts,body.template-health,body.template-gaming,body.template-coffee,body.template-jewelry,body.template-garden{
  --cg-theme-text:var(--t-ink);--cg-theme-muted:var(--t-muted);--cg-theme-card:var(--t-card);--cg-theme-line:var(--t-line)
}
body.template-classic{--cg-theme-text:#111820;--cg-theme-muted:#667580;--cg-theme-card:#FFFFFF;--cg-theme-line:#DFE6EB}
body.template-boutique{--cg-theme-text:#2B211E;--cg-theme-muted:#746861;--cg-theme-card:#FFFDFB;--cg-theme-line:#DED2CB}
body.template-luxury{--cg-theme-text:#211F1A;--cg-theme-muted:#716B60;--cg-theme-card:#FFFDF8;--cg-theme-line:#DED8CB}
body.template-harvest{--cg-theme-text:#263C2B;--cg-theme-muted:#667363;--cg-theme-card:#FFFDF5;--cg-theme-line:#DCE1C9}
body.template-pulse{--cg-theme-text:#101010;--cg-theme-muted:#60605C;--cg-theme-card:#FFFFFF;--cg-theme-line:#D7D7D1}
html[data-theme="dark"] body.template-classic{--cg-theme-text:#EDF3F6;--cg-theme-muted:#AAB6BE;--cg-theme-card:#111920;--cg-theme-line:#33414B}
html[data-theme="dark"] body.template-boutique{--cg-theme-text:#F1E8E3;--cg-theme-muted:#B2A39B;--cg-theme-card:#29221F;--cg-theme-line:#4B3F39}
html[data-theme="dark"] body.template-luxury{--cg-theme-text:#F3EFE4;--cg-theme-muted:#B2AC9E;--cg-theme-card:#201F1B;--cg-theme-line:#454137}
html[data-theme="dark"] body.template-harvest{--cg-theme-text:#EDF2E8;--cg-theme-muted:#B0BAAD;--cg-theme-card:#243027;--cg-theme-line:#435247}
html[data-theme="dark"] body.template-pulse{--cg-theme-text:#F2F2EE;--cg-theme-muted:#B5B5AE;--cg-theme-card:#181818;--cg-theme-line:#444}

/* Only genuinely neutral surfaces. Branded newsletter/category/promo/hero surfaces are intentionally excluded. */
body[class*="template-"] :is(.card,.review-card,.blog-home-card,.recent-card,.product-layout,.summary,.account-card,.page-content,.ptab-panel,.hero-spotlight):not(.category-card-all){color:var(--cg-theme-text,var(--cg-text))}
body[class*="template-"] :is(.card,.review-card,.blog-home-card,.recent-card,.product-layout,.summary,.account-card,.page-content,.ptab-panel,.hero-spotlight):not(.category-card-all) :is(h1,h2,h3,h4,h5,h6,strong,b,.card-title,.price,label){color:var(--cg-theme-text,var(--cg-text))}
body[class*="template-"] :is(.card,.review-card,.blog-home-card,.recent-card,.product-layout,.summary,.account-card,.page-content,.ptab-panel,.hero-spotlight):not(.category-card-all) :is(p,small,.muted,.meta,.card-cat,.old-price,.product-meta){color:var(--cg-theme-muted,var(--cg-muted))}

/* Standard category cards; special all-category cards are handled below. */
body[class*="template-"] .category-card:not(.category-card-all){color:var(--cg-theme-text,var(--cg-text))}
body[class*="template-"] .category-card:not(.category-card-all) .category-card-body strong{color:var(--cg-theme-text,var(--cg-text))}
body[class*="template-"] .category-card:not(.category-card-all) .category-card-body span{color:var(--cg-theme-muted,var(--cg-muted))}
/* Base all-category card uses a dark media treatment. */
body[class*="template-"] .category-card-all .category-card-media{color:#F7FAFA}
body[class*="template-"] .category-card-all .category-card-media :is(svg,i,strong,span){color:#F7FAFA}
/* Theme-specific all-category body surfaces. */
body.template-classic .category-card-all .category-card-body,body.template-luxury .category-card-all .category-card-body{background:#151715;color:#F6F4ED}
body.template-classic .category-card-all .category-card-body :is(strong,span),body.template-luxury .category-card-all .category-card-body :is(strong,span){color:#F6F4ED}
body.template-boutique .category-card-all .category-card-body{background:#CBB2A6;color:#30231E}
body.template-boutique .category-card-all .category-card-body :is(strong,span){color:#30231E}

/* Dark/inverted hero copy — explicit and independent of generic cards. */
body.template-classic .hero-final-copy,body.template-luxury .hero-final-copy,body.template-pulse .hero-final-copy,body.template-tools .hero-final-copy,body.template-auto .hero-final-copy,body.template-gaming .hero-final-copy,body.template-coffee .hero-final-copy,body.template-jewelry .hero-final-copy,body.template-garden .hero-final-copy{color:#F7FAFA}
body.template-classic .hero-final-copy :is(h1,h2,h3,strong,b),body.template-luxury .hero-final-copy :is(h1,h2,h3,strong,b),body.template-pulse .hero-final-copy :is(h1,h2,h3,strong,b),body.template-tools .hero-final-copy :is(h1,h2,h3,strong,b),body.template-auto .hero-final-copy :is(h1,h2,h3,strong,b),body.template-gaming .hero-final-copy :is(h1,h2,h3,strong,b),body.template-coffee .hero-final-copy :is(h1,h2,h3,strong,b),body.template-jewelry .hero-final-copy :is(h1,h2,h3,strong,b),body.template-garden .hero-final-copy :is(h1,h2,h3,strong,b){color:#F7FAFA!important}
body.template-classic .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-luxury .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-pulse .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-tools .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-auto .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-gaming .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-coffee .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-jewelry .hero-final-copy :is(p,.hero-proof,.muted,small),body.template-garden .hero-final-copy :is(p,.hero-proof,.muted,small){color:#C5D0D3!important}
body.template-luxury .hero-final-copy h1{color:#F4F0E7!important}body.template-luxury .hero-final-copy p{color:#BDB8AE!important}
body.template-pulse .hero-final-copy h1{color:#F8F8F3!important}body.template-pulse .hero-final-copy p{color:#D0D0C8!important}
body.template-coffee .hero-final-copy p{color:#DCC9BA!important}body.template-jewelry .hero-final-copy p{color:#CFC7BA!important}body.template-garden .hero-final-copy p{color:#CFDDD2!important}

/* Hero product overlays on photography/dark image masks. */
body.template-luxury .hero-slide-info,body.template-luxury .hero-slide-info :is(strong,b,a,small),body.template-boutique .hero-spotlight-head{color:#FFFFFF!important}

/* Branded newsletters: never inherit neutral card text. */
body.template-classic .newsletter-box{color:#F5F8F9!important}body.template-classic .newsletter-box :is(h1,h2,h3,strong,b,label){color:#F5F8F9!important}body.template-classic .newsletter-box p{color:#B6C2C8!important}
body.template-luxury .newsletter-box{color:#F2EEE5!important}body.template-luxury .newsletter-box :is(h1,h2,h3,strong,b,label){color:#F2EEE5!important}body.template-luxury .newsletter-box p{color:#B8B3A8!important}
body.template-pulse .newsletter-box{color:#FFFFFF!important}body.template-pulse .newsletter-box :is(h1,h2,h3,strong,b,label,p){color:#FFFFFF!important}
body.template-boutique .newsletter-box{color:#2E231F!important}body.template-boutique .newsletter-box :is(h1,h2,h3,strong,b,label,p){color:#2E231F!important}
body.template-harvest .newsletter-box{color:#3D311F!important}body.template-harvest .newsletter-box :is(h1,h2,h3,strong,b,label,p){color:#3D311F!important}
/* Generated niche themes use their own t-card/t-ink newsletter surface. */
body.template-basic .newsletter-box,body.template-modern .newsletter-box,body.template-beauty .newsletter-box,body.template-home .newsletter-box,body.template-pet .newsletter-box,body.template-tools .newsletter-box,body.template-auto .newsletter-box,body.template-kids .newsletter-box,body.template-outdoor .newsletter-box,body.template-gifts .newsletter-box,body.template-health .newsletter-box,body.template-gaming .newsletter-box,body.template-coffee .newsletter-box,body.template-jewelry .newsletter-box,body.template-garden .newsletter-box{color:var(--t-ink)}
body.template-basic .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-modern .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-beauty .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-home .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-pet .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-tools .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-auto .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-kids .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-outdoor .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-gifts .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-health .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-gaming .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-coffee .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-jewelry .newsletter-box :is(h1,h2,h3,strong,b,label,p),body.template-garden .newsletter-box :is(h1,h2,h3,strong,b,label,p){color:var(--t-ink)}
html[data-theme="dark"] body.template-basic .newsletter-box,html[data-theme="dark"] body.template-modern .newsletter-box,html[data-theme="dark"] body.template-beauty .newsletter-box,html[data-theme="dark"] body.template-home .newsletter-box,html[data-theme="dark"] body.template-pet .newsletter-box,html[data-theme="dark"] body.template-tools .newsletter-box,html[data-theme="dark"] body.template-auto .newsletter-box,html[data-theme="dark"] body.template-kids .newsletter-box,html[data-theme="dark"] body.template-outdoor .newsletter-box,html[data-theme="dark"] body.template-gifts .newsletter-box,html[data-theme="dark"] body.template-health .newsletter-box,html[data-theme="dark"] body.template-gaming .newsletter-box,html[data-theme="dark"] body.template-coffee .newsletter-box,html[data-theme="dark"] body.template-jewelry .newsletter-box,html[data-theme="dark"] body.template-garden .newsletter-box{color:var(--t-ink)}

/* Trust strips are inverted in the majority of themes. */
body[class*="template-"] .trust-strip .trust-item :is(strong,b){color:#F6F9F9}
body[class*="template-"] .trust-strip .trust-item :is(span,p,small){color:#C0CBCE}
/* Boutique intentionally has a light trust strip. */
body.template-boutique .trust-strip .trust-item :is(strong,b){color:#3A2E29}
body.template-boutique .trust-strip .trust-item :is(span,p,small){color:#70625B}

/* Menus/modals/drawers are neutral application surfaces. */
body[class*="template-"] :is(.mega-menu,.sub,.modal-card,.drawer,.cart-drawer,.quick-view-modal){background:var(--cg-surface);color:var(--cg-text);border-color:var(--cg-border)}
body[class*="template-"] :is(.mega-menu,.sub,.modal-card,.drawer,.cart-drawer,.quick-view-modal) :is(h1,h2,h3,h4,strong,b,a,label,.price,.card-title){color:var(--cg-text)}
body[class*="template-"] :is(.mega-menu,.sub,.modal-card,.drawer,.cart-drawer,.quick-view-modal) :is(p,small,.muted,.meta){color:var(--cg-muted)}
/* Mega intro is an intentionally inverted sub-panel. */
body[class*="template-"] .mega-intro,body[class*="template-"] .mega-intro :is(h1,h2,h3,strong,b,a){color:#FFFFFF}
body[class*="template-"] .mega-intro :is(p,small,.muted){color:#C5CED2}
body.template-boutique .mega-intro,body.template-boutique .mega-intro :is(h1,h2,h3,strong,b,a,p,small,.muted){color:#392D28}

/* Forms: readable in both modes. Newsletter exceptions preserve branded surface while form itself stays legible. */
body[class*="template-"] :is(input,select,textarea){background:#FFFFFF;color:#172024;border-color:#CBD5D8}
body[class*="template-"] :is(input,textarea)::placeholder{color:#68767C;opacity:1}
body[class*="template-"] select option{background:#FFFFFF;color:#172024}
html[data-theme="dark"] body[class*="template-"] :is(input,select,textarea){background:#12181B;color:#F1F5F6;border-color:#3A474D}
html[data-theme="dark"] body[class*="template-"] :is(input,textarea)::placeholder{color:#A2ADB1}
html[data-theme="dark"] body[class*="template-"] select option{background:#12181B;color:#F1F5F6}
body.template-classic .newsletter-box input{background:#FFFFFF;color:#172024}body.template-luxury .newsletter-box input{background:#151513;color:#FFFFFF;border-color:#666158}body.template-boutique .newsletter-box input{background:transparent;color:#2E231F}body.template-harvest .newsletter-box input{background:#FFF8E9;color:#3D311F}

/* Buttons use computed accent ink from the shop palette; ghost buttons keep their component's current foreground. */
body[class*="template-"] .btn:not(.ghost):not(.red),body[class*="template-"] .cart-btn{color:var(--accent-ink,#FFFFFF)!important}
body[class*="template-"] .btn.ghost{border-color:currentColor}

/* Footer is always inverted and must not inherit card/body colors. */
body[class*="template-"] .site-footer,body[class*="template-"] .site-footer :is(h1,h2,h3,h4,h5,strong,b,.footer-logo){color:#F4F7F7}
body[class*="template-"] .site-footer :is(p,a,li,small,span){color:#C0C9CC}
body[class*="template-"] .site-footer a:hover,body[class*="template-"] .site-footer a:focus-visible{color:#FFFFFF}

/* Accessibility states. */
body[class*="template-"] :focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 72%,#FFFFFF);outline-offset:3px}
@media(prefers-reduced-motion:reduce){body[class*="template-"] *,body[class*="template-"] *::before,body[class*="template-"] *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}

/* v3.3.38 runtime-backed neutral-surface contrast.
   The runtime measures the final rendered background; this fixes both dark-on-dark and light-on-light. */
body[class*="template-"] [data-auto-contrast="1"]{color:var(--auto-surface-text)!important}
body[class*="template-"] [data-auto-contrast="1"] :is(h1,h2,h3,h4,h5,h6,strong,b,.card-title,.price,label,.trust-copy strong){color:var(--auto-local-text,var(--auto-surface-text))!important}
body[class*="template-"] [data-auto-contrast="1"] :is(p,small,.muted,.meta,.card-cat,.old-price,.product-meta,.trust-copy span){color:var(--auto-local-muted,var(--auto-surface-muted))!important}
/* USP/trust blocks are always measured individually because their backgrounds vary radically by theme/mode. */
body[class*="template-"] .trust-item[data-auto-contrast="1"] .trust-copy strong{color:var(--auto-surface-text)!important}
body[class*="template-"] .trust-item[data-auto-contrast="1"] .trust-copy span{color:var(--auto-surface-muted)!important}
body[class*="template-"] .trust-item[data-auto-contrast="1"] .trust-icon{color:var(--accent)!important}
