/* =====================================================
   Dark Light Mode for Elementor v2.1.0
   UI/UX بهبودیافته + ریسپانسیو کامل + عملکرد بهتر برف
   سازگار با Astra + WooCommerce + Elementor Pro
   ===================================================== */

/* ---------- Toggle UI ---------- */
.dlme-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    vertical-align: middle;
    flex-wrap: nowrap;
}

/* Switch – سازگار با RTL و LTR + آیکون داخل */
.dlme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.dlme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.dlme-toggle-switch .dlme-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #c5c5c5;
    transition: background-color 0.35s cubic-bezier(.4,0,.2,1);
    border-radius: 34px;
    overflow: hidden;
}
.dlme-toggle-switch .dlme-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    inset-inline-start: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: transform 0.4s cubic-bezier(.34, 1.4, .64, 1);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    z-index: 2;
}
/* آیکون‌های داخل سوئیچ */
.dlme-slider-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    line-height: 1;
    pointer-events: none;
    opacity: 0.85;
    transition: opacity 0.25s;
    z-index: 1;
}
.dlme-slider-sun {
    inset-inline-start: 7px;
}
.dlme-slider-moon {
    inset-inline-end: 7px;
    opacity: 0.4;
}
.dlme-toggle-switch input:checked + .dlme-slider {
    background-color: #1a73e8;
}
.dlme-toggle-switch input:checked + .dlme-slider:before {
    transform: translateX(26px);
}
.dlme-toggle-switch input:checked + .dlme-slider .dlme-slider-sun {
    opacity: 0.35;
}
.dlme-toggle-switch input:checked + .dlme-slider .dlme-slider-moon {
    opacity: 0.95;
}
/* RTL */
[dir="rtl"] .dlme-toggle-switch input:checked + .dlme-slider:before,
.rtl .dlme-toggle-switch input:checked + .dlme-slider:before {
    transform: translateX(-26px);
}

/* Focus accessible */
.dlme-toggle-switch input:focus-visible + .dlme-slider {
    outline: 2px solid #1a73e8;
    outline-offset: 3px;
}

.dlme-toggle-label {
    font-size: 14px;
    user-select: none;
    white-space: nowrap;
}

/* Button */
.dlme-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 14px;
    border: none;
    border-radius: 12px;
    background-color: #2d2d2d;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.25s, transform 0.15s, opacity 0.2s, box-shadow 0.25s;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.dlme-toggle-button:hover {
    opacity: 0.92;
    transform: scale(1.04);
}
.dlme-toggle-button:active {
    transform: scale(0.96);
}
.dlme-toggle-button:focus-visible {
    outline: 2px solid #90caf9;
    outline-offset: 2px;
}

/* Text style */
.dlme-toggle-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    min-height: 40px;
    transition: opacity 0.2s;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}
.dlme-toggle-text:hover {
    opacity: 0.75;
}
.dlme-icon {
    font-size: 1.25em;
    line-height: 1;
}

/* =====================================================
   دکمهٔ برف و دکمهٔ شناور (ریسپانسیو + safe-area)
   ===================================================== */
.dlme-snow-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(120, 170, 220, 0.2);
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity .25s, transform .25s, background-color .25s, box-shadow .25s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.dlme-snow-button:hover {
    opacity: 1;
    transform: rotate(15deg) scale(1.1);
}
.dlme-snow-button:focus-visible {
    outline: 2px solid #64b5f6;
    outline-offset: 2px;
}
.dlme-snow-button.is-active {
    opacity: 1;
    background: rgba(100, 180, 255, 0.4);
    box-shadow: 0 0 14px rgba(140, 200, 255, 0.55);
}

.dlme-floating {
    position: fixed;
    z-index: 99998;
    /* safe-area برای notch و نوار خانه موبایل */
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    pointer-events: none;
}
.dlme-floating .dlme-toggle-wrapper {
    pointer-events: auto;
    background: rgba(28, 28, 32, 0.88);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(255,255,255,0.08);
    gap: 6px;
}
html:not(.dlme-dark-mode) .dlme-floating .dlme-toggle-wrapper {
    background: rgba(255, 255, 255, 0.9);
    color: #222;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.dlme-pos-bottom-left  { bottom: max(16px, env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); }
.dlme-pos-bottom-right { bottom: max(16px, env(safe-area-inset-bottom, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.dlme-pos-top-left     { top: max(70px, calc(env(safe-area-inset-top, 0px) + 60px)); left: max(16px, env(safe-area-inset-left, 0px)); }
.dlme-pos-top-right    { top: max(70px, calc(env(safe-area-inset-top, 0px) + 60px)); right: max(16px, env(safe-area-inset-right, 0px)); }

/* بوم برف – بدون تداخل با اسکرول */
.dlme-snow-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw;
    max-height: 100dvh;
    pointer-events: none !important;
    touch-action: none !important;
    z-index: 999990;
    /* جلوگیری از ایجاد لایهٔ جداگانه که پس‌زمینه را جابه‌جا کند */
    transform: translateZ(0);
    will-change: contents;
    contain: strict;
}

/* نرم‌تر شدن حرکت سوئیچ */
.dlme-toggle-switch .dlme-slider:before {
    transition: transform .4s cubic-bezier(.34, 1.4, .64, 1);
}

/* =====================================================
   ریسپانسیو موبایل و تبلت
   ===================================================== */
@media (max-width: 768px) {
    .dlme-toggle-switch {
        width: 52px;
        height: 28px;
    }
    .dlme-toggle-switch .dlme-slider:before {
        height: 20px;
        width: 20px;
    }
    .dlme-toggle-switch input:checked + .dlme-slider:before {
        transform: translateX(24px);
    }
    [dir="rtl"] .dlme-toggle-switch input:checked + .dlme-slider:before,
    .rtl .dlme-toggle-switch input:checked + .dlme-slider:before {
        transform: translateX(-24px);
    }
    .dlme-snow-button {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 16px;
    }
    .dlme-floating .dlme-toggle-wrapper {
        padding: 5px 8px;
        gap: 4px;
    }
    .dlme-toggle-button {
        min-width: 42px;
        min-height: 42px;
        padding: 7px 12px;
        font-size: 13px;
    }
    .dlme-pos-bottom-left,
    .dlme-pos-bottom-right {
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
    .dlme-pos-bottom-left { left: max(12px, env(safe-area-inset-left, 0px)); }
    .dlme-pos-bottom-right { right: max(12px, env(safe-area-inset-right, 0px)); }
}

@media (max-width: 480px) {
    .dlme-toggle-wrapper {
        gap: 6px;
    }
    .dlme-slider-icon {
        font-size: 11px;
    }
}

/* جلوگیری از اسکرول افقی ناشی از عناصر fixed */
html.dlme-active,
html.dlme-active body {
    overflow-x: clip;
}

/* وقتی برف فعال است، مطمئن شو body و html اسکرول را مسدود نکنند */
html.dlme-winter,
html.dlme-winter body {
    overflow-x: clip;
    /* هیچ overflow-y یا position خاصی که اسکرول را خراب کند */
}

/* کاهش حرکت برای کاربران prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .dlme-toggle-switch .dlme-slider,
    .dlme-toggle-switch .dlme-slider:before,
    .dlme-toggle-button,
    .dlme-snow-button {
        transition: none !important;
    }
    .dlme-snow-button:hover {
        transform: none;
    }
}


/* =====================================================
   DARK MODE – Core + Astra + WooCommerce + Elementor
   ===================================================== */

html.dlme-dark-mode {
    color-scheme: dark;
}

/* --- Core body & text --- */
html.dlme-dark-mode body,
body.dlme-dark-mode {
    background-color: var(--dlme-dark-bg, #121212) !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* Force text color on common elements (با احتیاط برای المنتور) */
body.dlme-dark-mode p,
body.dlme-dark-mode span:not([class*="elementor-"]),
body.dlme-dark-mode li,
body.dlme-dark-mode td,
body.dlme-dark-mode th,
body.dlme-dark-mode label,
body.dlme-dark-mode strong,
body.dlme-dark-mode b,
body.dlme-dark-mode em,
body.dlme-dark-mode i:not([class*="fa"]):not([class*="eicon"]),
body.dlme-dark-mode small,
body.dlme-dark-mode article,
body.dlme-dark-mode section,
body.dlme-dark-mode aside,
body.dlme-dark-mode figcaption,
body.dlme-dark-mode blockquote {
    color: var(--dlme-dark-text, #e0e0e0);
}

/* Headings */
body.dlme-dark-mode h1,
body.dlme-dark-mode h2,
body.dlme-dark-mode h3,
body.dlme-dark-mode h4,
body.dlme-dark-mode h5,
body.dlme-dark-mode h6,
body.dlme-dark-mode .entry-title,
body.dlme-dark-mode .page-title,
body.dlme-dark-mode .ast-archive-title {
    color: var(--dlme-dark-heading, #ffffff) !important;
}

/* Links */
body.dlme-dark-mode a {
    color: var(--dlme-dark-link, #90caf9);
}
body.dlme-dark-mode a:hover,
body.dlme-dark-mode a:focus {
    color: #bbdefb;
}

/* ---------- Astra specific ---------- */
body.dlme-dark-mode #page,
body.dlme-dark-mode .site,
body.dlme-dark-mode .site-content,
body.dlme-dark-mode .ast-container,
body.dlme-dark-mode .ast-container-fluid,
body.dlme-dark-mode .ast-separate-container,
body.dlme-dark-mode .ast-page-builder-template,
body.dlme-dark-mode .ast-plain-container,
body.dlme-dark-mode .ast-boxed-container {
    background-color: var(--dlme-dark-bg, #121212) !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* Astra Header (سازگار با Header Builder جدید) */
body.dlme-dark-mode .site-header,
body.dlme-dark-mode .main-header-bar,
body.dlme-dark-mode .ast-primary-header-bar,
body.dlme-dark-mode .ast-above-header,
body.dlme-dark-mode .ast-below-header,
body.dlme-dark-mode .ast-mobile-header-wrap,
body.dlme-dark-mode .ast-header-break-point .main-header-bar,
body.dlme-dark-mode .ast-builder-grid-row,
body.dlme-dark-mode .ast-desktop-header-content,
body.dlme-dark-mode .ast-mobile-header-content {
    background-color: #1e1e1e !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-color: #333 !important;
}

body.dlme-dark-mode .main-header-menu a,
body.dlme-dark-mode .ast-header-navigation a,
body.dlme-dark-mode .ast-builder-menu a,
body.dlme-dark-mode .ast-nav-menu a,
body.dlme-dark-mode .menu-link,
body.dlme-dark-mode .ast-header-html,
body.dlme-dark-mode .site-header-section a {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .main-header-menu a:hover,
body.dlme-dark-mode .ast-header-navigation a:hover,
body.dlme-dark-mode .ast-builder-menu a:hover {
    color: var(--dlme-dark-link, #90caf9) !important;
}

/* Astra Footer */
body.dlme-dark-mode .site-footer,
body.dlme-dark-mode .ast-footer-overlay,
body.dlme-dark-mode .footer-adv,
body.dlme-dark-mode .ast-small-footer,
body.dlme-dark-mode .ast-footer-copyright,
body.dlme-dark-mode .ast-footer-widget-area {
    background-color: #1a1a1a !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-color: #333 !important;
}
body.dlme-dark-mode .site-footer a,
body.dlme-dark-mode .ast-small-footer a {
    color: var(--dlme-dark-link, #90caf9) !important;
}

/* Astra Sidebar / Widgets */
body.dlme-dark-mode .widget-area,
body.dlme-dark-mode .sidebar,
body.dlme-dark-mode .widget,
body.dlme-dark-mode .ast-single-post .entry-content,
body.dlme-dark-mode .entry-content,
body.dlme-dark-mode .ast-article-single {
    background-color: transparent !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .widget-title,
body.dlme-dark-mode .widget .widget-title {
    color: var(--dlme-dark-heading, #ffffff) !important;
}

/* Astra Breadcrumb & Meta */
body.dlme-dark-mode .ast-breadcrumbs,
body.dlme-dark-mode .ast-breadcrumbs a,
body.dlme-dark-mode .entry-meta,
body.dlme-dark-mode .entry-meta a,
body.dlme-dark-mode .posted-on,
body.dlme-dark-mode .byline {
    color: #b0b0b0 !important;
}

/* Astra Buttons (theme buttons) */
body.dlme-dark-mode .ast-button,
body.dlme-dark-mode .button,
body.dlme-dark-mode input[type="submit"],
body.dlme-dark-mode .ast-custom-button {
    background-color: #333 !important;
    color: #fff !important;
    border-color: #555 !important;
}
body.dlme-dark-mode .ast-button:hover,
body.dlme-dark-mode .button:hover,
body.dlme-dark-mode input[type="submit"]:hover {
    background-color: #444 !important;
    color: #fff !important;
}

/* Forms – Astra / general */
body.dlme-dark-mode input[type="text"],
body.dlme-dark-mode input[type="email"],
body.dlme-dark-mode input[type="url"],
body.dlme-dark-mode input[type="password"],
body.dlme-dark-mode input[type="search"],
body.dlme-dark-mode input[type="number"],
body.dlme-dark-mode input[type="tel"],
body.dlme-dark-mode input[type="date"],
body.dlme-dark-mode textarea,
body.dlme-dark-mode select,
body.dlme-dark-mode .ast-search-field {
    background-color: #2a2a2a !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-color: #444 !important;
}
body.dlme-dark-mode input::placeholder,
body.dlme-dark-mode textarea::placeholder {
    color: #888 !important;
}

/* ---------- WooCommerce ---------- */
body.dlme-dark-mode .woocommerce,
body.dlme-dark-mode .woocommerce-page {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* Product titles & prices */
body.dlme-dark-mode .woocommerce ul.products li.product .woocommerce-loop-product__title,
body.dlme-dark-mode .woocommerce div.product .product_title,
body.dlme-dark-mode .woocommerce-loop-product__title,
body.dlme-dark-mode .product_title {
    color: var(--dlme-dark-heading, #ffffff) !important;
}

body.dlme-dark-mode .woocommerce ul.products li.product .price,
body.dlme-dark-mode .woocommerce div.product p.price,
body.dlme-dark-mode .woocommerce div.product span.price,
body.dlme-dark-mode .price,
body.dlme-dark-mode .woocommerce-Price-amount,
body.dlme-dark-mode .amount {
    color: #81c784 !important;
}

body.dlme-dark-mode .woocommerce .price del,
body.dlme-dark-mode .price del .woocommerce-Price-amount {
    color: #999 !important;
}

/* WooCommerce Buttons */
body.dlme-dark-mode .woocommerce a.button,
body.dlme-dark-mode .woocommerce button.button,
body.dlme-dark-mode .woocommerce input.button,
body.dlme-dark-mode .woocommerce #respond input#submit,
body.dlme-dark-mode .woocommerce a.button.alt,
body.dlme-dark-mode .woocommerce button.button.alt,
body.dlme-dark-mode .woocommerce input.button.alt,
body.dlme-dark-mode .woocommerce #respond input#submit.alt,
body.dlme-dark-mode .single_add_to_cart_button,
body.dlme-dark-mode .add_to_cart_button,
body.dlme-dark-mode .checkout-button {
    background-color: #2196F3 !important;
    color: #ffffff !important;
    border-color: #1976D2 !important;
}
body.dlme-dark-mode .woocommerce a.button:hover,
body.dlme-dark-mode .woocommerce button.button:hover,
body.dlme-dark-mode .woocommerce a.button.alt:hover,
body.dlme-dark-mode .single_add_to_cart_button:hover {
    background-color: #1976D2 !important;
    color: #ffffff !important;
}

/* Cart & Checkout */
body.dlme-dark-mode .woocommerce-cart table.cart,
body.dlme-dark-mode .woocommerce-checkout table,
body.dlme-dark-mode .woocommerce table.shop_table,
body.dlme-dark-mode .woocommerce-cart .cart-collaterals,
body.dlme-dark-mode .cart_totals,
body.dlme-dark-mode .woocommerce-checkout #payment {
    background-color: #1e1e1e !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-color: #333 !important;
}
body.dlme-dark-mode .woocommerce table.shop_table th,
body.dlme-dark-mode .woocommerce table.shop_table td {
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-color: #333 !important;
}
body.dlme-dark-mode .woocommerce-cart .cart-collaterals .cart_totals h2,
body.dlme-dark-mode .woocommerce-checkout h3 {
    color: var(--dlme-dark-heading, #ffffff) !important;
}

/* WooCommerce forms */
body.dlme-dark-mode .woocommerce form .form-row input.input-text,
body.dlme-dark-mode .woocommerce form .form-row textarea,
body.dlme-dark-mode .woocommerce form .form-row select,
body.dlme-dark-mode .woocommerce-checkout input,
body.dlme-dark-mode .woocommerce-checkout textarea,
body.dlme-dark-mode .woocommerce-checkout select {
    background-color: #2a2a2a !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-color: #444 !important;
}

/* Notices */
body.dlme-dark-mode .woocommerce-message,
body.dlme-dark-mode .woocommerce-info,
body.dlme-dark-mode .woocommerce-error {
    background-color: #2a2a2a !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-top-color: #2196F3 !important;
}

/* Product tabs & description */
body.dlme-dark-mode .woocommerce-tabs,
body.dlme-dark-mode .woocommerce-Tabs-panel,
body.dlme-dark-mode .woocommerce-product-details__short-description,
body.dlme-dark-mode .woocommerce-product-gallery {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .woocommerce div.product .woocommerce-tabs ul.tabs li a {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--dlme-dark-heading, #ffffff) !important;
}

/* My Account */
body.dlme-dark-mode .woocommerce-MyAccount-navigation,
body.dlme-dark-mode .woocommerce-MyAccount-content {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .woocommerce-MyAccount-navigation ul li a {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .woocommerce-MyAccount-navigation ul li.is-active a {
    color: var(--dlme-dark-link, #90caf9) !important;
}

/* Star ratings */
body.dlme-dark-mode .star-rating span::before,
body.dlme-dark-mode .star-rating::before {
    color: #ffb400 !important;
}

/* Mini cart / blocks (WooCommerce Blocks) */
body.dlme-dark-mode .wc-block-mini-cart,
body.dlme-dark-mode .wc-block-components-drawer,
body.dlme-dark-mode .wc-block-cart,
body.dlme-dark-mode .wc-block-checkout {
    background-color: #1e1e1e !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* ---------- Elementor compatibility ---------- */
/* اجازه می‌دهیم کنترل‌های رنگ المنتور اولویت داشته باشند */
body.dlme-dark-mode .elementor-widget-text-editor,
body.dlme-dark-mode .elementor-widget-heading .elementor-heading-title,
body.dlme-dark-mode .elementor-icon-box-title,
body.dlme-dark-mode .elementor-icon-box-description,
body.dlme-dark-mode .elementor-widget-icon-list .elementor-icon-list-text {
    color: inherit;
}

/* فقط وقتی رنگ خاصی در المنتور ست نشده، رنگ دارک اعمال شود */
body.dlme-dark-mode .elementor-widget-text-editor p,
body.dlme-dark-mode .elementor-widget-text-editor span {
    color: var(--dlme-dark-text, #e0e0e0);
}

/* Elementor sections / containers background fallback */
body.dlme-dark-mode .elementor-section:not([data-settings*="background"]),
body.dlme-dark-mode .e-con:not([data-settings*="background"]) {
    /* هیچی – اجازه می‌دهیم استایل المنتور بماند */
}

/* ---------- General fixes for black text that disappears ---------- */
body.dlme-dark-mode [style*="color:#000"],
body.dlme-dark-mode [style*="color: #000"],
body.dlme-dark-mode [style*="color:#000000"],
body.dlme-dark-mode [style*="color: #000000"],
body.dlme-dark-mode [style*="color:rgb(0,0,0)"],
body.dlme-dark-mode [style*="color: rgb(0, 0, 0)"] {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* Soften borders */
body.dlme-dark-mode hr,
body.dlme-dark-mode .ast-border,
body.dlme-dark-mode table,
body.dlme-dark-mode th,
body.dlme-dark-mode td {
    border-color: #333 !important;
}

/* Images – slight brightness reduction optional */
body.dlme-dark-mode img {
    opacity: 0.95;
}

/* Scrollbar (WebKit) */
body.dlme-dark-mode::-webkit-scrollbar {
    width: 10px;
}
body.dlme-dark-mode::-webkit-scrollbar-track {
    background: #1a1a1a;
}
body.dlme-dark-mode::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}
body.dlme-dark-mode::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* =====================================================
   انیمیشن تغییر حالت
   ===================================================== */

/* روش اصلی: View Transitions API – دایرهٔ گسترش‌یابنده از محل کلیک (انیمیشن در JS) */
html.dlme-vt::view-transition-old(root),
html.dlme-vt::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}
html.dlme-vt::view-transition-old(root) { z-index: 1; }
html.dlme-vt::view-transition-new(root) { z-index: 2; }

/* روش جایگزین (مرورگرهای قدیمی یا حالت «محو شدن»): ترنزیشن نرم روی رنگ‌ها */
html.dlme-animating *:not(.dlme-slider):not(.dlme-snow-canvas),
html.dlme-animating body {
    transition:
        background-color var(--dlme-duration, 700ms) cubic-bezier(.4, 0, .2, 1),
        color var(--dlme-duration, 700ms) cubic-bezier(.4, 0, .2, 1),
        border-color var(--dlme-duration, 700ms) cubic-bezier(.4, 0, .2, 1),
        fill var(--dlme-duration, 700ms) cubic-bezier(.4, 0, .2, 1),
        stroke var(--dlme-duration, 700ms) cubic-bezier(.4, 0, .2, 1),
        box-shadow var(--dlme-duration, 700ms) cubic-bezier(.4, 0, .2, 1) !important;
}

@media (prefers-reduced-motion: reduce) {
    html.dlme-animating *,
    html.dlme-animating body {
        transition: none !important;
    }
    html.dlme-vt::view-transition-group(*),
    html.dlme-vt::view-transition-old(*),
    html.dlme-vt::view-transition-new(*) {
        animation: none !important;
    }
}


/* =====================================================
   سازگاری بیشتر با Elementor Pro و ووکامرس
   ===================================================== */

/* منوی المنتور پرو */
body.dlme-dark-mode .elementor-nav-menu--dropdown,
body.dlme-dark-mode .elementor-nav-menu--dropdown a,
body.dlme-dark-mode .elementor-menu-toggle {
    background-color: #1e1e1e;
    color: var(--dlme-dark-text, #e0e0e0);
}
body.dlme-dark-mode .elementor-nav-menu--main .elementor-item {
    color: var(--dlme-dark-text, #e0e0e0);
}

/* فرم‌های المنتور پرو */
body.dlme-dark-mode .elementor-field-textual,
body.dlme-dark-mode .elementor-field-group .elementor-select-wrapper select {
    background-color: #2a2a2a;
    color: var(--dlme-dark-text, #e0e0e0);
    border-color: #444;
}
body.dlme-dark-mode .elementor-field-label {
    color: var(--dlme-dark-text, #e0e0e0);
}

/* پاپ‌آپ المنتور پرو */
body.dlme-dark-mode .elementor-popup-modal .dialog-widget-content {
    background-color: #1e1e1e;
    color: var(--dlme-dark-text, #e0e0e0);
}

/* مینی‌کارت المنتور پرو و ویجت‌های ووکامرس المنتور */
body.dlme-dark-mode .elementor-menu-cart__main,
body.dlme-dark-mode .elementor-menu-cart__product,
body.dlme-dark-mode .elementor-menu-cart__footer-buttons,
body.dlme-dark-mode .elementor-menu-cart__subtotal {
    background-color: #1e1e1e;
    color: var(--dlme-dark-text, #e0e0e0);
    border-color: #333;
}
body.dlme-dark-mode .elementor-widget-woocommerce-products .product,
body.dlme-dark-mode .elementor-widget-woocommerce-product-price .price,
body.dlme-dark-mode .elementor-products-grid .product {
    color: var(--dlme-dark-text, #e0e0e0);
}
body.dlme-dark-mode .elementor-widget-wc-categories .woocommerce-loop-category__title,
body.dlme-dark-mode .woocommerce-loop-category__title {
    color: var(--dlme-dark-heading, #ffffff) !important;
}

/* بلاک‌های ووکامرس: متن، ورودی‌ها و خلاصهٔ سفارش */
body.dlme-dark-mode .wc-block-components-product-name,
body.dlme-dark-mode .wc-block-components-totals-item,
body.dlme-dark-mode .wc-block-components-order-summary,
body.dlme-dark-mode .wc-block-components-sidebar,
body.dlme-dark-mode .wc-block-grid__product-title,
body.dlme-dark-mode .wc-block-components-title {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .wc-block-components-text-input input,
body.dlme-dark-mode .wc-block-components-select .components-custom-select-control__button,
body.dlme-dark-mode .wc-blocks-components-select__select,
body.dlme-dark-mode .wc-block-components-textarea {
    background-color: #2a2a2a !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
    border-color: #444 !important;
}
body.dlme-dark-mode .wc-block-components-text-input label,
body.dlme-dark-mode .wc-block-components-radio-control__label,
body.dlme-dark-mode .wc-block-components-checkbox__label {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* ووکامرس کلاسیک: select2 و کوپن */
body.dlme-dark-mode .select2-container--default .select2-selection--single,
body.dlme-dark-mode .select2-dropdown {
    background-color: #2a2a2a;
    color: var(--dlme-dark-text, #e0e0e0);
    border-color: #444;
}
body.dlme-dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--dlme-dark-text, #e0e0e0);
}



/* =====================================================
   بهبودهای اضافی v2.1 – Elementor Pro + اسکرول موبایل
   ===================================================== */

/* سکشن‌ها و کانتینرهای المنتور در دارک مود */
body.dlme-dark-mode .elementor-section,
body.dlme-dark-mode .elementor-container,
body.dlme-dark-mode .e-con,
body.dlme-dark-mode .e-con-inner {
    /* فقط اگر پس‌زمینه شفاف/سفید پیش‌فرض باشد؛ از !important سنگین روی background خودداری */
}

/* جلوگیری از تداخل لایهٔ برف با sticky header المنتور و Astra */
.elementor-sticky--active,
.ast-sticky-active,
.ast-header-sticky-active {
    z-index: 99997; /* زیر canvas برف و floating */
}

/* اطمینان از اینکه canvas برف روی همه چیز است ولی اسکرول را نمی‌گیرد */
.dlme-snow-canvas {
    isolation: isolate;
}

/* اصلاح 100vh روی موبایل */
@supports (height: 100dvh) {
    .dlme-snow-canvas {
        height: 100dvh !important;
        max-height: 100dvh;
    }
}

/* حالت تاریک برای popup و off-canvas المنتور */
body.dlme-dark-mode .elementor-popup-modal .dialog-widget-content,
body.dlme-dark-mode .elementor-location-popup {
    background-color: #1e1e1e !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* منوی موبایل Astra */
body.dlme-dark-mode .ast-mobile-popup-drawer,
body.dlme-dark-mode .ast-mobile-popup-content,
body.dlme-dark-mode .ast-builder-menu-mobile,
body.dlme-dark-mode .ast-mobile-header-content {
    background-color: #1a1a1a !important;
    color: var(--dlme-dark-text, #e0e0e0) !important;
}
body.dlme-dark-mode .ast-mobile-popup-drawer a,
body.dlme-dark-mode .ast-builder-menu-mobile a {
    color: var(--dlme-dark-text, #e0e0e0) !important;
}

/* جلوگیری از lag پس‌زمینه: لایه‌های fixed نباید باعث reflow شوند */
html.dlme-winter body::after {
    transform: translateZ(0);
    will-change: opacity;
    contain: strict;
}
