/* SEOIran Safe Dark Mode 1.1.0
   Color-only changes: no full-page filters, animations, transforms or width changes.
   CSS selectors are active only when the user enables dark mode. */

/* Shortcode switch: self-contained and safe in Woodmart/Elementor flex headers. */
.sdm-toggle.sdm-toggle {
    --sdm-switch-bg: #f5f2ff;
    --sdm-switch-text: #332a4f;
    --sdm-switch-border: #e1d8f4;
    --sdm-switch-track: #d1c8e7;
    appearance: none !important;
    -webkit-appearance: none !important;
    position: relative;
    display: inline-flex !important;
    direction: rtl;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle;
    flex: 0 0 auto;
    gap: 9px !important;
    width: auto !important;
    min-width: 0;
    max-width: calc(100vw - 32px);
    height: 42px !important;
    min-height: 0;
    padding: 6px 12px !important;
    margin: 0 !important;
    background: var(--sdm-switch-bg) !important;
    color: var(--sdm-switch-text) !important;
    border: 1px solid var(--sdm-switch-border) !important;
    border-radius: 14px !important;
    font: inherit !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    box-shadow: 0 5px 18px rgba(16, 18, 37, .08) !important;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box !important;
    isolation: isolate;
}
.sdm-toggle.sdm-toggle:hover { background: #ede5ff !important; color: #332a4f !important; }
.sdm-toggle.sdm-toggle:focus-visible { outline: 2px solid #7c4eff !important; outline-offset: 3px; }
.sdm-toggle.sdm-toggle .sdm-toggle__icon {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    color: inherit;
}
.sdm-toggle.sdm-toggle .sdm-toggle__icon svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; }
.sdm-toggle.sdm-toggle .sdm-toggle__label { display: inline-block; min-width: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; font: inherit; }
.sdm-toggle .sdm-icon-sun { display: none !important; }
.sdm-toggle .sdm-icon-moon { display: block !important; }
.sdm-toggle.sdm-toggle .sdm-toggle__track {
    position: relative;
    display: block;
    flex: 0 0 29px;
    width: 29px;
    height: 17px;
    border-radius: 999px;
    background: var(--sdm-switch-track);
    box-sizing: border-box;
}
.sdm-toggle.sdm-toggle .sdm-toggle__thumb {
    display: block;
    position: absolute;
    right: 2px;
    top: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.16);
    transition: right .2s ease, background-color .2s ease;
}
.sdm-toggle.sdm-toggle--small { height: 34px !important; padding: 4px 9px !important; font-size: 12px !important; gap: 6px !important; border-radius: 11px !important; }
.sdm-toggle.sdm-toggle--large { height: 48px !important; padding: 8px 16px !important; font-size: 15px !important; border-radius: 15px !important; }
.sdm-toggle.sdm-toggle--icon { width: 42px !important; padding: 0 !important; gap: 0 !important; }
.sdm-toggle.sdm-toggle--icon.sdm-toggle--small { width: 34px !important; }
.sdm-toggle.sdm-toggle--icon.sdm-toggle--large { width: 48px !important; }
.sdm-toggle.sdm-toggle--icon .sdm-toggle__label,
.sdm-toggle.sdm-toggle--icon .sdm-toggle__track,
.sdm-toggle.sdm-toggle--switch .sdm-toggle__label { display: none !important; }

html[data-sdm-theme="dark"] .sdm-toggle.sdm-toggle {
    --sdm-switch-bg: #27203f;
    --sdm-switch-text: #f9f5ff;
    --sdm-switch-border: #54486b;
    --sdm-switch-track: #9270e9;
}
html[data-sdm-theme="dark"] .sdm-toggle.sdm-toggle:hover { background: #372c58 !important; color: #fff !important; }
html[data-sdm-theme="dark"] .sdm-toggle .sdm-icon-moon { display: none !important; }
html[data-sdm-theme="dark"] .sdm-toggle .sdm-icon-sun { display: block !important; }
html[data-sdm-theme="dark"] .sdm-toggle.sdm-toggle .sdm-toggle__thumb { right: 14px; }

/* Optional floating control. Only this element is positioned; html/body never move. */
.sdm-floating {
    position: fixed;
    z-index: 99990;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: max-content;
    max-width: calc(100vw - 24px);
    margin: 0;
    padding: 0;
    pointer-events: none;
}
.sdm-floating > .sdm-toggle { pointer-events: auto; }
.sdm-floating--bottom-center { left: 50%; transform: translateX(-50%); }
.sdm-floating--bottom-left { left: 20px; }
.sdm-floating--bottom-right { right: 20px; }
@media (max-width: 767px) {
    .sdm-floating { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
    .sdm-floating--bottom-left { left: 12px; }
    .sdm-floating--bottom-right { right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .sdm-toggle.sdm-toggle .sdm-toggle__thumb { transition: none; }
}

/* Dark palette. Existing brand-color backgrounds and all media are intentionally preserved. */
html[data-sdm-theme="dark"] {
    --sdm-bg: #11131d;
    --sdm-surface: #1d2130;
    --sdm-surface-2: #272c3c;
    --sdm-input: #222738;
    --sdm-border: #3b4052;
    --sdm-text: #edf1fa;
    --sdm-muted: #b9bed1;
    --sdm-accent: #bda5ff;
    --sdm-price: #fbbc34;
    color-scheme: dark;
    /* Woodmart variables; no layout vars are touched. */
    --wd-text-color: var(--sdm-text);
    --wd-title-color: var(--sdm-text);
    --wd-link-color: var(--sdm-accent);
    --wd-link-color-hover: var(--sdm-accent);
    --wd-brd-color: var(--sdm-border);
    --wd-form-bg: var(--sdm-input);
}
html[data-sdm-theme="dark"] body,
html[data-sdm-theme="dark"] .website-wrapper,
html[data-sdm-theme="dark"] .main-page-wrapper,
html[data-sdm-theme="dark"] .site-content,
html[data-sdm-theme="dark"] .wd-content-layout {
    background-color: var(--sdm-bg) !important;
    color: var(--sdm-text) !important;
}
html[data-sdm-theme="dark"] :is(.main-page-wrapper, .site-content, .entry-content) {
    --wd-text-color: var(--sdm-text);
    --wd-title-color: var(--sdm-text);
    --wd-link-color: var(--sdm-accent);
    --wd-brd-color: var(--sdm-border);
    color: var(--sdm-text);
}
html[data-sdm-theme="dark"] :is(.main-page-wrapper, .site-content) :is(h1, h2, h3, h4, h5, h6, .title, .wd-entities-title, .product_title, .woocommerce-loop-product__title) {
    color: var(--sdm-text) !important;
}
html[data-sdm-theme="dark"] :is(.main-page-wrapper, .site-content) :is(p, li, label, .woocommerce-breadcrumb, .woocommerce-product-details__short-description) {
    color: var(--sdm-text);
}
html[data-sdm-theme="dark"] :is(.entry-content, .site-content) a:not(.button):not(.btn):not(.elementor-button):not(.wd-fill) { color: var(--sdm-accent); }

/* Woodmart drawers, overlays, widgets and WooCommerce surfaces. */
html[data-sdm-theme="dark"] :is(
    .wd-side-hidden,
    .wd-dropdown,
    .wd-dropdown-menu,
    .mobile-nav,
    .wd-popup,
    .wd-search-dropdown,
    .wd-nav-mobile,
    .wd-my-account-sidebar,
    .widget_shopping_cart_content,
    .woocommerce-mini-cart,
    .woocommerce-notices-wrapper .woocommerce-message,
    .woocommerce-notices-wrapper .woocommerce-info,
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-form-login,
    .woocommerce-ResetPassword,
    .woocommerce-cart-form,
    .cart_totals,
    .woocommerce-checkout-review-order,
    .e-checkout__order_review,
    .e-checkout__column,
    .woocommerce-MyAccount-content,
    .woocommerce-MyAccount-navigation,
    .product-grid-item .product-wrapper,
    .category-grid-item .wrapp-category,
    .single-product .summary-inner,
    .wd-fbt-product,
    .wd-compare-table,
    .wd-empty-page,
    .wd-empty-mini-cart
) {
    background-color: var(--sdm-surface) !important;
    color: var(--sdm-text) !important;
    border-color: var(--sdm-border) !important;
}
html[data-sdm-theme="dark"] :is(.wd-side-hidden, .mobile-nav, .wd-dropdown, .wd-popup, .woocommerce-MyAccount-navigation) :is(a, span, li, p) {
    color: var(--sdm-text);
}
html[data-sdm-theme="dark"] :is(.wd-dropdown, .mobile-nav, .wd-side-hidden) :is(.wd-sub-menu, .sub-menu) {
    background-color: var(--sdm-surface) !important;
    border-color: var(--sdm-border) !important;
}
html[data-sdm-theme="dark"] :is(.woocommerce table.shop_table, .woocommerce-table, .shop_table, .wd-table-wrapper) {
    background-color: var(--sdm-surface) !important;
    color: var(--sdm-text) !important;
    border-color: var(--sdm-border) !important;
}
html[data-sdm-theme="dark"] :is(.woocommerce table.shop_table td, .woocommerce table.shop_table th, .woocommerce-table td, .woocommerce-table th) {
    border-color: var(--sdm-border) !important;
}
html[data-sdm-theme="dark"] :is(.woocommerce-checkout, .woocommerce-cart, .woocommerce-account) :is(label, strong, td, th, .amount) {
    color: var(--sdm-text);
}
html[data-sdm-theme="dark"] :is(.main-page-wrapper, .wd-side-hidden, .wd-popup) :is(input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]), select, textarea),
html[data-sdm-theme="dark"] .gform_wrapper :is(input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background-color: var(--sdm-input) !important;
    color: var(--sdm-text) !important;
    border-color: var(--sdm-border) !important;
}
html[data-sdm-theme="dark"] :is(input, textarea)::placeholder { color: var(--sdm-muted) !important; opacity: 1; }
html[data-sdm-theme="dark"] :is(.wd-side-hidden, .site-content, .main-page-wrapper) :is(hr, .wd-divider, .widget-title, .wd-filter-list, .wd-tabs) { border-color: var(--sdm-border) !important; }
html[data-sdm-theme="dark"] :is(.main-page-wrapper, .site-content) :is(.price, .price .amount, .woocommerce-Price-amount) { color: var(--sdm-price) !important; }
html[data-sdm-theme="dark"] :is(.main-page-wrapper, .site-content) del :is(.amount, .woocommerce-Price-amount) { color: var(--sdm-muted) !important; }

/* Keep logos, product photos, Elementor sliders, and banners unchanged. */


/* --- 021Gem / Elementor / Woodmart compatibility additions ---
   Colors and contrast only: no global transforms, dimensions or reflow. */

/* Override a pre-existing !important purple link rule only when dark mode is active.
   Keep styled buttons, banners and full-surface clickable cards untouched. */
html[data-sdm-theme="dark"] body .entry-content a:not(.button):not(.btn):not(.elementor-button):not(.wd-fill):not(.category-link) {
    color: var(--sdm-accent) !important;
}
html[data-sdm-theme="dark"] body .entry-content a:not(.button):not(.btn):not(.elementor-button):not(.wd-fill):not(.category-link):hover {
    color: #e1d4ff !important;
}

/* The site's special order form uses Gravity Forms. Keep labels, descriptions,
   select lists and file controls readable against the dark inputs. */
html[data-sdm-theme="dark"] :is(.gform_wrapper, .gform-theme--framework) :is(
    .gfield_label,
    .gform-field-label,
    .gfield_description,
    .gform-field-label--type-sub-large,
    .gform_fileupload_rules,
    legend,
    .gfield_required
) {
    color: var(--sdm-text) !important;
}
html[data-sdm-theme="dark"] :is(.gform_wrapper, .gform-theme--framework) :is(
    input[type="file"],
    input[type="number"],
    input[type="email"],
    input[type="text"],
    select,
    textarea
) {
    background-color: var(--sdm-input) !important;
    color: var(--sdm-text) !important;
    border-color: var(--sdm-border) !important;
}

/* WooCommerce/Select2 dropdowns can be appended to <body> outside the shop wrapper. */
html[data-sdm-theme="dark"] :is(
    .select2-container--default .select2-selection--single,
    .select2-container--default .select2-selection--multiple,
    .select2-dropdown,
    .select2-results__option,
    .select2-search__field
) {
    background-color: var(--sdm-input) !important;
    color: var(--sdm-text) !important;
    border-color: var(--sdm-border) !important;
}
html[data-sdm-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--sdm-text) !important;
}
html[data-sdm-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #46376e !important;
    color: #ffffff !important;
}

/* Checkout payment gateway panels: surface colors only, not sizes or behaviour. */
html[data-sdm-theme="dark"] :is(.woocommerce-checkout-payment, .woocommerce-checkout .payment_box) {
    background-color: var(--sdm-surface) !important;
    color: var(--sdm-text) !important;
    border-color: var(--sdm-border) !important;
}

/* Prevent a pre-existing hard-coded amount color from affecting product prices.
   Preserve the store's orange price identity rather than making all numbers white. */
html[data-sdm-theme="dark"] body .site-content :is(.price, .price .amount, .price .woocommerce-Price-amount) {
    color: var(--sdm-price) !important;
}
