/*
 * dark-mode.css — گسترش دارک‌مود به کل سایت (به‌جز صفحات خام ووکامرس)
 *
 * توکن‌های رنگ و دامنه‌ی فعال‌سازی دارک‌مود در style.css تعریف شدن (:root + بلاک
 * body:not(...excluded...) که --paper/--surface/--text-1/... رو داخل دامنه‌ی مجاز
 * override می‌کنه). چون این متغیرها روی <body> ست می‌شن و بقیه‌ی المان‌های این فایل
 * فرزندهای body هستن، کافیه اینجا از همون var(--...)ها استفاده کنیم — روی صفحات
 * مستثنی (سبد خرید/تسویه‌حساب/حساب من خام/آرشیو دسته و تگ محصول) این
 * متغیرها هیچ‌وقت override نمی‌شن، پس مقدارشون خودکار برابر همون رنگ روشن فعلیه و
 * این فایل روی اون صفحات عملاً بی‌اثره (بدون نیاز به تکرار deny-list در هر قانون).
 *
 * این فایل عمداً هیچ‌کدوم از فایل‌های موجود رو دست نمی‌زنه — فقط override اضافه
 * می‌کنه و آخر از همه enqueue می‌شه؛ غیرفعال کردنش با dequeue یک هندل ممکنه.
 */

/* ══════════════════════════════════════════════════════════
   ۱) کراوم مشترک Flatsome — هدر، منو، فوتر، فرم‌ها
   این المان‌ها (هدر/فوتر/#main/#wrapper و ...) روی صفحات مستثنی هم رندر می‌شن،
   برخلاف var(--surface) که مقدارش خودش خودکار روی اون صفحات روشن می‌مونه، اینجا
   رنگ ثابت var(--paper)/var(--surface) روی رنگ اصلی سفید Flatsome می‌شینه — پس
   باید صریحاً با همون deny-list صفحات مستثنی رو کنار بذاریم، وگرنه پس‌زمینه‌ی
   سفید خالص Flatsome (#fff) روی صفحات مستثنی به var(--paper) (#F8F6F3) تغییر
   می‌کنه، هرچند خیلی جزئی، اما لازم نیست.
   ══════════════════════════════════════════════════════════ */
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header-bg-color,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .nav-dropdown,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .off-canvas-left .mfp-content,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .off-canvas-right .mfp-content,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header-vertical-menu__fly-out,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .col .live-search-results,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header .search-form .live-search-results,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header-block .live-search-results,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .footer-1 {
    background-color: var(--surface) !important;
}
/* #main و #wrapper از هسته‌ی Flatsome پس‌زمینه‌ی سفید تخت‌شون رو مستقیم روی
   body می‌ذارن و رنگ تیره‌ی body رو می‌پوشونن — هر جا خود صفحه (مثل blog-wrapper
   یا mya-wrapper) پس‌زمینه‌ی خودش رو نداره، این سفیدی زیرش دیده می‌شه */
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) #main,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) #wrapper {
    background-color: var(--paper) !important;
}
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .nav-dropdown {
    border-color: var(--border) !important;
    box-shadow: var(--shadow-2) !important;
}
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .footer-2 {
    background-color: var(--surface-2) !important;
}
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .absolute-footer {
    background-color: var(--paper) !important;
    color: var(--text-3) !important;
}
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .select-resize-ghost,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .select2-container .select2-choice,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .select2-container .select2-selection,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="date"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="email"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="number"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="password"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="search"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="tel"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="text"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="url"],
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) select,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) textarea,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .form-flat input:not([type="submit"]),
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .form-flat select,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .form-flat textarea {
    background-color: var(--surface) !important;
    color: var(--text-1) !important;
    border-color: var(--border) !important;
}

@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header-bg-color,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .nav-dropdown,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .off-canvas-left .mfp-content,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .off-canvas-right .mfp-content,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header-vertical-menu__fly-out,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .col .live-search-results,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header .search-form .live-search-results,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .header-block .live-search-results,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .footer-1 {
      background-color: var(--surface) !important;
  }
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) #main,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) #wrapper {
      background-color: var(--paper) !important;
  }
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .nav-dropdown {
      border-color: var(--border) !important;
      box-shadow: var(--shadow-2) !important;
  }
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .footer-2 {
      background-color: var(--surface-2) !important;
  }
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .absolute-footer {
      background-color: var(--paper) !important;
      color: var(--text-3) !important;
  }
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .select-resize-ghost,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .select2-container .select2-choice,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .select2-container .select2-selection,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="date"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="email"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="number"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="password"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="search"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="tel"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="text"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) input[type="url"],
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) select,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) textarea,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .form-flat input:not([type="submit"]),
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .form-flat select,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .form-flat textarea {
      background-color: var(--surface) !important;
      color: var(--text-1) !important;
      border-color: var(--border) !important;
  }
}

/* ══════════════════════════════════════════════════════════
   ۲) بلاگ — قاب آرشیو، نقل‌قول، کارت نظرها
   (همون selectorهای style.css؛ فقط رنگ‌های خنثی به توکن نگاشت شدن)
   ══════════════════════════════════════════════════════════ */
html[data-theme="dark"] .blog-wrapper,
html[data-theme="dark"] .single-post blockquote,
html[data-theme="dark"] .single-post a.IRPP_shock,
html[data-theme="dark"] div#gform_wrapper_19,
html[data-theme="dark"] div#gform_wrapper_25 {
    background-color: var(--paper) !important;
}
html[data-theme="dark"] #comments {
    background: var(--surface) !important;
}
html[data-theme="dark"] #commentform textarea,
html[data-theme="dark"] #commentform input[type="text"],
html[data-theme="dark"] #commentform input[type="email"],
html[data-theme="dark"] #commentform input[type="url"] {
    color: var(--text-1) !important;
}
html[data-theme="dark"] .single-post blockquote,
html[data-theme="dark"] .single-post blockquote p {
    color: var(--text-2) !important;
}
html[data-theme="dark"] #commentform textarea,
html[data-theme="dark"] #commentform input[type="text"],
html[data-theme="dark"] #commentform input[type="email"],
html[data-theme="dark"] #commentform input[type="url"] {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}
html[data-theme="dark"] #commentform textarea:focus,
html[data-theme="dark"] #commentform input:focus {
    background: var(--surface) !important;
}

@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) .blog-wrapper,
  html:not([data-theme="light"]) .single-post blockquote,
  html:not([data-theme="light"]) .single-post a.IRPP_shock,
  html:not([data-theme="light"]) div#gform_wrapper_19,
  html:not([data-theme="light"]) div#gform_wrapper_25 {
      background-color: var(--paper) !important;
  }
  html:not([data-theme="light"]) #comments {
      background: var(--surface) !important;
  }
  html:not([data-theme="light"]) #commentform textarea,
  html:not([data-theme="light"]) #commentform input[type="text"],
  html:not([data-theme="light"]) #commentform input[type="email"],
  html:not([data-theme="light"]) #commentform input[type="url"] {
      color: var(--text-1) !important;
  }
  html:not([data-theme="light"]) .single-post blockquote,
  html:not([data-theme="light"]) .single-post blockquote p {
      color: var(--text-2) !important;
  }
  html:not([data-theme="light"]) #commentform textarea,
  html:not([data-theme="light"]) #commentform input[type="text"],
  html:not([data-theme="light"]) #commentform input[type="email"],
  html:not([data-theme="light"]) #commentform input[type="url"] {
      background: var(--surface-2) !important;
      border-color: var(--border) !important;
  }
  html:not([data-theme="light"]) #commentform textarea:focus,
  html:not([data-theme="light"]) #commentform input:focus {
      background: var(--surface) !important;
  }
}

/* ══════════════════════════════════════════════════════════
   ۳) my-account.css — بج‌های وضعیت باقی‌مونده (پیام موفق/خطا)
   ══════════════════════════════════════════════════════════ */
html[data-theme="dark"] .mya-message.success {
    background: var(--teal-soft) !important;
    color: var(--teal-soft-text) !important;
    border-color: var(--teal) !important;
}
html[data-theme="dark"] .mya-message.error {
    background: var(--coral-soft) !important;
    color: var(--coral-soft-text) !important;
    border-color: var(--coral) !important;
}

@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) .mya-message.success {
      background: var(--teal-soft) !important;
      color: var(--teal-soft-text) !important;
      border-color: var(--teal) !important;
  }
  html:not([data-theme="light"]) .mya-message.error {
      background: var(--coral-soft) !important;
      color: var(--coral-soft-text) !important;
      border-color: var(--coral) !important;
  }
}

/* ══════════════════════════════════════════════════════════
   ۴) رنگ‌های هاردکد باقی‌مونده‌ی Flatsome/WooCommerce که با
   بازبینی بصری پیدا شدن — منوی هدر، breadcrumb، h2 عمومی.
   این‌ها روی هدر/فوتر (کراوم مشترک) هم دیده می‌شن، پس مثل بخش ۱ با
   deny-list صفحات مستثنی محافظت می‌شن.
   ══════════════════════════════════════════════════════════ */
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) h2,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) label,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .nav > li > a,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .woocommerce-breadcrumb,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .woocommerce-breadcrumb a,
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .breadcrumbs a {
    color: var(--text-1) !important;
}

@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) h2,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) label,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .nav > li > a,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .woocommerce-breadcrumb,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .woocommerce-breadcrumb a,
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) .breadcrumbs a {
      color: var(--text-1) !important;
  }
}

/* ══════════════════════════════════════════════════════════
   لوگوی هدر — هر دو تصویر لوگوی Flatsome (header_logo و header-logo-dark)
   همان Asset-2.svg با نوشته‌ی #212529 هستند و روی هدر تیره فقط آیکن زرد
   دیده می‌شد. assets/logo-header-dark.svg همان فایل است با نوشته‌ی روشن.
   صفحات مستثنی هدر سفید دارند، پس لوگوی اصلی همان‌جا می‌ماند.
   ══════════════════════════════════════════════════════════ */
html[data-theme="dark"] body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) #logo img {
    content: url("assets/logo-header-dark.svg");
}

@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_attribute) #logo img {
      content: url("assets/logo-header-dark.svg");
  }
}
