/* ===============================
    حالت تاریک - خانه سبز
    (این استایل‌ها فقط وقتی body.dark-mode باشه فعالن)
==================================*/

body.dark-mode {
  background: #121814 !important;
  color: #e5e7eb !important;
}

/* هدر */
body.dark-mode .header-content {
  background: #16351f !important;
  border-color: #24422c !important;
}

body.dark-mode .search-box {
  background: #22301f !important;
}

body.dark-mode .search-box input {
  background: transparent !important;
  color: #e5e7eb !important;
}

body.dark-mode .search-box input::placeholder {
  color: #9ca3af !important;
}

/* لوگو/اسم «خانه سبز» - قبلا رنگش سبز خیلی تیره بود که رو پس‌زمینه‌ی
   تیره‌ی هدر تقریبا دیده نمی‌شد؛ الان روشن و خوانا می‌شه */
body.dark-mode .brand,
body.dark-mode .brand-name {
  color: #d7f2dd !important;
}

body.dark-mode .brand-mark {
  background: var(--c-primary) !important;
  color: #fff !important;
}

body.dark-mode .header-icons a,
body.dark-mode .user-icon-slot a,
body.dark-mode .menu-btn,
body.dark-mode .header-btn {
  background: #24322a !important;
  color: #9fd4a6 !important;
}

body.dark-mode .header-icons a:hover,
body.dark-mode .user-icon-slot a:hover,
body.dark-mode .menu-btn:hover,
body.dark-mode .header-btn:hover,
body.dark-mode .header-btn.active {
  background: #3a9155 !important;
  color: #fff !important;
}

body.dark-mode .search-suggestions {
  background: #1b2420 !important;
}

body.dark-mode .search-suggestion-item {
  color: #e5e7eb !important;
}

body.dark-mode .search-suggestion-item:hover,
body.dark-mode .search-suggestion-item.active {
  background: #24322a !important;
}

body.dark-mode .search-suggestion-item + .search-suggestion-item {
  border-top-color: #2c3a32 !important;
}

/* اسلایدر */
body.dark-mode .slider {
  background: #1b2420 !important;
}

body.dark-mode .dot {
  background: #4b5563 !important;
}

body.dark-mode .dot.active {
  background: #86c68d !important;
}

/* کارت‌های grid-container و بخش محصولات */
body.dark-mode .card,
body.dark-mode .product-card,
body.dark-mode .section,
body.dark-mode .header_Card {
  background: #1b2420 !important;
  color: #e5e7eb !important;
}

body.dark-mode .header_Card h2 {
  color: #e5e7eb !important;
}

body.dark-mode .header_Card .icon {
  background: #24322a !important;
}

body.dark-mode .card-info {
  background: #24322a !important;
  color: #e5e7eb !important;
}

body.dark-mode .card-info span {
  color: #cbd5e1 !important;
}

/* قیمت محصولات - قبلا پس‌زمینه‌ش روشن می‌موند ولی متنش خاکستری روشن
   می‌شد؛ یعنی رو پس‌زمینه‌ی روشن تقریبا نامرئی بود. الان پس‌زمینه هم
   تیره می‌شه، متن هم سبز روشنِ خوانا */
body.dark-mode .price {
  background: #1f3a29 !important;
  color: #a9e6bc !important;
}

body.dark-mode .right-section {
  background: #1b2420 !important;
}

body.dark-mode .Name {
  color: #e5e7eb !important;
}

/* چرا خانه سبز */
body.dark-mode .why-us-card {
  background: #1b2420 !important;
  border-color: #2c3a32 !important;
}

body.dark-mode .why-us-card h3 {
  color: #e5e7eb !important;
}

body.dark-mode .why-us-card p,
body.dark-mode .why-us-heading p {
  color: #9ca3af !important;
}

body.dark-mode .why-us-card i {
  background: #24322a !important;
  color: #86c68d !important;
}

/* فوتر */
body.dark-mode .footer {
  background: #0d1712 !important;
  color: #d1d5db !important;
}

body.dark-mode .footer-section h4 {
  color: #86c68d !important;
}

body.dark-mode .footer-bottom {
  background: #0a120e !important;
  color: #9ca3af !important;
}

/* منوی همبرگری */
body.dark-mode .menu-drawer {
  background: #16211a !important;
  color: #e5e7eb !important;
}

body.dark-mode .menu-drawer-nav a,
body.dark-mode .menu-drawer-user .guest-badge,
body.dark-mode .menu-drawer-user .user-badge {
  color: #e5e7eb !important;
}

body.dark-mode .menu-drawer-nav a:hover,
body.dark-mode .menu-drawer-user .guest-badge:hover,
body.dark-mode .menu-drawer-user .user-badge:hover {
  background: #24322a !important;
}

body.dark-mode .menu-drawer-user {
  border-bottom-color: #2c3a32 !important;
}

body.dark-mode .menu-drawer-close {
  background: #24322a !important;
  color: #cbd5e1 !important;
}

/* دکمه دارک مود داخل منو */
.menu-drawer-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 12px;
  margin: auto 12px 18px;
  border-radius: 12px;
  background: #f2faf5;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  color: #1f2937;
  border: none;
  width: calc(100% - 24px);
}

body.dark-mode .menu-drawer-theme-toggle {
  background: #24322a !important;
  color: #e5e7eb !important;
}

.menu-drawer-theme-toggle .toggle-switch {
  width: 40px;
  height: 22px;
  background: #d1d5db;
  border-radius: 20px;
  position: relative;
  transition: background .25s;
  flex-shrink: 0;
}

.menu-drawer-theme-toggle .toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s;
}

body.dark-mode .menu-drawer-theme-toggle .toggle-switch {
  background: #558f57;
}

body.dark-mode .menu-drawer-theme-toggle .toggle-switch::after {
  transform: translateX(-18px);
}

/* صفحه دسته‌بندی، سبد خرید، فروش قسطی */
body.dark-mode .categories-sidebar,
body.dark-mode .cart-row,
body.dark-mode .installment-block,
body.dark-mode .cart-summary-bar,
body.dark-mode .search-results-banner {
  background: #1b2420 !important;
  color: #e5e7eb !important;
}

body.dark-mode .cat-btn {
  color: #e5e7eb !important;
}

body.dark-mode .cat-btn:hover {
  background: #24322a !important;
}

body.dark-mode .cat-btn.active {
  background: #558f57 !important;
  color: #fff !important;
}

body.dark-mode .products-toolbar,
body.dark-mode .toolbar-title,
body.dark-mode .cart-row-name,
body.dark-mode .installment-block h2,
body.dark-mode .article-header h1,
body.dark-mode .cart-page-title h1,
body.dark-mode .categories-page-title h1 {
  color: #e5e7eb !important;
}

/* متن‌های صفحه فروش قسطی */
body.dark-mode .article-lead {
  color: #cbd5e1 !important;
}

body.dark-mode .installment-block p {
  color: #cbd5e1 !important;
}

body.dark-mode .installment-features li {
  color: #e5e7eb !important;
}

body.dark-mode .installment-features li i {
  background: #24322a !important;
  color: #86c68d !important;
}

body.dark-mode .installment-badge {
  background: #2f7a45 !important;
}

body.dark-mode .installment-note {
  background: #2a2417 !important;
  border-color: #4a3a1a !important;
}

body.dark-mode .installment-note p {
  color: #e6c877 !important;
}

body.dark-mode .installment-note i {
  color: #e6c877 !important;
}

body.dark-mode .sort-select {
  background: #24322a !important;
  color: #e5e7eb !important;
  border-color: #3a4a3f !important;
}

/* مودال محصول و ثبت‌نام */
body.dark-mode .pm-modal,
body.dark-mode .rm-modal {
  background: #1b2420 !important;
  color: #e5e7eb !important;
}

body.dark-mode .pm-title,
body.dark-mode .pm-price,
body.dark-mode .pm-features li,
body.dark-mode .pm-crumb-name {
  color: #e5e7eb !important;
}

body.dark-mode .pm-gallery {
  background: #24322a !important;
}

body.dark-mode .pm-close,
body.dark-mode .qty-btn,
body.dark-mode .pm-qty-btn {
  background: #24322a !important;
  color: #e5e7eb !important;
}

/* ================= پنل ادمین ================= */
body.dark-mode {
  background: #121814 !important;
}

body.dark-mode .admin-sidebar,
body.dark-mode .admin-topbar,
body.dark-mode .admin-table-wrap,
body.dark-mode .admin-stat-card,
body.dark-mode .admin-chart-card,
body.dark-mode .admin-modal,
body.dark-mode .admin-login-box {
  background: #1b2420 !important;
  color: #e5e7eb !important;
}

body.dark-mode .admin-sidebar-logo,
body.dark-mode .admin-topbar h2,
body.dark-mode .admin-stat-value,
body.dark-mode .admin-chart-card h3,
body.dark-mode .admin-modal h3,
body.dark-mode .admin-login-box h1 {
  color: #e5e7eb !important;
}

body.dark-mode .admin-chart-card p {
  color: #9ca3af !important;
}

body.dark-mode .admin-nav-btn {
  color: #d1d5db !important;
}

body.dark-mode .admin-nav-btn:hover {
  background: #24322a !important;
}

body.dark-mode .admin-table th {
  background: #24322a !important;
  color: #86c68d !important;
}

body.dark-mode .admin-table td {
  border-top-color: #2c3a32 !important;
  color: #e5e7eb !important;
}

body.dark-mode .admin-form-field input,
body.dark-mode .admin-form-field select,
body.dark-mode .admin-form-field textarea,
body.dark-mode .admin-login-box input,
body.dark-mode #backupTimeInput {
  background: #24322a !important;
  color: #e5e7eb !important;
  border-color: #3a4a3f !important;
}

body.dark-mode .admin-form-field label {
  color: #d1d5db !important;
}

body.dark-mode .admin-upload-btn {
  background: #24322a !important;
}

body.dark-mode .admin-welcome {
  color: #9ca3af !important;
}

body.dark-mode .admin-empty-state {
  color: #6b7280 !important;
}

/* دکمه حالت تاریک تو سایدبار ادمین */
.admin-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 12px 0;
  background: #f2faf5;
  border: none;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .9rem;
  color: #374151;
  cursor: pointer;
}

body.dark-mode .admin-theme-toggle {
  background: #24322a !important;
  color: #e5e7eb !important;
}

/* ================= پنل ادمین - آپشن‌های جدیدتر (فیلترها، مرتب‌سازی، جدول‌ها) ================= */

/* نوار فیلتر سفارش‌ها */
body.dark-mode .admin-filter-bar {
  background: #1b2420 !important;
  box-shadow: none !important;
}

body.dark-mode .admin-filter-field label {
  color: #9ca3af !important;
}

body.dark-mode .admin-filter-field input,
body.dark-mode .admin-filter-field select {
  background: #24322a !important;
  color: #e5e7eb !important;
  border-color: #3a4a3f !important;
}

body.dark-mode .admin-filter-reset-btn {
  background: #24322a !important;
  color: #d1d5db !important;
}

body.dark-mode .admin-filter-reset-btn:hover {
  background: #2c3a32 !important;
}

/* دراپ‌داون مرتب‌سازی محصولات و جستجو */
body.dark-mode .admin-sort-select {
  background: #24322a !important;
  color: #86c68d !important;
  border-color: #3a4a3f !important;
}

body.dark-mode .admin-search-box input {
  background: #24322a !important;
  color: #e5e7eb !important;
  border-color: #3a4a3f !important;
}

body.dark-mode .admin-search-box input::placeholder {
  color: #9ca3af !important;
}

body.dark-mode .admin-search-box i {
  color: #9ca3af !important;
}

/* دکمه افزودن و آیکون‌های ویرایش/حذف تو جدول‌ها */
body.dark-mode .admin-add-btn {
  background: #2f7a45 !important;
  color: #fff !important;
}

body.dark-mode .admin-add-btn:hover {
  background: #3a9155 !important;
}

body.dark-mode .admin-icon-btn.edit {
  background: #24322a !important;
  color: #86c68d !important;
}

body.dark-mode .admin-icon-btn.edit:hover {
  background: #558f57 !important;
  color: #fff !important;
}

body.dark-mode .admin-icon-btn.delete {
  background: #3a2323 !important;
  color: #f87171 !important;
}

body.dark-mode .admin-icon-btn.delete:hover {
  background: #dc2626 !important;
  color: #fff !important;
}

/* بج‌های وضعیت (سبز/خاکستری) */
body.dark-mode .admin-badge.green {
  background: #24322a !important;
  color: #86c68d !important;
}

body.dark-mode .admin-badge.gray {
  background: #2a2f2c !important;
  color: #9ca3af !important;
}

/* لیست آیتم‌های سفارش و باکس بارگذاری عکس */
body.dark-mode .admin-order-items {
  color: #9ca3af !important;
}

body.dark-mode .admin-modal-close {
  background: #24322a !important;
  color: #86c68d !important;
}

body.dark-mode .admin-image-preview {
  background: #24322a !important;
  border-color: #3a4a3f !important;
}

body.dark-mode .admin-mobile-menu-btn {
  background: #24322a !important;
  color: #86c68d !important;
}

body.dark-mode .admin-stat-label {
  color: #9ca3af !important;
}

/* ================= مودال ثبت‌نام / ورود / آدرس ارسال ================= */
/* .rm-title و .rm-sub رنگشون از var(--c-text) میاد که همیشه تیره‌ست؛
   رو پس‌زمینه‌ی تیره‌ی مودال (pm-modal/rm-modal) عملاً نامرئی می‌شه */
body.dark-mode .rm-title {
  color: #f3f4f6 !important;
}

body.dark-mode .rm-sub {
  color: #9ca3af !important;
}

body.dark-mode .rm-link-btn {
  color: #9ca3af !important;
}

/* .rm-input (فرم ثبت‌نام/ورود) و .am-input (فرم آدرس) پس‌زمینه‌ی سفید
   ثابت داشتن؛ تو حالت تاریک مثل یه حفره‌ی سفید وسط مودال تیره دیده می‌شد */
body.dark-mode .rm-input,
body.dark-mode .am-input {
  background: #24322a !important;
  color: #e5e7eb !important;
  border-color: #3a4a3f !important;
}

body.dark-mode .rm-input::placeholder,
body.dark-mode .am-input::placeholder {
  color: #77897d !important;
}

body.dark-mode select.am-input option {
  background: #24322a !important;
  color: #e5e7eb !important;
}

body.dark-mode .am-label {
  color: #e5e7eb !important;
}

body.dark-mode .am-optional {
  color: #9ca3af !important;
}

/* حالت سبز (پرشده) و قرمز (خالی‌مونده) فیلدهای آدرس - نسخه‌ی تیره‌شون */
body.dark-mode .am-input.am-valid {
  background: #16351f !important;
  border-color: #16a34a !important;
}

body.dark-mode .am-input.am-invalid {
  background: #3a1f1f !important;
  border-color: #e06a6a !important;
}

/* ================= صفحه علاقه‌مندی‌ها ================= */
body.dark-mode .fav-page-title h1 {
  color: #9fd4a6 !important;
}

body.dark-mode .fav-row {
  background: #1b2420 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35) !important;
}

body.dark-mode .fav-row-name {
  color: #e5e7eb !important;
}

body.dark-mode .fav-row-remove {
  background: #4a1f1f !important;
  color: #f87171 !important;
}

body.dark-mode .fav-empty {
  color: #9ca3af !important;
}

/* ================= صفحه درگاه پرداخت (payment.html) ================= */
body.dark-mode .pay-card {
  background: #1b2420 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
}

body.dark-mode .pay-title {
  color: #f3f4f6 !important;
}

body.dark-mode .pay-sub {
  color: #9ca3af !important;
}

body.dark-mode .pay-back {
  color: #9ca3af !important;
}

body.dark-mode .pay-summary,
body.dark-mode .pay-address {
  background: #24322a !important;
  color: #d1d5db !important;
}

body.dark-mode .pay-summary-row {
  color: #e5e7eb !important;
}

body.dark-mode .pay-summary-row-qty {
  color: #9ca3af !important;
}

body.dark-mode .pay-summary-row + .pay-summary-row {
  border-top-color: #3a4a3f !important;
}

body.dark-mode .pay-address strong {
  color: #f3f4f6 !important;
}

body.dark-mode .pay-total-row {
  background: #16351f !important;
}

body.dark-mode .pay-total-row span {
  color: #9fd4a6 !important;
}

body.dark-mode .pay-total-row strong {
  color: #6bcf7f !important;
}

body.dark-mode .pay-note {
  background: #2e2210 !important;
  color: #c9b896 !important;
}

body.dark-mode .pay-gateway-badge {
  background: #16351f !important;
  color: #9fd4a6 !important;
}

body.dark-mode .pay-order-id {
  background: #16351f !important;
  color: #9fd4a6 !important;
}

body.dark-mode .pay-cancel-btn {
  color: #9ca3af !important;
}

/* ================= تاریخچه خرید (تو cart.html - بخش cartOrdersSection) ================= */
body.dark-mode .cart-orders-title {
  color: #9fd4a6 !important;
}

body.dark-mode .cart-order-card {
  background: #1b2420 !important;
  border-color: #2a3a2f !important;
}

body.dark-mode .cart-order-id {
  color: #e5e7eb !important;
}

body.dark-mode .cart-order-card-items {
  color: #d1d5db !important;
}

body.dark-mode .cart-order-card-address {
  color: #9ca3af !important;
}

body.dark-mode .cart-order-card-bottom {
  color: #6bcf7f !important;
  border-top-color: #2a3a2f !important;
}

/* هر وضعیت سفارش، نسخه‌ی تیره‌ی خودش (همون رنگ ولی برای پس‌زمینه تیره) */
body.dark-mode .cart-order-status.processing,
body.dark-mode .cart-order-status.ready { background: #3a2f10 !important; color: #f2c675 !important; }
body.dark-mode .cart-order-status.cancelled { background: #3a1f1f !important; color: #f87171 !important; }
body.dark-mode .cart-order-status.packing { background: #1e2a3a !important; color: #7fb3f5 !important; }
body.dark-mode .cart-order-status.shipped,
body.dark-mode .cart-order-status.verified { background: #16351f !important; color: #6bcf7f !important; }
body.dark-mode .cart-order-status.hold { background: #2a2f2c !important; color: #9ca3af !important; }

/* ================= حالت خالی نمودارها (وقتی هنوز داده‌ای نیست) ================= */
body.dark-mode .admin-chart-empty {
  background: #1b2420 !important;
  color: #9ca3af !important;
}

body.dark-mode .admin-chart-empty i {
  color: #3a4a3f !important;
}
