/* Keep theme overrides above eMarket and WooCommerce's unlayered important rules. */
@layer zp-storefront {
    #zp-color-toggle {
        display: inline-grid !important;
        place-items: center;
        flex: 0 0 auto;
        width: 38px;
        height: 38px;
        margin: 0;
        padding: 0 !important;
        color: #255444 !important;
        background: #f7faf8 !important;
        border: 1px solid #a8bfb2 !important;
        border-radius: 9px;
        line-height: 1;
        cursor: pointer;
    }
    #zp-color-toggle svg { width: 19px; height: 19px; pointer-events: none; }
    #zp-color-toggle .zp-sun, [data-zp-theme="dark"] #zp-color-toggle .zp-moon { display: none; }
    [data-zp-theme="dark"] #zp-color-toggle .zp-sun { display: inline; }
    #zp-color-toggle:hover { border-color: #549b7b !important; }
    #zp-color-toggle:focus-visible { outline: 3px solid #38aa87 !important; outline-offset: 2px; }
    #zp-color-toggle.zp-theme-fallback { position: fixed; z-index: 999; right: 14px; bottom: 66px; }
    @media (max-width: 767px) {
        #zp-color-toggle { width: 31px; height: 33px; border-radius: 7px; }
        #zp-color-toggle svg { width: 18px; height: 18px; }
        .elementor-widget-swg_ajax_search > .elementor-widget-container:has(> #zp-color-toggle) {
            display: flex !important;
            align-items: center;
            column-gap: 8px;
        }
        .elementor-widget-swg_ajax_search .swg-search:has(+ #zp-color-toggle) { flex: 1 1 auto; min-width: 0; }
        .elementor-widget-swg_ajax_search #zp-color-toggle { width: 42px; height: 44px; }
        .zvp-cart-tools:has(#zp-color-toggle) { column-gap: 5px !important; }
    }
    @media print { #zp-color-toggle { display: none !important; } }

    @media screen {
        html[data-zp-theme="dark"] {
            color-scheme: dark;
            --zp-ground: #101a18;
            --zp-panel: #192723;
            --zp-surface: #23342e;
            --zp-field: #15221e;
            --zp-border: #41584d;
            --zp-text: #e9f2ed;
            --zp-secondary: #b7cabe;
            --zp-link: #a4dfc4;
            --zp-primary: #2f7058;
            --zp-active: #3a8368;
            --zp-warm: #ffa936;
            --zp-focus: #8ae1be;
            background-color: var(--zp-ground) !important;
        }
        [data-zp-theme="dark"] #zp-color-toggle {
            color: #ffdb91 !important;
            background-color: var(--zp-surface) !important;
            border-color: var(--zp-border) !important;
        }
        [data-zp-theme="dark"] :is(body,.body-wrapper,.body-wrapper-inner,#main,#contents,.main-page) {
            background-color: var(--zp-ground) !important;
            color: var(--zp-text) !important;
        }
        [data-zp-theme="dark"] .body-wrapper :where(h1,h2,h3,h4,h5,h6,p,dt,dd,label,legend,td,th,
            .elementor-heading-title,.woocommerce-loop-product__title,.menu-title,.entry-title,.page-title,
            .woocommerce-result-count,.product-sortby,.sort-by,.product_meta,.product-info) { color: var(--zp-text) !important; }
        [data-zp-theme="dark"] .body-wrapper a { color: var(--zp-link) !important; }
        [data-zp-theme="dark"] .body-wrapper a:hover { color: #d9f7e8 !important; }
        [data-zp-theme="dark"] :where(.body-wrapper,.yith-wcqv-main,.swe-wrap-cart-content) :focus-visible {
            outline-color: var(--zp-focus) !important;
        }

        /* Site shell, category levels, catalog cards, panels and overlays. */
        [data-zp-theme="dark"] :is(.header-top-elementor32,.header-style-home31,.header-bottom-elementor32,
            .emarket_breadcrumbs,.products-entry.item-wrap,.product-category.product,.slider.responsive,
            .elementor-element-ea7dc4b,.item-product-cat,.box-column31,.content_product_detail,.tabbable,
            .swe-wrap-cart-content,.yith-wcqv-main,#popup_content,#quickview_content,.block-popup-login,
            .content-search,.search-append,.swg-menu-vertical,.dropdown-menu,.product-categories .children,
            .woocommerce-MyAccount-navigation,.woocommerce-MyAccount-content,.cart_totals,
            .woocommerce-checkout-review-order,.woocommerce-checkout-payment,.woocommerce form.login,
            .woocommerce form.register,.woocommerce form.checkout_coupon,.select2-dropdown,
            .woocommerce .shop_table,.wc-block-components-totals-wrapper,.wc-block-cart__sidebar,
            .wc-block-checkout__sidebar,.woocommerce .woocommerce-address-fields) {
            background-color: var(--zp-panel) !important;
            border-color: var(--zp-border) !important;
            color: var(--zp-text) !important;
        }
        [data-zp-theme="dark"] :is(.search-wrapper,.zvp-header-languages,.swe-wrap-cart-top,.nav-tabs,
            .nav-tabs>li.active>a,.woocommerce-tabs .tabs,.emarket_breadcrumbs .breadcrumb,
            .sort-count,.order-dropdown,.page-numbers,.woocommerce-product-gallery__trigger,
            .add_to_wishlist.single_add_to_wishlist,.compare.icon-svg,.button.yith-wcqv-button,
            .yith-quick-view-close,.res-button,.widget_price_filter .price_slider_wrapper,
            .woocommerce-privacy-policy-text,.woocommerce .payment_box,.woocommerce .cart-discount,
            .woocommerce-info,.woocommerce-message,.woocommerce-error,.blockUI.blockOverlay,
            .select2-container .select2-selection,.select2-container .select2-search__field) {
            background-color: var(--zp-surface) !important;
            border-color: var(--zp-border) !important;
            color: var(--zp-text) !important;
        }
        [data-zp-theme="dark"] :where(.body-wrapper,.swe-wrap-cart-content) :is(
            input:not([type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="image"],[type="hidden"]),
            textarea,select,option,.quantity,.minus,.plus,.select2-selection__rendered) {
            color: var(--zp-text) !important;
            background-color: var(--zp-field) !important;
            border-color: var(--zp-border) !important;
        }
        [data-zp-theme="dark"] :is(input,textarea)::placeholder { color: var(--zp-secondary) !important; opacity: 1; }
        [data-zp-theme="dark"] :is(input[type="checkbox"],input[type="radio"]) { accent-color: #86c9a8; }
        [data-zp-theme="dark"] :where(.body-wrapper,.swe-wrap-cart-content) :is(hr,fieldset,td,th,tr,table,
            .item-content,.tab-pane,.quantity,.product_meta,.products-nav,.cart-subtotal,.order-total,
            .woocommerce-form-login,.woocommerce-form-register,.woocommerce-checkout-review-order-table,
            .wc-block-components-panel,.wc-block-components-order-summary,.woocommerce-product-attributes-item,
            .wc_payment_methods,.payment_methods li,.inline-group) { border-color: var(--zp-border) !important; }

        /* Keep action hierarchies distinct on the darker surfaces. */
        [data-zp-theme="dark"] :is(.mega-title,.swg-menu-horizontal>.menu-item>.item-link,
            .swg-menu-horizontal .level1>.item-link,.zvp-header-languages [aria-current],
            .swe-cart-count,.page-numbers.current,.button.add_to_cart_button,
            .single_add_to_cart_button,.button-buynow,.woocommerce a.checkout-button,
            .woocommerce button.button,.woocommerce input.button,.woocommerce a.button.alt,
            .wc-block-components-checkout-place-order-button,.wc-block-cart__submit-button,
            .swe-cart-empty-button a,.wc-proceed-to-checkout .button) {
            background-color: var(--zp-primary) !important;
            border-color: #518d72 !important;
            color: #fff !important;
        }
        [data-zp-theme="dark"] .body-wrapper :is(.mega-title,.swg-menu-horizontal .level1>.item-link,
            .add_to_cart_button,.single_add_to_cart_button,.button-buynow,.checkout-button):hover {
            background-color: var(--zp-active) !important;
            color: #fff !important;
        }
        [data-zp-theme="dark"] .swg-menu-vertical :is(.item-link,.menu-title),
        [data-zp-theme="dark"] .dropdown-menu :is(a,span) { color: var(--zp-text) !important; }
        [data-zp-theme="dark"] :is(.swg-menu-vertical,.dropdown-menu) .menu-item:hover>.item-link {
            background-color: var(--zp-surface) !important;
            color: #fff !important;
        }
        [data-zp-theme="dark"] :is(.breadcrumbs,.woocommerce-breadcrumb,.item-categories,.item-categories a,
            .product_meta,.sku_wrapper,.review-date,.woocommerce-result-count,.item-meta,.product-stock,
            .select2-search__field,.emarket_breadcrumbs .breadcrumb>li,.woocommerce .lost_password,
            .woocommerce-loop-category__title .count) { color: var(--zp-secondary) !important; }
        [data-zp-theme="dark"] .woocommerce-loop-category__title .count { background: transparent !important; }
        [data-zp-theme="dark"] :is(.price,.price ins,.price .amount,.swe-wrap-cart-content .amount,
            .shop_table .amount,.product-price .amount,.content-search .amount) { color: #b4ebce !important; }
        [data-zp-theme="dark"] .price del, [data-zp-theme="dark"] .price del .amount { color: var(--zp-secondary) !important; }
        [data-zp-theme="dark"] :is(.sale-off,.onsale) { background: var(--zp-warm) !important; color: #25190d !important; }
        [data-zp-theme="dark"] :is(.stock.in-stock,.stock.available-on-backorder) { color: #9de1b8 !important; }
        [data-zp-theme="dark"] :is(.stock.out-of-stock,.woocommerce-invalid .required,.woocommerce-error li) { color: #ffb7a7 !important; }
        [data-zp-theme="dark"] .select2-results__option--highlighted { background: var(--zp-primary) !important; color: white !important; }

        /* A neutral backing preserves original image and printed-logo colours. */
        [data-zp-theme="dark"] :is(.products-entry .item-img,.woocommerce-product-gallery,
            .product-category.product>a>img,.zvp-manufacturer-link,.header-top-elementor32 .elementor-widget-image img) {
            background-color: #f0f2ef !important;
        }
        [data-zp-theme="dark"] :is(.zvp-manufacturer-link,.header-top-elementor32 .elementor-widget-image img) { border-radius: 7px; }
        [data-zp-theme="dark"] :is(.eseptem-ad-card) { background-color: #302e25 !important; border-color: #554e3d !important; }
        [data-zp-theme="dark"] .eseptem-ad :is(h2,.eseptem-ad-brand) { color: #f7ecd6 !important; }
        [data-zp-theme="dark"] .eseptem-ad :is(.eseptem-ad-label,.eseptem-ad-sub) { color: #d1c9ae !important; }
        [data-zp-theme="dark"] .eseptem-ad .eseptem-ad-cta { background: #536537 !important; color: #fff !important; }
        [data-zp-theme="dark"] .body-wrapper :is(.zvp-hero-cta,.zvp-mobile-cta) { background: #e3f1e7 !important; color: #214637 !important; }
        [data-zp-theme="dark"] .body-wrapper :is(.zvp-hero-title,.zvp-hero-link,.zvp-brand-title,.zvp-hero-description,
            .zvp-brand-tagline,.zvp-friends-heading,.zvp-friend-link,.zvp-brand-eyebrow) { color: #f3faf5 !important; }
        [data-zp-theme="dark"] .footer-coppyright-home18 { background-color: #101d18 !important; }

        [data-zp-theme="dark"] .page .entry-summary :is(li,li>strong) { color: var(--zp-text) !important; }

        /* Fitted site templates: menus, service pages and WooCommerce forms. */
        [data-zp-theme="dark"] :is(.zvp-header-languages a,.zvp-mobile-account,.swg-menu-toggle,
            .order-dropdown ul,.select2-results,.select2-container .select2-dropdown,.zvp-brand-options a,
            .woocommerce-MyAccount-navigation li a,.nav-tabs li a,.shop_table thead th,.shop_table tfoot th,
            .cart_totals th,.shop_table tbody th,.zvp-contact-grid section,.zvp-brand-navigation,
            .term-description,.woocommerce-shipping-methods li,.wc_payment_methods .wc_payment_method,
            .custom-dropdown .selected-option,.custom-dropdown .dropdown-list,.autocomplete-suggestions) {
            background-color: var(--zp-surface) !important;
            border-color: var(--zp-border) !important;
            color: var(--zp-text) !important;
        }
        [data-zp-theme="dark"] :is(.zvp-header-languages [aria-current],.nav-tabs li.active>a,
            .wc_payment_methods li.zvp-payment-current,.woocommerce-MyAccount-navigation li.is-active>a) {
            background-color: var(--zp-primary) !important;
            color: white !important;
        }
        [data-zp-theme="dark"] :is(.shop_table td,.shop_table tr,.wishlist_table tbody td,
            .woocommerce-MyAccount-navigation ul,.form-top-checkout .wrap-content,.order-right .wrap-content,
            .page:not(.home) .entry-content,.custom-dropdown .dropdown-list li,.content-search .media-body) {
            background-color: var(--zp-panel) !important;
            border-color: var(--zp-border) !important;
            color: var(--zp-text) !important;
        }
        [data-zp-theme="dark"] :is(.emarket_breadcrumbs span,.header-bottom-elementor32 .elementor-icon-list-text,
            .orderby-order-container .show-product,.order-dropdown span,.item-brand>span,.product_meta span,
            .product-info .posted_in,.item-meta .sku,.content-search .sku,.woocommerce-form__label span,.content_product_detail .posted_in,.product_detail .posted_in,.includes_tax,
            .zvp-brand-options span,.selected-option span) { color: var(--zp-secondary) !important; }
        [data-zp-theme="dark"] .swg-menu-toggle::after { color: var(--zp-text) !important; }
        [data-zp-theme="dark"] .button-search-pro svg,
        [data-zp-theme="dark"] .button-search-pro svg path,
        [data-zp-theme="dark"] .swg-menu-toggle svg { fill: var(--zp-link) !important; }
        [data-zp-theme="dark"] :is(.single_add_to_wishlist,.yith-wcqv-button)::before { filter: brightness(0) invert(.9) !important; }
        [data-zp-theme="dark"] .zvp-mobile-account svg { stroke: var(--zp-link) !important; }
        [data-zp-theme="dark"] .header-top-elementor32 img.wp-image-37115 {
            filter: url("night-logo.svg#brand");
            background: transparent !important;
        }
        [data-zp-theme="dark"] .autocomplete-suggestion:hover,
        [data-zp-theme="dark"] .autocomplete-suggestion:hover .media-body,
        [data-zp-theme="dark"] .custom-dropdown .dropdown-list li:hover { background-color: var(--zp-surface) !important; }
    }
}
