/* ==========================================================================
   theme-fixes.css — یکدست‌سازی رنگ تم روشن/تاریک (1.1.30-mobile1-ai2)
   آخرین شیت در <head>؛ فقط رنگ — هیچ تغییر چیدمانی.
   تم فروشگاه: html[theme-color="dark"] | تم پنل: html[data-sm-dark="1"]
   ========================================================================== */

/* ---------- توکن‌های مشترک ---------- */
:root {
  --placeholder: #6b6e8a;           /* ≥4.5:1 روی سفید */
  --bs-code-color: #b52a6c;         /* صورتی بوت‌استرپ (#d63384) روی سطوح روشن ۳.۸ بود */
}
html[theme-color="dark"] {
  --card-2: #143a37;            /* جایگزین بنفش #332858 پالت قدیمی Suha */
  --placeholder: #7fa6a1;
  --bs-code-color: #f9a8d4;
  --bs-secondary-color: var(--muted);
  --bs-body-color: var(--text);
  scrollbar-color: #1f5a54 var(--surface);
}
html[theme-color="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[theme-color="dark"] ::-webkit-scrollbar-track { background: var(--surface); }
html[theme-color="dark"] ::-webkit-scrollbar-thumb { background: #1f5a54; border-radius: 10px; border: 2px solid var(--surface); }
html[theme-color="dark"] ::-webkit-scrollbar-thumb:hover { background: #2a7a72; }

/* متن کم‌رنگ بوت‌استرپ (#6c757d ثابت) → توکن تم */
.text-muted { color: var(--muted) !important; }
.form-text { color: var(--muted); }
.btn-outline-secondary { --bs-btn-color: var(--muted); }

/* placeholder ها */
.form-control::placeholder, .form-select::placeholder, textarea::placeholder, input::placeholder { color: var(--placeholder); opacity: 1; }
.header-area .nh-search .live-search-input::placeholder { color: var(--placeholder); }
html[data-sm-dark="1"] body.sm-page :is(.form-control, .form-select, textarea, select, input)::placeholder { color: #7d8aa0; }

/* لوگو: نسخهٔ «روی تیره» فقط در تم تیره (وقتی فروشگاه لوگوی جدا دارد) */
html:not([theme-color="dark"]):not([data-sm-dark="1"]) .nh-logo-on-dark { display: none !important; }
html[theme-color="dark"] .nh-logo-on-light:has(+ .nh-logo-on-dark),
html[data-sm-dark="1"] .nh-logo-on-light:has(+ .nh-logo-on-dark) { display: none !important; }

/* لوگو همیشه شفاف — بدون جعبه/پس‌زمینه جدا از تم */
.nh-brand-mark,
.nh-brand-mark img,
.nav-glass-logo,
.site-footer-logo img,
.noghreh-auth .auth-logo,
.header-area .logo-wrapper img {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

/* ---------- فروشگاه — تم تیره ---------- */
/* badge آبی‌روشن بوت‌استرپ با متن سفید (۱.۸:۱) → چیپ برند */
.badge.bg-info { background-color: var(--brand-soft) !important; color: var(--brand) !important; }

/* دکمهٔ نهایی پرداخت/ثبت هدیه: در تیره سفید-خاکستری بود → دکمهٔ برند مثل بقیهٔ CTA ها */
html[theme-color="dark"] .ck-pro { --ck-accent: var(--brand); }
html[theme-color="dark"] .ck-pro .ck-cta,
html[theme-color="dark"] .ck-pay .ck-cta { background: var(--brand); color: var(--brand-contrast); box-shadow: 0 12px 28px rgba(var(--brand-rgb), .22); }
html[theme-color="dark"] .ck-pro .ck-cta:hover,
html[theme-color="dark"] .ck-pay .ck-cta:hover { background: #5eead4; color: var(--brand-contrast); }
html[theme-color="dark"] .ck-pro .ck-progress li.is-current span,
html[theme-color="dark"] .ck-pro .ck-step-num { color: var(--brand-contrast); }
html[theme-color="dark"] .ck-pro .ck-progress li.is-done { color: #34d399; }
html[theme-color="dark"] .ck-pro .ck-progress li.is-done span { background: #10b981; color: var(--brand-contrast); }
html[theme-color="dark"] .order-detail-pro .od-step.is-done .od-step-dot { background: #10b981; color: var(--brand-contrast); }

/* چیپ/آیکن‌های وضعیت با پس‌زمینهٔ روشن ثابت → توکن‌های tint در تیره */
html[theme-color="dark"] {
  --tint-ok-bg: rgba(16, 185, 129, .16);  --tint-ok-fg: #6ee7b7;  --tint-ok-line: rgba(16, 185, 129, .35);
  --tint-warn-bg: rgba(245, 158, 11, .16); --tint-warn-fg: #fdba74; --tint-warn-line: rgba(245, 158, 11, .35);
  --tint-info-bg: rgba(59, 130, 246, .16); --tint-info-fg: #93c5fd;
  --tint-bad-bg: rgba(239, 68, 68, .16);   --tint-bad-fg: #fca5a5;
}
html[theme-color="dark"] .ck-pro .ck-alert.is-lock > i { background: var(--tint-ok-bg); color: var(--tint-ok-fg); }
html[theme-color="dark"] .ck-pro .ck-alert.is-warn > i { background: var(--tint-warn-bg); color: var(--tint-warn-fg); }
html[theme-color="dark"] .ck-pro .ck-alert.is-ship > i { background: var(--tint-info-bg); color: var(--tint-info-fg); }
html[theme-color="dark"] .combine-ship-card { background: var(--tint-ok-bg); border-color: var(--tint-ok-line); color: var(--text); }
html[theme-color="dark"] .wallet-tx.is-in .wallet-tx-icon { background: var(--tint-ok-bg); color: var(--tint-ok-fg); }
html[theme-color="dark"] .wallet-tx.is-out .wallet-tx-icon { background: var(--tint-bad-bg); color: var(--tint-bad-fg); }
html[theme-color="dark"] .hp-price-chg.is-up { background: var(--tint-ok-bg); color: var(--tint-ok-fg); }
html[theme-color="dark"] .hp-price-chg.is-down { background: var(--tint-bad-bg); color: var(--tint-bad-fg); }

/* خروج از حساب */
.st-logout { color: #be123c; }
html[theme-color="dark"] .st-logout { color: #fda4af; }

/* چیپ تغییر قیمت (تیکر و تابلو) — سبز/خاکستری روشن ۳.۶:۱ بود */
.live-price-chip .chip-chg.is-up, .price-live-change.is-up { color: #047857; }
.live-price-chip .chip-chg.is-flat { color: #4b5563; }
html[theme-color="dark"] .live-price-chip .chip-chg.is-up, html[theme-color="dark"] .price-live-change.is-up { color: #34d399; }
html[theme-color="dark"] .live-price-chip .chip-chg.is-flat { color: var(--muted); }
/* دکمهٔ افزودن به سبد: گرادیان نیلی ثابت (#100DD1) → رنگ برند */
.pd-add-btn { background-image: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 78%, #000)) !important; box-shadow: 0 10px 24px rgba(var(--brand-rgb), .28); }
.pd-add-btn:hover { background-image: linear-gradient(135deg, color-mix(in srgb, var(--brand) 90%, #000), color-mix(in srgb, var(--brand) 70%, #000)) !important; }
html[theme-color="dark"] .pd-add-btn { background-image: linear-gradient(135deg, var(--brand), #14b8a6) !important; }
html[theme-color="dark"] .pd-add-btn:hover { background-image: linear-gradient(135deg, #5eead4, var(--brand)) !important; }
/* breadcrumb محصول */
html:not([theme-color="dark"]) .pd-pro { --pd-muted: var(--muted); }

/* ---------- پنل مدیریت — روشن ---------- */
html { --sx-muted: #5b6b82; }
html[data-sm-dark="1"] { --sx-muted: #8b9bb4; }
body.sm-page :is(.sm-status-tabs, .sm-filters) a.is-active em { background: rgba(0, 0, 0, .22) !important; color: #fff !important; }
.sm-stat small { color: #15803d; }
.sm-chip.is-closed { color: #4b5563; }
.smx-badge--info { color: #fff !important; }

/* ---------- پنل مدیریت — تیره ---------- */
html[data-sm-dark="1"] body.sm-page .btn-outline-primary { color: var(--brand-ink) !important; border-color: rgba(94, 234, 212, .45) !important; }
html[data-sm-dark="1"] body.sm-page .btn-outline-primary:hover { background: var(--brand) !important; color: #fff !important; }
html[data-sm-dark="1"] body.sm-page .btn-outline-success,
html[data-sm-dark="1"] body.sm-page .btn-outline-success:focus {
  color: #4ade80 !important;
  border-color: rgba(74, 222, 128, .45) !important;
  background: rgba(74, 222, 128, .08) !important;
}
html[data-sm-dark="1"] body.sm-page .btn-outline-success:hover {
  color: #052e16 !important;
  background: #4ade80 !important;
  border-color: #4ade80 !important;
}
html[data-sm-dark="1"] body.sm-page .btn-sm-ghost {
  background: transparent !important;
  border-color: var(--d-border, #263248) !important;
  color: var(--d-text, #e5e7eb) !important;
}
html[data-sm-dark="1"] body.sm-page .sm-badge.is-ok {
  background: rgba(74, 222, 128, .13) !important;
  color: #4ade80 !important;
}
html[data-sm-dark="1"] body.sm-page .sm-badge.is-warn {
  background: rgba(251, 191, 36, .13) !important;
  color: #fbbf24 !important;
}
html[data-sm-dark="1"] body.sm-page .sm-badge.is-danger {
  background: rgba(248, 113, 113, .13) !important;
  color: #f87171 !important;
}
html[data-sm-dark="1"] body.sm-page .sm-badge.is-muted {
  background: rgba(148, 163, 184, .14) !important;
  color: #cbd5e1 !important;
}
html[data-sm-dark="1"] body.sm-page .sm-seg button.is-active { color: var(--brand-ink); }
html[data-sm-dark="1"] body.sm-page .pf-step { color: var(--brand-ink); background: rgba(94, 234, 212, .12); }
html[data-sm-dark="1"] body.sm-page .pf-nav a.is-active { color: var(--brand-ink); }
html[data-sm-dark="1"] body.sm-page .pf-req { color: #f87171; }
html[data-sm-dark="1"] body.sm-page .pf-serp-url { color: #86efac; }
html[data-sm-dark="1"] body.sm-page .smx-search kbd { background: var(--d-input); color: var(--d-muted); border-color: var(--d-border); }
html[data-sm-dark="1"] body.sm-page .sm-stat small { color: #86efac; }
html[data-sm-dark="1"] body.sm-page .sm-ai-pill.is-ok { background: var(--d-ok-bg); color: var(--d-ok); }
html[data-sm-dark="1"] body.sm-page .sm-ai-pill.is-off { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
html[data-sm-dark="1"] body.sm-page .sm-ai-pill.is-err { background: var(--d-bad-bg); color: var(--d-bad); }
html[data-sm-dark="1"] body.sm-page code { color: var(--bs-code-color); }

/* هشدارهای بوت‌استرپ در پنل تیره روشن می‌ماندند (لینک فیروزه‌ای روی زرد ۱.۳:۱) */
html[data-sm-dark="1"] body.sm-page .alert { border-color: var(--d-border); background: var(--d-card-2); color: var(--d-text); }
html[data-sm-dark="1"] body.sm-page .alert-warning { background: var(--d-warn-bg); color: var(--d-warn); border-color: rgba(245, 158, 11, .35); }
html[data-sm-dark="1"] body.sm-page .alert-success { background: var(--d-ok-bg); color: var(--d-ok); border-color: rgba(34, 197, 94, .35); }
html[data-sm-dark="1"] body.sm-page .alert-danger { background: var(--d-bad-bg); color: var(--d-bad); border-color: rgba(239, 68, 68, .35); }
html[data-sm-dark="1"] body.sm-page .alert-info,
html[data-sm-dark="1"] body.sm-page .alert-primary { background: var(--d-info-bg); color: var(--d-info); border-color: rgba(14, 165, 233, .35); }
html[data-sm-dark="1"] body.sm-page .alert :is(a, p, small, strong, b) { color: inherit !important; }
html[data-sm-dark="1"] body.sm-page .alert a { text-decoration: underline; }

/* ---------- دستیار مدیر (copilot) ---------- */
.cp-msg p { color: inherit; }
html[data-sm-dark="1"] .cp-msg.is-note { color: var(--d-muted); background: rgba(148, 163, 184, .1); }
html[data-sm-dark="1"] .cp-empty { color: var(--d-muted); }
html[data-sm-dark="1"] .cp-sugg button { color: #c4b5fd; }
html[data-sm-dark="1"] .cp-hist button:hover, html[data-sm-dark="1"] .cp-hist button.is-active { background: rgba(167, 139, 250, .14); }
html[data-sm-dark="1"] .cp-msg code { background: rgba(167, 139, 250, .16); color: #ddd6fe; }
html[data-sm-dark="1"] .cp-msg a { color: #c4b5fd; }
html[data-sm-dark="1"] .cp-msg.is-error { background: var(--d-bad-bg); color: var(--d-bad); border-color: rgba(239, 68, 68, .35); }
html[data-sm-dark="1"] .cp-tools span { background: rgba(148, 163, 184, .14); color: #cbd5e1; }
html[data-sm-dark="1"] .cp-tablewrap, html[data-sm-dark="1"] .cp-msg th, html[data-sm-dark="1"] .cp-msg td,
html[data-sm-dark="1"] .cp-diff th, html[data-sm-dark="1"] .cp-diff td { border-color: var(--d-border); }
html[data-sm-dark="1"] .cp-card-h small { color: var(--d-warn); }
html[data-sm-dark="1"] .cp-card-h i { color: #fbbf24; }
html[data-sm-dark="1"] .cp-diff .is-old { background: var(--d-bad-bg); color: var(--d-bad); text-decoration-color: rgba(252, 165, 165, .45); }
html[data-sm-dark="1"] .cp-diff .is-new { background: var(--d-ok-bg); color: var(--d-ok); }
html[data-sm-dark="1"] .cp-warn { color: var(--d-warn); }
html[data-sm-dark="1"] .cp-card[data-status="executed"] .cp-card-h { background: var(--d-ok-bg); }
html[data-sm-dark="1"] .cp-card[data-status="failed"] .cp-card-h { background: var(--d-bad-bg); }
html[data-sm-dark="1"] .cp-card[data-status="rejected"] .cp-card-h, html[data-sm-dark="1"] .cp-card[data-status="expired"] .cp-card-h { background: rgba(148, 163, 184, .08); }
html[data-sm-dark="1"] .cp-card[data-status="rejected"], html[data-sm-dark="1"] .cp-card[data-status="expired"], html[data-sm-dark="1"] .cp-card[data-status="failed"] { border-color: var(--d-border); }
html[data-sm-dark="1"] .cp-badge { background: rgba(148, 163, 184, .16); color: var(--d-text); }
html[data-sm-dark="1"] .cp-badge.is-executed { background: var(--d-ok-bg); color: var(--d-ok); }
html[data-sm-dark="1"] .cp-badge.is-failed { background: var(--d-bad-bg); color: var(--d-bad); }
html[data-sm-dark="1"] .cp-hint { color: var(--d-muted); }

/* راهنمای حجم تصویر (WebP) در فرم‌های پنل */
.sm-webp-hint { margin-top: .35rem; font-size: .78rem; line-height: 1.8; color: var(--sm-muted, #5b6b82); }
.sm-webp-hint i { color: var(--brand, #0d7377); }
html[data-sm-dark="1"] .sm-webp-hint i { color: var(--brand-ink, #5eead4); }

/* ── ai2 · حالت‌ها (hover/focus) ── */
/* «a:hover {color: brand !important}» متن دکمه‌های لینکیِ برند را هم‌رنگ پس‌زمینه می‌کرد (۱:۱) */
html a.btn-primary:hover, html a.btn-primary:focus, html a.btn-success:hover, html a.btn-success:focus,
html a.btn-info:hover, html a.btn-info:focus, html a.btn-sm-brand:hover, html a.btn-sm-brand:focus,
html a.pd-add-btn:hover, html a.nc-guest-start:hover, html a.badge.bg-primary:hover {
  color: var(--brand-contrast, #fff) !important;
}
html a.btn-outline-primary:hover, html a.btn-outline-primary:focus { color: var(--brand-contrast, #fff) !important; }
html[data-manage-light] a.btn-outline-primary:hover, html[data-manage-light] a.btn-sm-brand:hover { color: #fff !important; }
html[data-sm-dark="1"] a.btn-outline-primary:hover, html[data-sm-dark="1"] a.btn-sm-brand:hover { color: #fff !important; }
/* علاقه‌مندی کارت محصول: آیکن خاکستری ۲٫۵:۱ و hover قرمز که هیچ‌وقت اعمال نمی‌شد */
html .product-card .wishlist-btn:not(.is-active) { color: var(--muted, #63667f) !important; }
html .product-card .wishlist-btn:not(.is-active):hover,
html .product-card .wishlist-btn:not(.is-active):focus-visible { color: #e11d48 !important; }
html[theme-color="dark"] .product-card .wishlist-btn:not(.is-active):hover,
html[theme-color="dark"] .product-card .wishlist-btn:not(.is-active):focus-visible { color: #fb7185 !important; }
.product-card .wishlist-btn:focus-visible { outline: 2px solid var(--brand, #0d7377); outline-offset: 2px; }
/* پیش‌تنظیم ارائه‌دهندهٔ هوش مصنوعی در تیره: بنفش ۲٫۳:۱ */
html[data-sm-dark="1"] .sm-ai-presets button:hover { border-color: #a78bfa; color: #c4b5fd; }
/* فوکوس دکمهٔ برند پنل روشن‌تر از ۴٫۵:۱ می‌شد */
.btn-sm-brand:focus, .btn-sm-brand:focus-visible { filter: none; }
html[theme-color="dark"] .site-footer-cta.site-footer-cta--ghost:hover { background: rgba(45, 212, 191, .12); box-shadow: none; color: #5eead4 !important; border-color: rgba(45, 212, 191, .55); }
html a.calc-btn-primary:hover, html a.calc-btn-primary:focus, html a.calc-submit:hover { color: var(--brand-contrast, #fff) !important; }
.pd-review-submit, .pd-review-submit:hover, .pd-review-submit:focus, .pd-review-submit:focus-visible { color: var(--brand-contrast, #fff) !important; }
html a.btn-outline-primary:hover { background: var(--brand) !important; }
html:not([theme-color="dark"]) .wishlist-round:not(.is-active) { color: var(--muted, #63667f) !important; }
html:not([theme-color="dark"]) .star-btn.is-on, html:not([theme-color="dark"]) .star-btn.is-on i { color: #d97706 !important; }
html:not([theme-color="dark"]) .wishlist-round:not(.is-active):hover { color: #e11d48 !important; }

/* اعلان‌ها (toast) در پنل تیره: قبلاً همان کارت سفید حالت روشن می‌ماند */
html[data-sm-dark="1"] .noghreh-toast { background: var(--d-card, #162033) !important; border-color: var(--d-border, #263248) !important; color: var(--d-text, #e5e7eb) !important; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
html[data-sm-dark="1"] .noghreh-toast .toast-title { color: var(--d-muted, #9aa8bd); }
html[data-sm-dark="1"] .noghreh-toast .toast-msg { color: var(--d-text, #e5e7eb); }
html[data-sm-dark="1"] .noghreh-toast .toast-icon { background: rgba(94, 234, 212, .14); color: #5eead4; }
html[data-sm-dark="1"] .noghreh-toast.is-danger .toast-icon, html[data-sm-dark="1"] .noghreh-toast.is-error .toast-icon { background: rgba(244, 63, 94, .18); color: #fda4af; }
html[data-sm-dark="1"] .noghreh-toast.is-warning .toast-icon { background: rgba(245, 158, 11, .18); color: #fcd34d; }
html[data-sm-dark="1"] .noghreh-toast.is-info .toast-icon { background: rgba(96, 165, 250, .16); color: #93c5fd; }
html[data-sm-dark="1"] .noghreh-toast .toast-close { background: rgba(148, 163, 184, .14); color: var(--d-muted, #9aa8bd); }
html[data-sm-dark="1"] .noghreh-toast .toast-progress { background: rgba(148, 163, 184, .14); }
