/*
 * FABIFY 3D LIGHT MODE LOCK — 1.5.0
 * Light color-scheme prevents native controls / browser auto darkening.
 * Do not invert images, recolor design components, or globally alter typography.
 */
:root,
html.fabify-light-lock,
html.fabify-light-lock body {
    color-scheme: light !important;
    color-scheme: only light !important;
}

/* Restrict native browser recoloring on nested controls and sections. This
   property does NOT overwrite authored colors, backgrounds, logos or images. */
html.fabify-light-lock body,
html.fabify-light-lock body * {
    color-scheme: light !important;
    color-scheme: only light !important;
}

/* This option is intentionally scoped to the page canvas, not content sections. */
html.fabify-light-lock--white-canvas,
html.fabify-light-lock--white-canvas body {
    background-color: #fff !important;
}

@media (prefers-color-scheme: dark) {
    /* Native form controls / WooCommerce light surfaces. No global div backgrounds. */
    html.fabify-light-lock :where(
        .woocommerce form .input-text,
        .woocommerce form input[type="text"],
        .woocommerce form input[type="email"],
        .woocommerce form input[type="tel"],
        .woocommerce form input[type="password"],
        .woocommerce form input[type="number"],
        .woocommerce form select,
        .woocommerce form textarea,
        .woocommerce-page form .input-text,
        .woocommerce-page form select,
        .woocommerce-page form textarea,
        .elementor-form input:not([type="submit"]):not([type="button"]),
        .elementor-form textarea,
        .elementor-form select,
        .comment-form input:not([type="submit"]),
        .comment-form textarea,
        .wp-block-search__input,
        .wp-block-woocommerce-checkout input,
        .wp-block-woocommerce-checkout select,
        .wp-block-woocommerce-checkout textarea,
        .wc-block-components-text-input input,
        .wc-block-components-combobox input,
        .wc-block-components-textarea,
        .select2-container--default .select2-selection--single,
        .select2-container--default .select2-selection--multiple,
        .select2-dropdown
    ) {
        color-scheme: light !important;
    color-scheme: only light !important;
        background-color: #fff !important;
        color: #243444 !important;
        -webkit-text-fill-color: #243444;
    }

    html.fabify-light-lock :where(
        .woocommerce table.shop_table,
        .woocommerce table.shop_table tbody,
        .woocommerce .cart_totals,
        .woocommerce form.checkout_coupon,
        .woocommerce form.login,
        .woocommerce form.register,
        .woocommerce-checkout #payment,
        .woocommerce .woocommerce-checkout-review-order,
        .wc-block-cart__main,
        .wc-block-components-sidebar-layout .wc-block-components-sidebar,
        .wc-block-components-order-summary,
        .wc-block-components-totals-wrapper,
        .woocommerce-MyAccount-content,
        .woocommerce .woocommerce-MyAccount-navigation
    ) {
        color-scheme: light !important;
    color-scheme: only light !important;
        background-color: #fff !important;
    }
    html.fabify-light-lock :where(
        .woocommerce table.shop_table,
        .woocommerce form.checkout_coupon,
        .woocommerce form.login,
        .woocommerce form.register,
        .wc-block-cart__main,
        .wc-block-components-sidebar-layout .wc-block-components-sidebar,
        .woocommerce-MyAccount-content
    ) {
        color: #283441;
    }
}

/* Only suppressed when its corresponding toggle is enabled in WP settings. */
html.fabify-light-lock--no-auto-dark :where(
    .darkmode-layer, .wp-dark-mode-overlay,
    .dark-mode-overlay, .wp-dark-mode-dark-overlay
) {
    display: none !important;
}
html.fabify-light-lock--no-auto-dark.darkmode--activated,
html.fabify-light-lock--no-auto-dark body.darkmode--activated {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Site-root inversion is frequently how third-party dark switchers operate.
   Scope filter protection to html/body; image/gallery filters are preserved. */
html.fabify-light-lock--no-auto-dark,
html.fabify-light-lock--no-auto-dark body {
    filter: none !important;
    -webkit-filter: none !important;
}
