/* ═══════════════════════════════════════════════════════════════════════
   DARK MODE — Overrides when html[data-theme="dark"]
   Works with both site_en.css and site_ar.css
   ═══════════════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
    --desert-cream: #1a1a1c;
    --desert-dark: #e8e4dc;
    --desert-sand: #2d2a26;
    --desert-brown: #c4a574;
    --desert-accent: #d4a84a;
    --desert-border: #3d3832;
    --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
    --shadow-md: 0 2px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

/* Body & base */
html[data-theme="dark"] body {
    background-color: #1a1a1c;
    color: #e8e4dc;
}

html[data-theme="dark"] main { background: #1a1a1c; }

html[data-theme="dark"] .prod-grid,
html[data-theme="dark"] .prod-mini-grid { background: transparent; }

/* Topbar — slightly lighter for contrast */
html[data-theme="dark"] .topbar {
    background-color: #151412;
    color: #d4cfc4;
}

html[data-theme="dark"] .topbar a { color: #d4cfc4; }
html[data-theme="dark"] .topbar-sep { color: #5a5348; }

/* Main Navbar */
html[data-theme="dark"] .navbar-main {
    background: #22201c;
    border-bottom-color: var(--desert-gold);
    box-shadow: 0 2px 16px rgba(0,0,0,.4);
}

html[data-theme="dark"] .navbar-brand-text { color: #e8e4dc !important; }
html[data-theme="dark"] .navbar-brand-text:hover { color: var(--desert-gold) !important; }

/* Search */
html[data-theme="dark"] .search-input {
    background: #2d2a26;
    border-color: var(--desert-border);
    color: #e8e4dc;
}

html[data-theme="dark"] .search-input::placeholder { color: #8a8378; }
html[data-theme="dark"] .search-input:focus {
    background: #35322c;
    border-color: var(--desert-gold);
}

/* Search autocomplete */
html[data-theme="dark"] .search-autocomplete-dropdown {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .search-autocomplete-dropdown .ac-item {
    border-color: #3d3832;
    color: #e8e4dc;
}

html[data-theme="dark"] .search-autocomplete-dropdown .ac-item:hover { background: #35322c; }

/* Category nav — brighter text for clear contrast */
html[data-theme="dark"] .cat-nav-wrap {
    background: #22201c;
    border-bottom-color: var(--desert-border);
}

html[data-theme="dark"] .cat-all-btn {
    background: var(--desert-gold);
    color: #1a1a1c;
}

html[data-theme="dark"] .cat-all-btn:hover {
    background: var(--desert-accent);
    color: #1a1a1c;
}

html[data-theme="dark"] .cat-tab-btn,
html[data-theme="dark"] .cat-deals-link,
html[data-theme="dark"] .cat-vendors-link {
    color: #f0ebe3;
}

html[data-theme="dark"] .cat-tab-btn:hover,
html[data-theme="dark"] .cat-deals-link:hover,
html[data-theme="dark"] .cat-vendors-link:hover {
    color: var(--desert-gold);
}

html[data-theme="dark"] .cat-tab-btn.active {
    color: var(--desert-gold);
    border-bottom-color: var(--desert-gold);
}

html[data-theme="dark"] .cat-vendors-featured {
    color: #8b6914 !important;
    background: linear-gradient(90deg, rgba(255,226,179,.35) 0%, rgba(255,226,179,.2) 50%, rgba(255,226,179,.35) 100%);
    border-color: rgba(255,226,179,.5);
}

html[data-theme="dark"] .cat-vendors-featured:hover {
    color: #1a1208 !important;
    background: linear-gradient(135deg, rgba(255,226,179,.5) 0%, rgba(255,221,158,.4) 100%);
    border-color: #FFE2B3;
}

/* Cat panel */
html[data-theme="dark"] .cat-panel {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .cat-panel-head { border-color: var(--desert-border); }
html[data-theme="dark"] .cat-panel-title { color: #e8e4dc; }

/* Product cards — cat panel, products page, home */
html[data-theme="dark"] .prod-card,
html[data-theme="dark"] .prod-mini-card,
html[data-theme="dark"] .hp-card {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .prod-card:hover,
html[data-theme="dark"] .prod-mini-card:hover,
html[data-theme="dark"] .hp-card:hover {
    border-color: var(--desert-gold);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

html[data-theme="dark"] .prod-card-body,
html[data-theme="dark"] .prod-card-img,
html[data-theme="dark"] .hp-card-img-wrap { background: transparent; }

html[data-theme="dark"] .prod-card-img { background: #35322c !important; }
html[data-theme="dark"] .prod-card-no-img,
html[data-theme="dark"] .hp-no-img { background: #35322c !important; }

html[data-theme="dark"] .prod-name,
html[data-theme="dark"] .prod-mini-name,
html[data-theme="dark"] .prod-card-name,
html[data-theme="dark"] .hp-name { color: #e8e4dc; }

html[data-theme="dark"] .prod-card-name:hover,
html[data-theme="dark"] .hp-name:hover { color: var(--desert-gold); }

html[data-theme="dark"] .prod-card-current,
html[data-theme="dark"] .prod-card-price,
html[data-theme="dark"] .hp-price { color: var(--desert-gold); }

html[data-theme="dark"] .prod-card-old,
html[data-theme="dark"] .hp-price-old,
html[data-theme="dark"] .prod-card-vendor,
html[data-theme="dark"] .hp-vendor { color: #9a958a; }

/* Section titles & home sections */
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .home-section h2,
html[data-theme="dark"] .home-section h3 { color: #e8e4dc; }

html[data-theme="dark"] .home-section { background: transparent; }

html[data-theme="dark"] .hp-skeleton-card { background: #2d2a26; border-color: var(--desert-border); }

/* Skeleton loader */
html[data-theme="dark"] .skel-pulse {
    background: linear-gradient(90deg, #2d2a26 25%, #3d3832 50%, #2d2a26 75%);
}

/* Coupon badge */
html[data-theme="dark"] .cp-badge {
    background: #35322c;
    border-color: var(--desert-border);
    color: #e8e4dc;
}

html[data-theme="dark"] .cp-badge:hover { background: #3d3832; }
html[data-theme="dark"] .cp-badge i { color: var(--desert-gold); }

/* Nav links (main navbar) */
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .navbar-nav .nav-link { color: #e8e4dc; }
html[data-theme="dark"] .nav-link:hover { color: var(--desert-gold); }

/* Dropdown menu */
html[data-theme="dark"] .dropdown-menu {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .dropdown-item {
    color: #e8e4dc;
}

html[data-theme="dark"] .dropdown-item:hover {
    background: #35322c;
    color: var(--desert-gold);
}

html[data-theme="dark"] .dropdown-divider { border-color: var(--desert-border); }
html[data-theme="dark"] .dropdown-section { color: #9a958a; }

/* Cart Drawer */
html[data-theme="dark"] #cartDrawer {
    background: #22201c;
}

html[data-theme="dark"] .cd-head,
html[data-theme="dark"] .cd-body,
html[data-theme="dark"] .cd-foot {
    border-color: var(--desert-border);
}

html[data-theme="dark"] .cd-title { color: #e8e4dc; }
html[data-theme="dark"] .cd-empty-ttl,
html[data-theme="dark"] .cd-empty-sub,
html[data-theme="dark"] .cd-ship,
html[data-theme="dark"] .cd-sub-lbl,
html[data-theme="dark"] .cd-sub-cur { color: #9a958a; }

html[data-theme="dark"] .cd-foot { background: #2d2a26; }
html[data-theme="dark"] .cd-sub-val,
html[data-theme="dark"] .ci-name { color: #e8e4dc; }

html[data-theme="dark"] .ci-vendor,
html[data-theme="dark"] .cd-coupon-input {
    color: #9a958a;
    background: #35322c;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .qty-ctrl { border-color: var(--desert-border); }
html[data-theme="dark"] .qty-btn {
    background: #35322c;
    color: #e8e4dc;
}

html[data-theme="dark"] .qty-btn:hover { background: #3d3832; }
html[data-theme="dark"] .qty-val { color: #e8e4dc; }
html[data-theme="dark"] .ci-remove { color: #6a6458; }
html[data-theme="dark"] .ci-remove:hover { color: #e53935; }

html[data-theme="dark"] .cd-body::-webkit-scrollbar-thumb { background: #4a4540; }

/* Category drawer (mobile) */
html[data-theme="dark"] .cat-drawer {
    background: #22201c;
}

html[data-theme="dark"] .cat-drawer-title { color: #e8e4dc; }
html[data-theme="dark"] .cat-drawer-list a { color: #e8e4dc; }
html[data-theme="dark"] .cat-drawer-list a:hover { color: var(--desert-gold); }

/* Hero sections */
html[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #1a1510 0%, #252019 50%, #2d261e 100%);
}

html[data-theme="dark"] .hero-sub,
html[data-theme="dark"] .hero-stat-lbl { color: #b0a898; }

html[data-theme="dark"] .hero-stat-val { color: #e8e4dc; }

html[data-theme="dark"] .hero-badge-float {
    background: #2d2a26;
    border-color: var(--desert-border);
    color: #e8e4dc;
}

html[data-theme="dark"] .prods-hero,
html[data-theme="dark"] .sp-hero,
html[data-theme="dark"] .vendors-hero {
    background: #22201c;
}

html[data-theme="dark"] .prods-hero-title,
html[data-theme="dark"] .sp-hero-title,
html[data-theme="dark"] .vendors-hero-title { color: #e8e4dc; }

html[data-theme="dark"] .prods-hero-sub,
html[data-theme="dark"] .sp-hero-sub,
html[data-theme="dark"] .vendors-hero-sub,
html[data-theme="dark"] .vendors-hero-eyebrow { color: #9a958a; }

/* Forms & inputs */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background: #2d2a26;
    border-color: var(--desert-border);
    color: #e8e4dc;
}

html[data-theme="dark"] .form-control::placeholder { color: #8a8378; }
html[data-theme="dark"] .form-control:focus {
    background: #35322c;
    border-color: var(--desert-gold);
}

html[data-theme="dark"] .footer-newsletter-input {
    background: #2d2a26;
    border-color: var(--desert-border);
    color: #e8e4dc;
}

/* Footer */
html[data-theme="dark"] .footer-main {
    background: #151412;
    color: #d4cfc4;
}

html[data-theme="dark"] .footer-brand,
html[data-theme="dark"] .footer-heading,
html[data-theme="dark"] .footer-link { color: #e8e4dc; }

html[data-theme="dark"] .footer-link:hover { color: var(--desert-gold); }
html[data-theme="dark"] .footer-about,
html[data-theme="dark"] .footer-tagline,
html[data-theme="dark"] .footer-newsletter-sub { color: #9a958a; }

html[data-theme="dark"] .footer-bottom { border-color: var(--desert-border); }
html[data-theme="dark"] .footer-bottom-link,
html[data-theme="dark"] .footer-copyright { color: #9a958a; }

html[data-theme="dark"] .footer-contact-link { color: #b0a898; }
html[data-theme="dark"] .footer-contact-link:hover { color: var(--desert-gold); }

html[data-theme="dark"] .footer-payment-badge {
    background: #2d2a26;
    border-color: var(--desert-border);
    color: #e8e4dc;
}

/* Promo ticker */
html[data-theme="dark"] .promo-ticker {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .promo-ticker .pt-item { color: #e8e4dc; }
html[data-theme="dark"] .promo-ticker .pt-code { color: var(--desert-gold); }

/* Quick View / Modals */
html[data-theme="dark"] .qv-modal,
html[data-theme="dark"] .qv-overlay + .qv-modal {
    background: #2d2a26;
}

html[data-theme="dark"] .qv-name,
html[data-theme="dark"] .qv-desc { color: #e8e4dc; }
html[data-theme="dark"] .qv-close { background: #35322c; color: #e8e4dc; }

/* Global Image Search modal */
html[data-theme="dark"] .g-img-modal {
    background: #2d2a26;
}

html[data-theme="dark"] .g-img-dropzone {
    border-color: var(--desert-border);
    background: #22201c;
}

html[data-theme="dark"] .g-img-result-card {
    background: #35322c;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .g-img-result-name,
html[data-theme="dark"] .g-img-result-body { color: #e8e4dc; }

html[data-theme="dark"] .g-img-result-current { color: var(--desert-gold); }

html[data-theme="dark"] .g-img-result-old { color: #9a958a; }

/* Mobile bottom nav */
html[data-theme="dark"] .mobile-bottom-nav {
    background: #22201c;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .mob-nav-item { color: #9a958a; }
html[data-theme="dark"] .mob-nav-item:hover,
html[data-theme="dark"] .mob-nav-item.active { color: var(--desert-gold); }

/* Cart page */
html[data-theme="dark"] .cart-page,
html[data-theme="dark"] .cart-item-card,
html[data-theme="dark"] .cart-title { color: #e8e4dc; }

html[data-theme="dark"] .cart-item-card {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .cart-breadcrumb,
html[data-theme="dark"] .cart-breadcrumb a { color: #9a958a; }

/* Breadcrumbs & filters */
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .breadcrumb-item { color: #9a958a; }

html[data-theme="dark"] .breadcrumb-item.active { color: #e8e4dc; }

html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .filter-section {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .filter-section-title { color: #e8e4dc; }

/* Cards & containers */
html[data-theme="dark"] .card {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .card-title,
html[data-theme="dark"] .card-body { color: #e8e4dc; }

html[data-theme="dark"] .text-muted { color: #9a958a !important; }

/* Table */
html[data-theme="dark"] .table {
    color: #e8e4dc;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    background: rgba(45,42,38,.5);
}

html[data-theme="dark"] .table thead th {
    border-color: var(--desert-border);
    color: #e8e4dc;
}

/* User avatar, nav icons */
html[data-theme="dark"] .nav-icons .text-dark,
html[data-theme="dark"] .cart-icon.text-dark,
html[data-theme="dark"] .wish-icon,
html[data-theme="dark"] .compare-icon { color: #e8e4dc !important; }

html[data-theme="dark"] .nav-icons a:hover,
html[data-theme="dark"] .cart-icon:hover,
html[data-theme="dark"] .wish-icon:hover { color: var(--desert-gold) !important; }

/* Toast — keep dark bg, ensure contrast */
html[data-theme="dark"] .cart-toast { background: #2d2a26; border: 1px solid var(--desert-border); }

/* Back to top */
html[data-theme="dark"] .back-to-top {
    background: #35322c;
    color: #e8e4dc;
}

html[data-theme="dark"] .back-to-top:hover {
    background: var(--desert-gold);
    color: #1a1a1c;
}

/* Support widget */
html[data-theme="dark"] .support-widget-panel {
    background: #2d2a26;
    border-color: var(--desert-border);
}

html[data-theme="dark"] .support-panel-desc { color: #9a958a; }
html[data-theme="dark"] .support-option { color: #e8e4dc; }
html[data-theme="dark"] .support-option:hover { background: #35322c; }

/* Dark mode toggle button — inverse in light mode icon */
.theme-toggle {
    background: none;
    border: none;
    padding: 4px 8px;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.theme-toggle:hover {
    opacity: 1;
}
