/* حالت تیره: فقط توکن‌های معنایی و پل کلاس‌های خنثی. رنگ دکمهٔ پر (primary/button از ۵۰۰ به بالا) عوض نمی‌شود. */

html.theme-dark {
    color-scheme: dark;
    --hg-bg: #0f0e17;
    --hg-surface: #1c1a2e;
    --hg-surface-raised: #252338;
    --hg-surface-muted: #161424;
    --hg-surface-sunken: #13111f;
    --hg-hover: #2e2b45;
    --hg-header: #13111f;
    --hg-footer: #13111f;
    --hg-inverse: #0b0a12;
    --hg-inverse-2: #252338;
    --hg-on-inverse: #f0eef8;
    --hg-border: #2e2b45;
    --hg-border-subtle: #252240;
    --hg-border-strong: #4a4760;
    --hg-border-slate: #2e2b45;
    --hg-border-slate-strong: #4a4760;
    --hg-hairline: #252240;
    --hg-text: #f0eef8;
    --hg-text-secondary: #e8e6f0;
    --hg-text-muted: #9491a8;
    --hg-text-faint: #6e6b82;
    --hg-input: #13111f;
    --hg-overlay: rgba(0, 0, 0, 0.68);
    --hg-accent-text: color-mix(in srgb, var(--color-primary-hex, #047857) 42%, #fff);
    --hg-accent-soft: color-mix(in srgb, var(--color-primary-hex) 18%, var(--hg-surface-raised));
    --hg-accent-border: color-mix(in srgb, var(--color-primary-hex) 46%, var(--hg-border));
    --hg-link: color-mix(in srgb, var(--color-primary-hex) 48%, #fff);
    --hg-link-strong: color-mix(in srgb, var(--color-primary-hex) 34%, #fff);
    --hg-link-deep: color-mix(in srgb, var(--color-primary-hex) 26%, #fff);
    --hg-price: color-mix(in srgb, var(--color-primary-hex) 40%, #fff);
    --hg-on-accent: #ffffff;
    --hg-secondary-text: color-mix(in srgb, var(--color-secondary-hex) 78%, #fff);
    --hg-danger: #f87171;
    --hg-danger-text: #fecaca;
    --hg-danger-soft: #3a1d24;
    --hg-danger-border: #9f3a42;
    --hg-success: #4ade80;
    --hg-success-text: #bbf7d0;
    --hg-success-soft: #13261c;
    --hg-success-soft-2: #173222;
    --hg-success-soft-3: #1c3d2a;
    --hg-success-border: #2f7d52;
    --hg-success-border-2: #3d9a68;
    --hg-success-border-3: #6ee7b7;
    --hg-warning: #fbbf24;
    --hg-warning-text: #fde68a;
    --hg-warning-text-2: #fcd34d;
    --hg-warning-soft: #3a2c12;
    --hg-warning-soft-2: #4a3816;
    --hg-warning-soft-3: #5c4618;
    --hg-warning-border: #a16207;
    --hg-warning-border-2: #ca8a04;
    --hg-info: #93c5fd;
    --hg-info-text: #bfdbfe;
    --hg-info-soft: #17233a;
    --hg-info-soft-2: #1e3a5f;
    --hg-ring: color-mix(in srgb, var(--color-primary-hex) 50%, #fff);
    --hg-captcha-bg: var(--hg-warning-soft-2);
    --hg-captcha-text: var(--hg-text);
    --scrollbar-track: #13111f;
    --scrollbar-thumb: #4a4760;
    --scrollbar-thumb-hover: var(--hg-accent-text);
    --e-global-color-text: var(--hg-text);
    --tw-ring-offset-color: #1c1a2e;
    --shadow-xs: 0 1px 2px 0 #0006;
    --shadow-sm: 0 1px 3px 0 #00000080, 0 1px 2px 0 #0006;
    --shadow-md: 0 4px 6px -1px #0000008c, 0 2px 4px -1px #0006;
    --shadow-lg: 0 10px 15px -3px #0009, 0 4px 6px -2px #0006;

    /* ته‌رنگ روشن برند، از خود رنگ تنظیمات. پلهٔ ۵۰۰ به بالا برای دکمهٔ پر دست نمی‌خورد. */
    --color-primary-50-hex: var(--hg-accent-soft);
    --color-primary-100-hex: color-mix(in srgb, var(--color-primary-hex) 26%, var(--hg-surface-raised));
    --color-primary-200-hex: var(--hg-accent-border);
    --color-primary-300-hex: color-mix(in srgb, var(--color-primary-hex) 58%, var(--hg-border));
    --color-button-50-hex: color-mix(in srgb, var(--color-button-hex) 16%, var(--hg-surface-raised));
    --color-button-100-hex: color-mix(in srgb, var(--color-button-hex) 24%, var(--hg-surface-raised));
    --color-button-200-hex: color-mix(in srgb, var(--color-button-hex) 42%, var(--hg-border));
    --color-purchase-50-hex: color-mix(in srgb, var(--color-purchase-hex) 16%, var(--hg-surface-raised));
    --color-purchase-100-hex: color-mix(in srgb, var(--color-purchase-hex) 24%, var(--hg-surface-raised));
    --color-secondary-50-hex: color-mix(in srgb, var(--color-secondary-hex) 14%, var(--hg-surface-raised));
    --color-secondary-100-hex: color-mix(in srgb, var(--color-secondary-hex) 22%, var(--hg-surface-raised));
    --color-secondary-200-hex: color-mix(in srgb, var(--color-secondary-hex) 40%, var(--hg-border));
    --color-tertiary-50-hex: var(--hg-surface-muted);
    --color-tertiary-100-hex: var(--hg-surface-raised);
    --color-tertiary-200-hex: var(--hg-border);
}

html.theme-dark,
html.theme-dark body {
    background-color: var(--hg-bg);
    color: var(--hg-text);
}

html.theme-dark :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-color: var(--hg-ring);
}

html.theme-dark ::selection {
    background: color-mix(in srgb, var(--hg-accent-text) 32%, var(--hg-surface));
    color: var(--hg-text);
}

html.theme-dark hr {
    border-color: var(--hg-border);
}

html.theme-dark mark {
    background: var(--hg-warning-soft);
    color: var(--hg-text);
}

/* پس‌زمینهٔ خنثی */
html.theme-dark :is(
    .bg-white,
    .bg-\[\#fff\],
    .bg-\[\#ffffff\],
    .bg-\[\#FFF\],
    .bg-\[\#FFFFFF\]
) {
    background-color: var(--hg-surface);
}

html.theme-dark :is(.bg-white\/70, .bg-white\/80, .bg-white\/90, .hover\:bg-white\/80:hover) {
    background-color: color-mix(in srgb, var(--hg-surface) 88%, transparent);
}

html.theme-dark :is(.bg-\[\#fafafa\], .bg-\[\#FAFAFA\]) {
    background-color: var(--hg-bg);
}

html.theme-dark :is(
    .bg-gray-50,
    .bg-slate-50,
    .bg-zinc-50,
    .bg-neutral-50,
    .bg-gray-50\/50,
    .bg-gray-50\/60,
    .bg-gray-50\/70,
    .bg-gray-50\/80,
    .bg-gray-50\/40,
    .bg-gray-50\/30
) {
    background-color: var(--hg-surface-sunken);
}

html.theme-dark :is(.bg-gray-100, .bg-slate-100, .bg-neutral-100, .bg-zinc-100, .bg-gray-100\/90, .bg-gray-100\/70) {
    background-color: var(--hg-surface-muted);
}

html.theme-dark :is(.bg-gray-200, .bg-slate-200, .bg-gray-300) {
    background-color: var(--hg-hover);
}

html.theme-dark :is(.bg-gray-800, .bg-gray-800\/80) {
    background-color: var(--hg-inverse-2);
}

html.theme-dark .bg-gray-900 {
    background-color: var(--hg-inverse);
}

html.theme-dark :is(
    .hover\:bg-white:hover,
    .hover\:bg-gray-50:hover,
    .hover\:bg-gray-100:hover,
    .hover\:bg-gray-200:hover,
    .hover\:bg-gray-300:hover,
    .hover\:bg-gray-50\/80:hover,
    .focus\:bg-white:focus,
    .group:hover .group-hover\:bg-white
) {
    background-color: var(--hg-hover);
}

/* متن */
html.theme-dark :is(
    .text-black,
    .text-gray-900,
    .text-gray-800,
    .text-slate-900,
    .text-slate-800,
    .text-neutral-900,
    .text-zinc-900
) {
    color: var(--hg-text);
}

html.theme-dark :is(
    .text-gray-700,
    .text-gray-600,
    .text-slate-700,
    .text-slate-600
) {
    color: var(--hg-text-secondary);
}

html.theme-dark :is(
    .text-gray-500,
    .text-gray-400,
    .text-gray-300,
    .text-slate-500,
    .text-slate-400
) {
    color: var(--hg-text-muted);
}

html.theme-dark :is(
    .hover\:text-black:hover,
    .hover\:text-gray-900:hover,
    .hover\:text-gray-800:hover,
    .hover\:text-gray-700:hover,
    .hover\:text-gray-600:hover
) {
    color: var(--hg-text);
}

html.theme-dark :is(
    .text-primary,
    .text-primary-500,
    .text-primary-600,
    .text-primary-700,
    .text-primary-800,
    .text-primary-900,
    .hover\:text-primary:hover,
    .hover\:text-primary-600:hover,
    .hover\:text-primary-700:hover,
    .hover\:text-primary-800:hover,
    .hover\:text-primary-900:hover,
    .hover\:text-primary\/95:hover,
    .group:hover .group-hover\:text-primary-600,
    .group:hover .group-hover\:text-primary-700
) {
    color: var(--hg-accent-text) !important;
}

html.theme-dark :is(
    .text-secondary-600,
    .text-secondary-700,
    .text-secondary-800,
    .text-secondary-900,
    .hover\:text-secondary-600:hover,
    .hover\:text-secondary-700:hover
) {
    color: var(--hg-secondary-text) !important;
}

/* ته‌رنگ‌های Tailwind از rgb روشن می‌آیند؛ اینجا با همان توکن برند عوض می‌شوند. */
html.theme-dark :is(
    .bg-primary-50,
    .bg-primary-100,
    .bg-primary-200,
    .bg-secondary-50,
    .bg-secondary-100,
    .bg-button-50,
    .bg-accent-50,
    .bg-accent-100,
    .hover\:bg-primary-50:hover,
    .hover\:bg-primary-100:hover,
    .hover\:bg-primary-200:hover,
    .hover\:bg-secondary-50:hover,
    .hover\:bg-secondary-100:hover,
    .group:hover .group-hover\:bg-primary-50,
    .group:hover .group-hover\:bg-primary-100,
    .group:hover .group-hover\:bg-primary-200
) {
    background-color: var(--hg-accent-soft) !important;
}

html.theme-dark :is(
    .bg-secondary-50,
    .bg-secondary-100,
    .hover\:bg-secondary-50:hover,
    .hover\:bg-secondary-100:hover
) {
    background-color: var(--color-secondary-50-hex) !important;
}

html.theme-dark :is(
    .border-primary-100,
    .border-primary-200,
    .border-primary-300,
    .hover\:border-primary-200:hover,
    .hover\:border-primary-300:hover
) {
    border-color: var(--hg-accent-border) !important;
}

/* وضعیت‌ها: زمینهٔ پاستلی و متن تیره روی آن */
html.theme-dark :is(
    .bg-red-50,
    .bg-red-100,
    .bg-rose-100,
    .bg-red-50\/50,
    .hover\:bg-red-50:hover,
    .hover\:bg-red-100:hover
) {
    background-color: var(--hg-danger-soft);
}

html.theme-dark :is(
    .text-red-500,
    .text-red-600,
    .text-red-700,
    .text-red-800,
    .text-red-900,
    .text-rose-600,
    .text-rose-800,
    .hover\:text-red-600:hover,
    .hover\:text-red-700:hover,
    .hover\:text-red-900:hover
) {
    color: var(--hg-danger-text);
}

html.theme-dark :is(.border-red-100, .border-red-200, .border-red-300) {
    border-color: var(--hg-danger-border);
}

html.theme-dark :is(
    .bg-green-50,
    .bg-green-100,
    .bg-emerald-50,
    .bg-emerald-100,
    .bg-emerald-50\/40,
    .bg-emerald-50\/80,
    .from-green-50\/50,
    .from-emerald-50,
    .from-emerald-100,
    .to-teal-50,
    .to-teal-100,
    .hover\:bg-emerald-100:hover,
    .hover\:from-emerald-100:hover,
    .hover\:to-teal-100:hover
) {
    background-color: var(--hg-success-soft);
    background-image: none;
}

html.theme-dark :is(
    .text-green-500,
    .text-green-600,
    .text-green-700,
    .text-green-800,
    .text-green-900,
    .text-emerald-600,
    .text-emerald-700,
    .text-emerald-800,
    .text-emerald-900,
    .text-emerald-600\/90,
    .text-emerald-900\/90,
    .hover\:text-green-800:hover,
    .hover\:text-green-900:hover
) {
    color: var(--hg-success-text);
}

html.theme-dark :is(
    .border-green-100,
    .border-green-200,
    .border-green-300,
    .border-emerald-50,
    .border-emerald-100,
    .border-emerald-200,
    .border-emerald-200\/60,
    .border-emerald-200\/80,
    .border-emerald-200\/90,
    .hover\:border-green-300:hover,
    .hover\:border-emerald-300:hover
) {
    border-color: var(--hg-success-border);
}

html.theme-dark :is(
    .bg-amber-50,
    .bg-amber-100,
    .bg-yellow-100,
    .bg-orange-100,
    .bg-amber-50\/30,
    .bg-amber-50\/40,
    .bg-amber-50\/50,
    .from-amber-50,
    .from-yellow-50,
    .from-orange-50,
    .to-amber-50\/40,
    .to-yellow-100,
    .to-orange-50,
    .to-orange-100,
    .hover\:bg-amber-50:hover,
    .hover\:bg-amber-100:hover,
    .hover\:from-amber-100:hover,
    .hover\:to-orange-100:hover
) {
    background-color: var(--hg-warning-soft);
    background-image: none;
}

html.theme-dark :is(
    .text-amber-500,
    .text-amber-600,
    .text-amber-700,
    .text-amber-800,
    .text-amber-900,
    .text-amber-950,
    .text-amber-700\/80,
    .text-amber-700\/90,
    .text-amber-900\/70,
    .text-amber-900\/80,
    .text-yellow-600,
    .text-yellow-800,
    .text-yellow-900,
    .text-orange-800,
    .hover\:text-amber-700:hover,
    .hover\:text-amber-800:hover,
    .hover\:text-amber-900:hover,
    .hover\:text-orange-900:hover
) {
    color: var(--hg-warning-text);
}

html.theme-dark :is(
    .border-amber-100,
    .border-amber-200,
    .border-amber-300,
    .border-amber-200\/70,
    .border-amber-200\/80,
    .border-amber-200\/90,
    .border-yellow-300,
    .hover\:border-amber-200:hover,
    .hover\:border-amber-300:hover,
    .hover\:border-amber-400:hover
) {
    border-color: var(--hg-warning-border);
}

html.theme-dark :is(.bg-blue-100, .bg-sky-50, .from-sky-50, .from-sky-100, .to-blue-50, .to-blue-100, .hover\:from-sky-100:hover, .hover\:to-blue-100:hover) {
    background-color: var(--hg-info-soft);
    background-image: none;
}

html.theme-dark :is(
    .from-violet-50,
    .from-violet-100,
    .to-purple-50,
    .to-purple-100,
    .bg-violet-50,
    .bg-purple-50,
    .hover\:from-violet-100:hover,
    .hover\:to-purple-100:hover
) {
    background-color: #2a2344;
    background-image: none;
}

html.theme-dark :is(
    .text-violet-600,
    .text-violet-600\/90,
    .text-violet-900,
    .text-purple-900
) {
    color: #ddd6fe;
}

html.theme-dark :is(
    .border-violet-200,
    .border-violet-200\/90,
    .border-violet-300,
    .border-purple-200,
    .hover\:border-violet-300:hover
) {
    border-color: #6d28d9;
}

html.theme-dark :is(.text-blue-800, .text-sky-900, .text-sky-600\/90, .hover\:text-blue-900:hover) {
    color: var(--hg-info-text);
}

html.theme-dark :is(
    .border-sky-200,
    .border-sky-200\/90,
    .border-sky-300,
    .border-blue-200,
    .hover\:border-sky-300:hover
) {
    border-color: #3b6ea5;
}

/* حاشیه و جداکننده */
html.theme-dark :is(
    .border-gray-50,
    .border-gray-100,
    .border-gray-200,
    .border-slate-100,
    .border-slate-200,
    .border-gray-200\/80,
    .border-gray-200\/90
) {
    border-color: var(--hg-border);
}

html.theme-dark :is(
    .border-gray-300,
    .border-gray-400,
    .border-slate-300,
    .hover\:border-gray-300:hover,
    .hover\:border-gray-400:hover
) {
    border-color: var(--hg-border-strong);
}

html.theme-dark :is(.divide-gray-100, .divide-gray-200, .divide-gray-300) > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--hg-border);
}

html.theme-dark :is(.ring-gray-200, .ring-white, .focus\:ring-gray-300:focus) {
    --tw-ring-color: var(--hg-border-strong);
}

html.theme-dark :is(
    .focus\:ring-primary:focus,
    .focus\:ring-primary-100:focus,
    .focus\:ring-primary-200:focus,
    .focus\:ring-primary-300:focus,
    .focus\:ring-primary-500:focus,
    .focus\:border-primary:focus,
    .focus\:border-primary-400:focus,
    .focus\:border-primary-500:focus
) {
    --tw-ring-color: var(--hg-ring);
    border-color: var(--hg-ring);
}

/* گرادیان‌های سفید و خاکستری. گرادیان primary از متغیر ته‌رنگ می‌آید. */
html.theme-dark .from-white {
    --tw-gradient-from: var(--hg-surface) var(--tw-gradient-from-position);
    --tw-gradient-to: transparent var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
html.theme-dark .via-white {
    --tw-gradient-stops: var(--tw-gradient-from), var(--hg-surface) var(--tw-gradient-via-position), var(--tw-gradient-to);
}
html.theme-dark .to-white {
    --tw-gradient-to: var(--hg-surface) var(--tw-gradient-to-position);
}
html.theme-dark :is(.from-gray-50, .from-slate-50, .via-gray-50) {
    --tw-gradient-from: var(--hg-bg) var(--tw-gradient-from-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
html.theme-dark :is(.to-gray-50, .to-gray-50\/50, .to-gray-50\/80, .to-slate-50\/80) {
    --tw-gradient-to: var(--hg-bg) var(--tw-gradient-to-position);
}
html.theme-dark :is(.from-gray-100, .from-gray-200, .to-gray-100, .to-gray-200, .to-gray-300) {
    --tw-gradient-from: var(--hg-surface-muted) var(--tw-gradient-from-position);
    --tw-gradient-to: var(--hg-surface) var(--tw-gradient-to-position);
}

html.theme-dark :is(.placeholder-gray-400, .placeholder-gray-500)::placeholder,
html.theme-dark :is(.placeholder\:text-gray-400, .placeholder\:text-gray-500)::placeholder {
    color: var(--hg-text-faint);
    opacity: 1;
}

/* فرم‌ها */
html.theme-dark :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="hidden"]),
    textarea,
    select
) {
    background-color: var(--hg-input);
    color: var(--hg-text);
    border-color: var(--hg-border-strong);
}

html.theme-dark :is(input, textarea)::placeholder {
    color: var(--hg-text-faint);
}

html.theme-dark :is(input, textarea, select):focus {
    border-color: var(--hg-ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hg-ring) 35%, transparent);
    outline: none;
}

html.theme-dark :is(input, textarea, select):disabled {
    background-color: var(--hg-surface-muted);
    color: var(--hg-text-faint);
}

html.theme-dark input:-webkit-autofill,
html.theme-dark textarea:-webkit-autofill,
html.theme-dark select:-webkit-autofill {
    -webkit-text-fill-color: var(--hg-text);
    caret-color: var(--hg-text);
    box-shadow: 0 0 0 1000px var(--hg-input) inset;
    transition: background-color 9999s ease-out;
}

html.theme-dark option,
html.theme-dark optgroup {
    background-color: var(--hg-surface);
    color: var(--hg-text);
}

html.theme-dark :is(input[type="checkbox"], input[type="radio"]) {
    accent-color: var(--color-primary-hex, #047857);
}

/* جدول */
html.theme-dark :is(table, thead, tbody, th, td) {
    border-color: var(--hg-border);
}
html.theme-dark thead,
html.theme-dark th {
    background-color: var(--hg-surface-muted);
    color: var(--hg-text);
}
html.theme-dark tbody tr {
    background-color: var(--hg-surface);
}
html.theme-dark td {
    color: var(--hg-text-secondary);
}

html.theme-dark .product-description-inner,
html.theme-dark .product-description-content,
html.theme-dark .seo-content-prose {
    color: var(--hg-text-secondary);
}
html.theme-dark :is(.product-description-inner, .product-description-content, .seo-content-prose) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--hg-text);
}

/* متن سفید روی دکمهٔ رنگی باید سفید بماند */
html.theme-dark :is(.text-white, .text-white\/80, .text-white\/85, .text-white\/90, .text-white\/95),
html.theme-dark :is(.hover\:text-white:hover, .focus\:text-white:focus),
html.theme-dark .group:hover :is(.group-hover\:text-white, .group-hover\:bg-secondary) {
    color: #fff;
}
html.theme-dark .group:hover .group-hover\:bg-secondary {
    background-color: rgb(var(--color-secondary) / 1);
    color: var(--color-on-secondary-hex, #111827);
}

html.theme-dark .home-filter-btn.home-filter-active,
html.theme-dark .home-filter-btn.home-filter-active:hover {
    color: var(--hg-on-accent);
    background: var(--color-primary-hex);
    border-color: var(--color-primary-hex);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: var(--hg-text-secondary);
    cursor: pointer;
}
.panel-simple-header .theme-toggle.panel-header-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--hg-surface-sunken, #f9fafb);
    border: 1px solid var(--hg-border, #e5e7eb);
    color: var(--hg-text-secondary, #4b5563);
}
.theme-toggle:hover,
.panel-simple-header .theme-toggle.panel-header-icon-btn:hover {
    background: var(--hg-hover);
    color: var(--hg-text);
}
.theme-toggle:focus-visible {
    outline: 2px solid var(--hg-ring);
    outline-offset: 2px;
}
.theme-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
}
html.theme-dark .theme-toggle__sun { display: none; }
html:not(.theme-dark) .theme-toggle__moon { display: none; }

html.theme-dark :has(> .site-logo--dark) > .site-logo--light { display: none; }
html:not(.theme-dark) .site-logo--dark { display: none; }

html.theme-dark .auth-bg-gradient {
    background-color: var(--hg-bg);
    background-image:
        radial-gradient(ellipse 120% 80% at 20% 10%, color-mix(in srgb, var(--color-primary-hex) 22%, transparent) 0%, transparent 55%),
        radial-gradient(ellipse 100% 60% at 85% 85%, color-mix(in srgb, var(--color-secondary-hex) 14%, transparent) 0%, transparent 50%),
        linear-gradient(180deg, var(--hg-bg), var(--hg-surface-muted));
}

html.theme-dark :is(.product-files-modal__index, .panel-badge--success, .notification-modal-btn-read:hover) {
    background: var(--hg-success-soft-3);
    color: var(--hg-success-text);
}

html.theme-dark .pl-notice--gold {
    background: var(--color-secondary-50-hex);
    color: var(--hg-text);
    border-color: var(--color-secondary-200-hex);
}

html.theme-dark .blog-post-content .blog-callout--tip {
    background: var(--hg-success-soft);
    border-color: var(--hg-success-border);
}

html.theme-dark .blog-cat-pill--1 { color: #7dd3fc; }
html.theme-dark .blog-cat-pill--1:hover { background: color-mix(in srgb, #0284c7 22%, var(--hg-surface)); }
html.theme-dark .blog-cat-pill--2 { color: #5eead4; }
html.theme-dark .blog-cat-pill--2:hover { background: var(--hg-success-soft); }
html.theme-dark .blog-cat-pill--5 { color: #fda4af; }
html.theme-dark .blog-cat-pill--5:hover { background: var(--hg-danger-soft); }
html.theme-dark .blog-cat-pill--6 { color: #c7d2fe; }
html.theme-dark .blog-cat-pill--6:hover { background: var(--hg-info-soft); }
html.theme-dark .blog-cat-pill--7 { color: #fdba74; }

/* آیکن‌های خطی هدر و فوتر در حالت تیره سفید */
html.theme-dark :is(.header-ink-icon, .header-user-menu-trigger svg, .header-search-trigger svg) {
    color: #fff !important;
}
html.theme-dark :is(.header-ink-icon svg, .header-user-menu-trigger svg, .header-search-trigger svg) {
    color: #fff !important;
    stroke: currentColor;
}
html.theme-dark :is(.footer-guarantee-icon, .footer-stat-item > span) {
    color: #fff !important;
}
html.theme-dark :is(.footer-guarantee-icon, .footer-stat-item > span) svg {
    color: #fff !important;
    stroke: currentColor;
}
html.theme-dark .header-mini-card-title svg {
    color: var(--hg-accent-text);
}

/* پسند و ذخیرهٔ روی کارت: زمینه تیره است ولی رنگ آیکن در استایل کارت سیاه مانده */
html.theme-dark .product-card-action-btn,
html.theme-dark .product-card-action-btn:hover {
    color: #fff;
    border-color: var(--hg-border-strong);
}
html.theme-dark .product-card-action-btn.is-active {
    color: var(--hg-danger);
}
html.theme-dark .pcj-format {
    color: #fff;
    border-color: var(--hg-border);
}
html.theme-dark .product-quick-icon,
html.theme-dark .product-quick-icon:hover {
    color: #fff;
}
html.theme-dark .product-quick-icon.text-amber-600,
html.theme-dark .product-quick-icon.text-amber-600:hover {
    color: var(--hg-warning-text);
}
html.theme-dark .product-meta-actions__btn {
    color: #fff;
}
html.theme-dark .product-meta-actions__btn:hover {
    color: var(--hg-accent-text);
}

html.theme-dark .welcome-coupon-banner__cart-link {
    background-color: var(--hg-surface-raised) !important;
    background-image: none !important;
    border-top-color: var(--hg-border) !important;
    color: #fff !important;
}
html.theme-dark .welcome-coupon-banner__cart-link:hover {
    background-color: var(--hg-hover) !important;
    color: #fff !important;
}
html.theme-dark .welcome-coupon-banner__cart-link svg {
    color: #fff;
    stroke: currentColor;
}
html.theme-dark .welcome-coupon-banner__row .from-primary-50 {
    background-color: var(--hg-accent-soft) !important;
    background-image: none !important;
}

/* ته‌رنگ‌های شفاف primary در Tailwind جدا از bg-primary-50 هستند و روشن می‌مانند */
html.theme-dark :is(
    .bg-primary-50\/30,
    .bg-primary-50\/40,
    .bg-primary-50\/50,
    .bg-primary-50\/60,
    .bg-primary-50\/70,
    .bg-primary-50\/80,
    .bg-primary-100\/30,
    .bg-primary-100\/60,
    .bg-primary-100\/80,
    .hover\:bg-primary-50\/40:hover,
    .hover\:bg-primary-50\/50:hover,
    .hover\:bg-primary-50\/60:hover,
    .hover\:bg-primary-100\/60:hover,
    .hover\:bg-primary-100\/80:hover
) {
    background-color: var(--hg-accent-soft) !important;
}
html.theme-dark :is(.home-modal-open-calendar, .home-modal-open-quick-access) {
    color: var(--hg-accent-text) !important;
    border-color: var(--hg-accent-border) !important;
}
html.theme-dark :is(.home-modal-open-calendar, .home-modal-open-quick-access):hover {
    background-color: color-mix(in srgb, var(--color-primary-hex, #047857) 28%, var(--hg-surface-raised)) !important;
    border-color: var(--hg-accent-text) !important;
    color: var(--hg-accent-text) !important;
}

/* مگامنوی ستونی متغیر ته‌رنگ روشن را دوباره تعریف می‌کند؛ اینجا با هاور مگامنوی ساده یکی می‌شود */
html.theme-dark :is(.hg-mega, .hg-mega-mobile) {
    --hg-accent: var(--hg-accent-text);
    --hg-accent-strong: var(--hg-link);
    --hg-accent-soft: color-mix(in srgb, var(--color-primary-hex, #047857) 18%, var(--hg-surface-raised));
    --hg-focus: var(--hg-ring);
}
html.theme-dark .hg-mega__layout {
    border-color: var(--hg-border-subtle);
    box-shadow: var(--shadow-lg);
}
html.theme-dark .hg-mega__side {
    border-left-color: var(--hg-border-subtle);
}
html.theme-dark :is(.hg-mega__side-btn, .hg-mega__side-link) {
    border: 0;
    box-shadow: none;
    background: transparent;
}
html.theme-dark :is(
    .hg-mega__links a:hover,
    .hg-mega__side-btn:hover,
    .hg-mega__side-link:hover,
    .hg-mega__side-btn.is-active,
    .hg-mega__side-btn.is-active:hover,
    .hg-mega-mobile__links a:hover
) {
    background: var(--hg-accent-soft);
    color: var(--hg-accent-text);
    box-shadow: none;
}

.auth-theme-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 40;
}
