/* ===================================================================
   MIROCART COLOR LOCK
   Forces the Gasp palette across all vendor and plugin components.
   Low specificity (:where) to allow component-level overrides.
   =================================================================== */

:where(html, body) {
    background-color: var(--surface-base);
    color: var(--text-primary);
}

:where(h1, h2, h3, h4, h5, h6) {
    color: var(--text-primary);
}

:where(a) {
    color: var(--link-body);
}

:where(a:hover, a:focus-visible) {
    color: var(--link-body-hover);
}

:where(button, 
       input[type="button"], 
       input[type="reset"], 
       input[type="submit"], 
       .button, 
       .btn-gasp) {
    color: var(--text-primary);
    background-color: var(--surface-utility);
    border-color: var(--border-default);
}

:where(input[type="text"], 
       input[type="email"], 
       input[type="url"], 
       input[type="password"], 
       input[type="search"], 
       input[type="number"], 
       input[type="tel"], 
       input[type="range"], 
       input[type="date"], 
       input[type="month"], 
       input[type="week"], 
       input[type="time"], 
       input[type="datetime"], 
       input[type="datetime-local"], 
       input[type="color"], 
       textarea, 
       select) {
    color: var(--text-primary);
    background-color: var(--surface-base);
    border-color: var(--border-default);
}

:where(fieldset, legend) {
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

:where(hr) {
    background-color: var(--border-subtle);
    border: none;
    height: 1px;
}

:where(table, th, td) {
    border-color: var(--border-subtle);
}

:where(blockquote) {
    border-left-color: var(--border-strong);
    color: var(--text-secondary);
}

/* WooCommerce Specific Overrides to ensure they follow the lock */
:where(.woocommerce-message, 
       .woocommerce-info, 
       .woocommerce-error, 
       .woocommerce-noreviews, 
       p.no-comments) {
    background-color: var(--surface-utility);
    color: var(--text-primary);
    border-top-color: var(--accent-gold);
}

:where(.woocommerce-breadcrumb) {
    color: var(--text-muted);
}

:where(.woocommerce-breadcrumb a) {
    color: var(--text-secondary);
}

:where(.woocommerce-pagination ul li a, 
       .woocommerce-pagination ul li span) {
    background-color: var(--surface-base);
    color: var(--text-primary);
    border-color: var(--border-default);
}

/* Increase specificity only where vendor styles are known to be aggressive */
:where(.entry-content, .woocommerce-page:not(.archive):not(.shop) .woocommerce) a:not(.button):not(.icon-btn) {
    color: var(--link-body);
    border-bottom-color: var(--link-body-underline);
}

:where(.entry-content, .woocommerce-page:not(.archive):not(.shop) .woocommerce) a:not(.button):not(.icon-btn):hover {
    color: var(--link-body-hover);
    border-bottom-color: var(--link-body-underline-hover);
}

/* Force consistency on focus states */
:where(*:focus-visible) {
    outline-color: var(--focus-outline);
}
