/* Shared icon contrast tokens. Custom store colors remain authoritative. */
body.storefront-page, body.admin-page {
  --icon-default: var(--font, #222222);
  --icon-secondary: var(--muted, var(--font, #525252));
  --icon-accent: color-mix(in srgb, var(--main, #765c46) 67%, var(--font, #222222) 33%);
  --icon-success-fixed: #16834b;
  --icon-warning-fixed: #a9670d;
  --icon-danger-fixed: #ca3a45;
  --icon-info-fixed: #206bc4;
}
body[data-theme="dark"], html[data-theme="dark"] body {
  --icon-success-fixed: #4ade80;
  --icon-warning-fixed: #fbbf24;
  --icon-danger-fixed: #fb7185;
  --icon-info-fixed: #7db8ff;
}
/* Never force the color of every SVG: branding and multicolor icons are preserved. */
body.storefront-page :is(.site-header, .site-footer, .site-navigation, .header-actions, .sf-storefront) :is(.ui-icon, .lucide, .iconify, .fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands),
body.admin-page :is(.admin-sidebar, .admin-navbar, .admin-app) :is(.ui-icon, .lucide, .iconify, .fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands) {
  color: inherit;
}
/* Neutral icon holders: use readable foreground rather than unblended accent paint. */
body :is(.icon-button, .navigation-toggle, .header-icon-button, .sf-carousel-arrow, .sf-search-field, .sf-sort-field) :is(svg, i, .ui-icon, .lucide),
body :is(.site-navigation a, .header-actions button, .header-actions a, .admin-sidebar a) :is(svg, i, .ui-icon, .lucide) {
  color: inherit;
}
/* Theme-colored icons are mixed with text for sufficient distinction even with pastel custom colors. */
body :is(.sf-empty-icon, .sf-help-icon, .sf-purchase-avatar, .appearance-eyebrow, .appearance-section-number) :is(svg, i, .ui-icon, .lucide),
body :is(.sf-empty-icon, .sf-help-icon, .sf-purchase-avatar) { color: var(--icon-accent); }
/* Status colors intentionally stay semantic across site palette settings. */
body :is(.text-success, .icon-success, [data-icon-tone="success"]) :is(svg, i, .ui-icon, .lucide),
body :is(i, svg).text-success, body :is(i, svg).icon-success { color: var(--icon-success-fixed) !important; }
body :is(.text-danger, .icon-danger, [data-icon-tone="danger"]) :is(svg, i, .ui-icon, .lucide),
body :is(i, svg).text-danger, body :is(i, svg).icon-danger { color: var(--icon-danger-fixed) !important; }
body :is(.text-warning, .icon-warning, [data-icon-tone="warning"]) :is(svg, i, .ui-icon, .lucide),
body :is(i, svg).text-warning, body :is(i, svg).icon-warning { color: var(--icon-warning-fixed) !important; }
body :is(.text-info, .icon-info, [data-icon-tone="info"]) :is(svg, i, .ui-icon, .lucide),
body :is(i, svg).text-info, body :is(i, svg).icon-info { color: var(--icon-info-fixed) !important; }
/* Icons on filled accent buttons follow the matching button label, not the page's text color. */
body :is(.button-primary, .btn-primary, .appearance-preview-body button) :is(svg, i, .ui-icon, .lucide) { color: inherit; }
/* Outline SVG icons should inherit stroke from their readable parent. */
body :is(.site-header, .site-navigation, .header-actions, .admin-sidebar, .icon-button) svg.lucide,
body :is(.sf-empty-icon, .sf-help-icon, .sf-purchase-avatar) svg.lucide { stroke: currentColor; }
/* Explicit contrast utility classes for newly added icons. */
.icon-tone-default { color: var(--icon-default) !important; }
.icon-tone-secondary { color: var(--icon-secondary) !important; }
.icon-tone-accent { color: var(--icon-accent) !important; }
.icon-tone-success { color: var(--icon-success-fixed) !important; }
.icon-tone-warning { color: var(--icon-warning-fixed) !important; }
.icon-tone-danger { color: var(--icon-danger-fixed) !important; }
.icon-tone-info { color: var(--icon-info-fixed) !important; }
