:root {
    --primary: #FFE92B; /* Rich, premium yellow */
    --primary-hover: #F2CC00;
    --dark: #121212; /* Deep, sleek black */
    --dark-light: #2A2A2A;
    --light: #FFFFFF;
    --gray-bg: #F8F9FA; /* Very soft background */
    --gray-border: #EEEEEE;
    --text-muted: #777777;
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Tajawal', sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-hover: 0 16px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --theme-duration: 420ms;
    --theme-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary: #FFE92B;
    --primary-hover: #FFE680;
    --dark: #F8FAFC;
    --dark-light: #D6D6D6;
    --light: #141414;
    --gray-bg: #080808;
    --gray-border: #2A2A2A;
    --text-muted: #A3A3A3;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
    --shadow-md: 0 10px 28px rgba(0,0,0,0.42);
    --shadow-hover: 0 18px 44px rgba(0,0,0,0.5);
}

html[dir="rtl"] { font-family: var(--font-ar); }
html[dir="ltr"] { font-family: var(--font-en); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html.theme-ready.theme-switching,
html.theme-ready.theme-switching body,
html.theme-ready.theme-switching :is(.topbar, .main-nav, .nav-cats-bar, .main-content, .site-footer, .home-section, .home-section-alt, .stores-strip, .auth-card, .dropdown-menu, .admin-sidebar, .admin-content, .search-bar input, .nav-icon-btn, .cart-btn, .btn-primary, .btn-search, .btn-add-cart, input, select, textarea, .form-control) {
    transition-property: background-color, background, color, border-color, box-shadow, opacity, filter;
    transition-duration: 300ms;
    transition-timing-function: var(--theme-ease);
}

html.theme-ready.theme-switching :is(.topbar, .main-nav, .nav-cats-bar, .site-footer, .admin-content, .admin-sidebar) :is(h1, h2, h3, h4, h5, h6, p, span, label, strong, a, button, svg, i) {
    transition-property: color, background-color, border-color, opacity, filter, transform;
    transition-duration: 300ms;
    transition-timing-function: var(--theme-ease);
}

@media (prefers-reduced-motion: reduce) {
    html.theme-ready,
    html.theme-ready *,
    ::view-transition-old(root),
    ::view-transition-new(root) {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

body {
    background-color: var(--gray-bg);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Elegant Topbar */
.topbar {
    background-color: var(--dark);
    color: #DDDDDD;
    font-size: 13px;
    padding: 10px 0;
    font-weight: 500;
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; }
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.topbar-sep { width: 1px; height: 14px; background: rgba(255,255,255,0.2); }
.clean-select {
    background: transparent; border: none; color: #FFF; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; outline: none;
}
.clean-select option { color: var(--dark); }
.lang-switcher a { opacity: 0.6; }
.lang-switcher a.active, .lang-switcher a:hover { opacity: 1; color: var(--primary); }
.lang-switcher .divider { margin: 0 8px; opacity: 0.3; }

/* Premium Navbar (Glassmorphism) */
.main-nav {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 20px 0 0 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

html[data-theme="dark"] .main-nav {
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Header content is intentionally narrower than the full-width bar. */
.nav-container {
    width: min(1320px, calc(100% - 56px));
    margin: 0 auto;
    padding: 0 10px;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    padding-bottom: 18px;
}

.brand-logo {
    font-family: var(--font-en);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--dark);
    white-space: nowrap;
    position: relative;
}

.brand-logo img {
    transition: transform 0.3s ease;
}

.brand-logo:hover img {
    transform: scale(1.05);
}

.site-logo-dark {
    display: block;
    opacity: 0;
    transform: scale(0.96);
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    translate: 0 -50%;
    pointer-events: none;
    transition: opacity 280ms var(--theme-ease), transform 420ms var(--theme-ease), filter 420ms var(--theme-ease);
}

.site-logo-light {
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: opacity 280ms var(--theme-ease), transform 420ms var(--theme-ease), filter 420ms var(--theme-ease);
}

html[data-theme="dark"] .site-logo-dark {
    opacity: 1;
    transform: scale(1);
    position: static;
    translate: none;
    pointer-events: auto;
}

html[data-theme="dark"] .site-logo-light {
    opacity: 0;
    transform: scale(0.96);
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    translate: 0 -50%;
    pointer-events: none;
}

/* Sleek Search Bar */
.search-bar {
    flex: 1;
    display: flex;
    max-width: 560px;
    min-width: 280px;
    position: relative;
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.search-bar input {
    width: 100%;
    padding: 14px 24px 14px 54px;
    border: 1.5px solid var(--gray-border);
    border-radius: 50px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    background: rgba(241, 245, 249, 0.6);
    transition: all 0.3s ease;
}

html[dir="rtl"] .search-bar input {
    padding: 14px 54px 14px 24px;
}

html[data-theme="dark"] .search-bar input {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    color: #F8FAFC;
}

.search-bar input:focus {
    background: var(--light);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 233, 43, 0.25);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #64748B;
    pointer-events: none;
    transition: all 0.3s ease;
}

html[dir="rtl"] .search-icon {
    left: auto;
    right: 20px;
}

.btn-search {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    background-color: var(--primary);
    color: var(--dark);
    border: none;
    padding: 0 24px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 233, 43, 0.2);
}

html[dir="rtl"] .btn-search {
    right: auto;
    left: 6px;
}

.btn-search:hover {
    background-color: var(--dark);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .btn-search:hover {
    background-color: #FDE68A;
    color: var(--dark);
}

/* Nav actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

html[data-theme="dark"] .nav-icon-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94A3B8;
}

.nav-icon-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 233, 43, 0.3);
}

html[data-theme="dark"] .nav-icon-btn:hover {
    color: var(--dark);
}

.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle svg,
.theme-toggle i {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 20px;
    height: 20px;
    transition: opacity 260ms var(--theme-ease), transform 420ms var(--theme-ease), color 420ms var(--theme-ease);
}

.theme-toggle .theme-icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.theme-toggle .theme-icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.65);
}

html[data-theme="dark"] .theme-toggle .theme-icon-moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.65);
}

html[data-theme="dark"] .theme-toggle .theme-icon-sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--dark);
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(255, 233, 43, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 233, 43, 0.5);
    background-color: var(--primary-hover);
}

/* User dropdown styling */
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid var(--gray-border);
    padding: 6px 16px 6px 8px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
}

html[dir="rtl"] .nav-user {
    padding: 6px 8px 6px 16px;
}

html[data-theme="dark"] .nav-user {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-user:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 233, 43, 0.2);
}

.nav-user:hover span {
    color: var(--dark) !important;
}

.nav-user:hover i {
    color: var(--dark) !important;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dark);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
}

.user-avatar.admin-avatar {
    background: #F59E0B;
    color: var(--dark);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--light);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: none;
    flex-direction: column;
    min-width: 200px;
    z-index: 1200;
    margin-top: 12px;
}

html[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 0;
}

/* Cart Button */
.cart-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

html[data-theme="dark"] .cart-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94A3B8;
}

.cart-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 233, 43, 0.3);
}

.cart-btn[data-count]::after {
    content: attr(data-count);
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--dark);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

html[dir="rtl"] .cart-btn[data-count]::after {
    right: auto;
    left: -2px;
}

html[data-theme="dark"] .cart-btn[data-count]::after {
    background: var(--primary);
    color: #111111 !important;
    border-color: #0c0c0c;
}

/* Category Nav Links Bar */
.nav-cats-bar {
    border-top: 1px solid var(--gray-border);
    background-color: rgba(255, 255, 255, 0.5);
    padding: 12px 0;
    margin-top: 10px;
}

html[data-theme="dark"] .nav-cats-bar {
    background-color: rgba(10, 10, 10, 0.5);
    border-top-color: rgba(255, 255, 255, 0.08);
}

.nav-cats-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.nav-cats-inner

.nav-item-dropdown {
    flex-shrink: 0;
}

.nav-cat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    border-radius: 50px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    white-space: nowrap;
}

html[data-theme="dark"] .nav-cat {
    color: #94A3B8;
}

.nav-cat:hover {
    color: var(--dark);
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 233, 43, 0.25);
}

html[data-theme="dark"] .nav-cat:hover {
    color: var(--dark);
    background: var(--primary);
}

.nav-cat.active {
    background: var(--primary);
    color: var(--dark);
    box-shadow: 0 4px 12px rgba(255, 233, 43, 0.25);
}

.nav-cat svg {
    width: 16px;
    height: 16px;
}

/* Mobile responsive styles for the redesigned navigation bar */
@media (max-width: 1024px) {
    .nav-container {
        width: calc(100% - 36px);
        padding: 0;
    }

    .nav-inner {
        gap: 18px;
    }

    .search-bar {
        max-width: 500px;
    }

    .nav-actions {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        width: calc(100% - 28px);
        padding: 0;
    }
    .nav-inner {
        flex-wrap: wrap;
        gap: 16px;
        padding-bottom: 12px;
    }
    .brand-logo {
        order: 1;
        font-size: 24px;
    }
    .nav-actions {
        order: 2;
        gap: 12px;
    }
    .search-bar {
        order: 3;
        flex: 1 0 100%;
        max-width: 100%;
        margin-top: 4px;
    }
    .nav-icon-btn, .cart-btn {
        width: 42px;
        height: 42px;
    }
}

/* ===== BANNER CAROUSEL ===== */
.banner-section-full {
    width: min(1480px, calc(100% - 28px));
    margin: 14px auto 48px;
    overflow: visible;
}

.banner-carousel {
    position: relative;
    width: 100%;
    height: clamp(340px, 32vw, 500px);
    overflow: hidden;
    background: #f1f5f9;
    border-radius: 44px;
}

@media (max-width: 768px) {
    .banner-carousel {
        height: clamp(220px, 56vw, 320px);
        border-radius: 32px;
    }
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.banner-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f1f5f9;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 8s ease;
    border-radius: inherit;
}

.banner-carousel:hover .banner-img {
    transform: scale(1.03);
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(17, 17, 17, 0.4);
    backdrop-filter: blur(4px);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carousel-control:hover {
    background: rgba(17, 17, 17, 0.8);
    color: var(--primary);
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

/* Flip arrow controls based on RTL */
html[dir="rtl"] .carousel-control.prev {
    left: auto;
    right: 20px;
}

html[dir="rtl"] .carousel-control.next {
    right: auto;
    left: 20px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

.banner-placeholder-full {
    height: 400px;
    background: linear-gradient(135deg, #121212 0%, #2A2A2A 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light);
}

.banner-placeholder-full .banner-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.banner-placeholder-full h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.banner-placeholder-full p {
    color: #A0AEC0;
    margin: 0 0 24px 0;
    font-size: 16px;
}

.banner-cta {
    background: var(--primary);
    color: var(--dark);
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    transition: var(--transition);
}

.banner-cta:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ===== HOME SECTIONS ===== */
.home-section {
    padding: 60px 0;
    background: var(--light);
}

.home-section-alt {
    background: var(--gray-bg);
}

.home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.home-section-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    width: fit-content;
}

.tag-red {
    background: #FEE2E2;
    color: #DC2626;
}

.tag-orange {
    background: #FFEDD5;
    color: #EA580C;
}

.tag-blue {
    background: #E0F2FE;
    color: #0284C7;
}

.tag-gray {
    background: #E2E8F0;
    color: #475569;
}

.home-section-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
    line-height: 1.2;
}

.see-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.see-all-btn:hover {
    color: var(--primary-hover);
}

/* ===== STORES STRIP ===== */
.stores-strip {
    background: var(--light);
    border-top: 1px solid var(--gray-border);
    padding: 50px 0;
}

.stores-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
}

.stores-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.stores-row

.store-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-bg);
    border: 1px solid var(--gray-border);
    border-radius: 50px;
    padding: 10px 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    font-weight: 600;
    font-size: 14px;
}

.store-pill:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.store-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
}

/* ===== PRODUCTS GRID ===== */
.products-grid-5 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .products-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: var(--light);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    text-decoration: none;
    height: 100%;
}

.product-card:hover {
    border-color: #CBD5E1;
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.discount-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: #EF4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

html[dir="rtl"] .discount-tag {
    right: auto;
    left: 12px;
}

.product-img {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--gray-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    padding: 16px;
}

.product-card:hover .product-img img {
    transform: scale(1.06);
}

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.product-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.price-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-price {
    font-size: 18px;
    font-weight: 900;
    color: var(--dark);
    line-height: 1.2;
}

.product-price .currency {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-inline-start: 2px;
}

.old-price {
    font-size: 13px;
    color: #EF4444;
    text-decoration: line-through;
    line-height: 1;
    font-weight: 600;
}

.btn-add-cart {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--dark);
    color: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-cart:hover {
    background-color: var(--primary);
    color: var(--dark);
    transform: scale(1.1);
}

/* ===== USER NAV DROPDOWN SPECIFIC OVERRIDES ===== */
.nav-user-dropdown .dropdown-menu {
    left: auto;
    right: 0;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

/* ===== AUTH PAGES ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    min-height: calc(100vh - 200px);
}

.auth-card {
    background: var(--light);
    width: 100%;
    max-width: 460px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-border);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--dark);
}

.invalid-feedback {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 600;
}

.is-invalid {
    border-color: #EF4444 !important;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-actions label {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 24px;
}

.auth-footer a {
    color: var(--dark);
    font-weight: 700;
    text-decoration: underline;
}

.auth-footer a:hover {
    color: var(--primary-hover);
}

/* ===== FLASH MESSAGES ===== */
.flash-msg {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.flash-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* ===== SITE FOOTER ===== */
.site-footer {
    background: #000000;
    color: #DDDDDD;
    margin-top: 60px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 60px 0 40px;
}

@media (max-width: 992px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 576px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.footer-brand p {
    font-size: 14px;
    color: #999999;
    line-height: 1.8;
    max-width: 260px;
    margin-top: 15px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.social-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CCCCCC;
    transition: var(--transition);
}

.social-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--dark);
    transform: translateY(-3px);
}

.footer-links h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 20px;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #999999;
    margin-bottom: 12px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    padding-inline-start: 6px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 0;
}

.footer-bottom p {
    font-size: 13px;
    color: #777777;
}

/* ===== MISC ===== */
.text-danger {
    color: #EF4444;
}

.main-content {
    min-height: 60vh;
}

.d-none {
    display: none;
}

/* ===== DARK THEME POLISH ===== */
html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top right, rgba(255, 216, 77, 0.05), transparent 30%),
        var(--gray-bg);
    color: var(--dark);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .site-footer {
    background: #030712;
}

html[data-theme="dark"] .main-nav {
    background-color: rgba(12, 12, 12, 0.94);
    border-bottom-color: var(--gray-border);
}

html[data-theme="dark"] .banner-carousel,
html[data-theme="dark"] .banner-link,
html[data-theme="dark"] .banner-img {
    background: #101010;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control {
    background: #101010;
    color: #F8FAFC;
    border-color: var(--gray-border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #8A8A8A;
}

html[data-theme="dark"] option {
    background: #101010;
    color: #F8FAFC;
}

html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
    border-color: var(--gray-border) !important;
}

html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#FFF"],
html[data-theme="dark"] [style*="background: #FFF"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:#FFFFFF"],
html[data-theme="dark"] [style*="background: #FFFFFF"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:#ffffff"],
html[data-theme="dark"] [style*="background-color: #ffffff"],
html[data-theme="dark"] [style*="background-color:white"],
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [style*="background:#F8FAFC"],
html[data-theme="dark"] [style*="background: #F8FAFC"],
html[data-theme="dark"] [style*="background-color:#F8FAFC"],
html[data-theme="dark"] [style*="background-color: #F8FAFC"],
html[data-theme="dark"] [style*="background: var(--light)"] {
    background: var(--light) !important;
    background-color: var(--light) !important;
}

html[data-theme="dark"] [style*="background:#F1F5F9"],
html[data-theme="dark"] [style*="background: #F1F5F9"],
html[data-theme="dark"] [style*="background:#F8F9FA"],
html[data-theme="dark"] [style*="background: #F8F9FA"],
html[data-theme="dark"] [style*="background:#E2E8F0"],
html[data-theme="dark"] [style*="background: #E2E8F0"],
html[data-theme="dark"] [style*="background:#EFF6FF"],
html[data-theme="dark"] [style*="background: #EFF6FF"],
html[data-theme="dark"] [style*="background:#FAF5FF"],
html[data-theme="dark"] [style*="background: #FAF5FF"],
html[data-theme="dark"] [style*="background:#FFFDF5"],
html[data-theme="dark"] [style*="background: #FFFDF5"],
html[data-theme="dark"] [style*="background:#FFFBEB"],
html[data-theme="dark"] [style*="background: #FFFBEB"],
html[data-theme="dark"] [style*="background:#FEF2F2"],
html[data-theme="dark"] [style*="background: #FEF2F2"],
html[data-theme="dark"] [style*="background:#ECFDF5"],
html[data-theme="dark"] [style*="background: #ECFDF5"],
html[data-theme="dark"] [style*="background:#FFF1F2"],
html[data-theme="dark"] [style*="background: #FFF1F2"],
html[data-theme="dark"] [style*="background-color:#F1F5F9"],
html[data-theme="dark"] [style*="background-color: #F1F5F9"],
html[data-theme="dark"] [style*="background-color:#F8F9FA"],
html[data-theme="dark"] [style*="background-color: #F8F9FA"],
html[data-theme="dark"] [style*="background: var(--gray-bg)"] {
    background: #101010 !important;
    background-color: #101010 !important;
}

html[data-theme="dark"] [style*="color:#0F172A"],
html[data-theme="dark"] [style*="color: #0F172A"],
html[data-theme="dark"] [style*="color:#1E293B"],
html[data-theme="dark"] [style*="color: #1E293B"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color:var(--dark)"],
html[data-theme="dark"] [style*="color: var(--dark)"] {
    color: #F8FAFC !important;
}

html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color:#64748B"],
html[data-theme="dark"] [style*="color: #64748B"],
html[data-theme="dark"] [style*="color:var(--text-muted)"],
html[data-theme="dark"] [style*="color: var(--text-muted)"] {
    color: #A3A3A3 !important;
}

html[data-theme="dark"] [style*="border:1px solid #E2E8F0"],
html[data-theme="dark"] [style*="border: 1px solid #E2E8F0"],
html[data-theme="dark"] [style*="border:1px dashed #CBD5E1"],
html[data-theme="dark"] [style*="border: 1px dashed #CBD5E1"],
html[data-theme="dark"] [style*="border:1px solid #CBD5E1"],
html[data-theme="dark"] [style*="border: 1px solid #CBD5E1"],
html[data-theme="dark"] [style*="border-color:#E2E8F0"],
html[data-theme="dark"] [style*="border-color: #E2E8F0"] {
    border-color: var(--gray-border) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .table,
html[data-theme="dark"] .banner-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .role-card,
html[data-theme="dark"] .staff-panel,
html[data-theme="dark"] .ops-card,
html[data-theme="dark"] .ops-panel {
    background: var(--light) !important;
    border-color: var(--gray-border) !important;
}

html[data-theme="dark"] .product-card:hover {
    border-color: rgba(255, 216, 77, 0.35);
}

html[data-theme="dark"] .dropdown-menu a:hover,
html[data-theme="dark"] .nav-user:hover {
    background: #101010 !important;
}

html[data-theme="dark"] .btn-primary {
    box-shadow: 0 8px 20px rgba(255, 216, 77, 0.18);
}

/* ===== ADMIN DARK THEME ===== */
html[data-theme="dark"] .admin-layout,
html[data-theme="dark"] .admin-content,
html[data-theme="dark"] .admin-sidebar {
    color: #F8FAFC;
}

html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .admin-content {
    background: #141414 !important;
    border-color: #2A2A2A !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .admin-header,
html[data-theme="dark"] .admin-content table,
html[data-theme="dark"] .admin-content tr,
html[data-theme="dark"] .admin-content th,
html[data-theme="dark"] .admin-content td {
    border-color: #2A2A2A !important;
}

html[data-theme="dark"] .admin-header h1,
html[data-theme="dark"] .admin-content h1,
html[data-theme="dark"] .admin-content h2,
html[data-theme="dark"] .admin-content h3,
html[data-theme="dark"] .admin-content h4,
html[data-theme="dark"] .admin-content label,
html[data-theme="dark"] .admin-content strong {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .admin-content p,
html[data-theme="dark"] .admin-content small,
html[data-theme="dark"] .admin-content th,
html[data-theme="dark"] .admin-content td {
    color: #D6D6D6;
}

html[data-theme="dark"] .admin-menu li a {
    color: #D6D6D6 !important;
}

html[data-theme="dark"] .admin-menu li a:hover,
html[data-theme="dark"] .admin-menu li a.active {
    background: #101010 !important;
    color: var(--primary) !important;
}

html[data-theme="dark"] .admin-content .upload-section,
html[data-theme="dark"] .admin-content .card,
html[data-theme="dark"] .admin-content .banner-card,
html[data-theme="dark"] .admin-content .banners-gallery > div,
html[data-theme="dark"] .admin-content .form-card,
html[data-theme="dark"] .admin-content .role-card,
html[data-theme="dark"] .admin-content .staff-panel,
html[data-theme="dark"] .admin-content .ops-card,
html[data-theme="dark"] .admin-content .ops-panel,
html[data-theme="dark"] .admin-content [class*="panel"],
html[data-theme="dark"] .admin-content [class*="card"] {
    background: #141414 !important;
    border-color: #2A2A2A !important;
}

html[data-theme="dark"] .admin-content thead tr,
html[data-theme="dark"] .admin-content tbody tr,
html[data-theme="dark"] .admin-content [style*="background: #fff"],
html[data-theme="dark"] .admin-content [style*="background:#fff"],
html[data-theme="dark"] .admin-content [style*="background: white"],
html[data-theme="dark"] .admin-content [style*="background:white"],
html[data-theme="dark"] .admin-content [style*="background: #ffffff"],
html[data-theme="dark"] .admin-content [style*="background:#ffffff"],
html[data-theme="dark"] .admin-content [style*="background: #F8FAFC"],
html[data-theme="dark"] .admin-content [style*="background:#F8FAFC"],
html[data-theme="dark"] .admin-content [style*="background: #F1F5F9"],
html[data-theme="dark"] .admin-content [style*="background:#F1F5F9"],
html[data-theme="dark"] .admin-content [style*="background: #E2E8F0"],
html[data-theme="dark"] .admin-content [style*="background:#E2E8F0"] {
    background: #101010 !important;
}

html[data-theme="dark"] .admin-content input,
html[data-theme="dark"] .admin-content select,
html[data-theme="dark"] .admin-content textarea,
html[data-theme="dark"] .admin-content .form-control {
    background: #0B0B0B !important;
    color: #F8FAFC !important;
    border-color: #333333 !important;
}

html[data-theme="dark"] .admin-content input[type="file"] {
    background: #101010 !important;
}

html[data-theme="dark"] .admin-content a:not(.btn-primary) {
    color: #F6C94C;
}

html[data-theme="dark"] .admin-content [style*="color: #0F172A"],
html[data-theme="dark"] .admin-content [style*="color:#0F172A"],
html[data-theme="dark"] .admin-content [style*="color: #1E293B"],
html[data-theme="dark"] .admin-content [style*="color:#1E293B"],
html[data-theme="dark"] .admin-content [style*="color: #334155"],
html[data-theme="dark"] .admin-content [style*="color:#334155"],
html[data-theme="dark"] .admin-content [style*="color: #475569"],
html[data-theme="dark"] .admin-content [style*="color:#475569"] {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .admin-content [style*="color: #64748B"],
html[data-theme="dark"] .admin-content [style*="color:#64748B"],
html[data-theme="dark"] .admin-content [style*="color: #94A3B8"],
html[data-theme="dark"] .admin-content [style*="color:#94A3B8"] {
    color: #A3A3A3 !important;
}

/* Lucide Icon override */
svg[data-lucide] {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Laravel Pagination SVG Arrow fixes */
nav[role="navigation"] svg {
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* ===== FINAL DARK MODE SWEEP ===== */
html[data-theme="dark"] :is(body, .main-content, .admin-content, .admin-layout) {
    background-color: #080808 !important;
}

html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#fff" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#ffffff" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="white" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#f8fafc" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#f1f5f9" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#f8f9fa" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#e2e8f0" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#cbd5e1" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#eff6ff" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#ecfdf5" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#fef2f2" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#fff1f2" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#fffdf5" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#fffbeb" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#faf5ff" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#e0f2fe" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#e0e7ff" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#fef08a" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#d1fae5" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#dbeafe" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#fee2e2" i],
html[data-theme="dark"] :is(div, section, article, aside, main, form, table, thead, tbody, tr, td, th, ul, li, nav, header, label, input, select, textarea, a, button)[style*="#ffedd5" i] {
    background: #101010 !important;
    background-color: #101010 !important;
    border-color: #2A2A2A !important;
}

html[data-theme="dark"] :is(input, select, textarea, .form-control) {
    background-color: #0B0B0B !important;
    color: #F8FAFC !important;
    border-color: #333333 !important;
}

html[data-theme="dark"] :is(.product-card, .auth-card, .dropdown-menu, .admin-sidebar, .admin-content, .card, .banner-card, .form-card, .role-card, .staff-panel, .ops-card, .ops-panel) {
    background: #141414 !important;
    border-color: #2A2A2A !important;
}

html[data-theme="dark"] :is(table, thead, tbody, tr, td, th) {
    background-color: transparent !important;
}

html[data-theme="dark"] :is(th, td, h1, h2, h3, h4, h5, h6, p, label, span, strong, a)[style*="#0f172a" i],
html[data-theme="dark"] :is(th, td, h1, h2, h3, h4, h5, h6, p, label, span, strong, a)[style*="#1e293b" i],
html[data-theme="dark"] :is(th, td, h1, h2, h3, h4, h5, h6, p, label, span, strong, a)[style*="#334155" i],
html[data-theme="dark"] :is(th, td, h1, h2, h3, h4, h5, h6, p, label, span, strong, a)[style*="#475569" i],
html[data-theme="dark"] :is(th, td, h1, h2, h3, h4, h5, h6, p, label, span, strong, a)[style*="#64748b" i] {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] button[type="submit"],
html[data-theme="dark"] .btn-add-cart {
    border-color: transparent !important;
}

html[data-theme="dark"] body :is(.container, .nav-inner, .topbar-inner, .nav-actions, .products-grid-5, .product-info, .product-bottom-row, .price-col, .pdp-grid, .pdp-info, .pdp-actions, .pdp-cats, .pdp-profit-rows, .pdp-profit-row, .admin-layout, .admin-menu, .footer-links, .footer-brand, .footer-social) {
    background: transparent !important;
}

html[data-theme="dark"] body :is(.pdp-main-img, .pdp-thumb, .pdp-store-link, .pdp-profit-panel, .pdp-desc-section, .pdp-desc-header, .pdp-desc-body, .pdp-cat-tag, .pdp-stock-badge, .pdp-img-no-img, .auth-card, .product-card, .admin-sidebar, .admin-content, .dropdown-menu) {
    background: #141414 !important;
    border-color: #2A2A2A !important;
}

html[data-theme="dark"] body :is(.pdp-divider, .pdp-profit-sep, .pdp-profit-bar-track, .status-track, .timeline-line) {
    background: #2A2A2A !important;
}

/* ===== DARK THEME COLOR REFINEMENT ===== */
html[data-theme="dark"] {
    --surface-0: #080808;
    --surface-1: #101010;
    --surface-2: #171717;
    --surface-3: #202020;
    --border-soft: #2E2E2E;
    --text-main: #F5F5F5;
    --text-soft: #B8B8B8;
    --text-muted-dark: #8A8A8A;
    --gold-soft: #F6C94C;
    --gold-dim: rgba(246, 201, 76, 0.14);
    --green-soft: #34D399;
    --green-dim: rgba(52, 211, 153, 0.13);
    --red-soft: #F87171;
    --red-dim: rgba(248, 113, 113, 0.13);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top, rgba(246, 201, 76, 0.045), transparent 28%),
        var(--surface-0) !important;
}

html[data-theme="dark"] :is(.main-nav, .topbar) {
    background: #050505 !important;
}

html[data-theme="dark"] :is(.product-card, .auth-card, .dropdown-menu, .admin-content, .admin-sidebar, .card, .banner-card, .form-card, .role-card, .staff-panel, .ops-card, .ops-panel, .pdp-main-img, .pdp-desc-section, .pdp-profit-panel, .pdp-store-link) {
    background: var(--surface-2) !important;
    border-color: var(--border-soft) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] :is(.product-img, .pdp-thumb, .pdp-cat-tag, .pdp-img-no-img, .pdp-desc-header, .pdp-profit-bar-track, .search-bar input, .nav-icon-btn, .cart-btn) {
    background: var(--surface-1) !important;
    border-color: var(--border-soft) !important;
}

html[data-theme="dark"] :is(input, select, textarea, .form-control) {
    background: #0C0C0C !important;
    color: var(--text-main) !important;
    border-color: #343434 !important;
}

html[data-theme="dark"] :is(input, select, textarea, .form-control):focus {
    border-color: rgba(246, 201, 76, 0.75) !important;
    box-shadow: 0 0 0 4px rgba(246, 201, 76, 0.10) !important;
}

html[data-theme="dark"] :is(h1, h2, h3, h4, h5, h6, .product-title, .product-price, .pdp-name, .pdp-desc-header h2, .admin-header h1, .ops-title, .ops-value, .role-count, .role-title) {
    color: var(--text-main) !important;
}

html[data-theme="dark"] :is(p, label, td, th, .ops-muted, .bar-label, .status-name, .role-desc, .staff-sub, .footer-brand p, .footer-links a, .product-price .currency) {
    color: var(--text-soft) !important;
}

html[data-theme="dark"] :is(.nav-cat, .nav-user span, .dropdown-menu a, .admin-menu li a) {
    color: #D8D8D8 !important;
}

html[data-theme="dark"] :is(.nav-cat:hover, .nav-cat.active, .admin-menu li a:hover, .admin-menu li a.active) {
    background: var(--gold-dim) !important;
    color: var(--gold-soft) !important;
    border-color: rgba(246, 201, 76, 0.55) !important;
}

html[data-theme="dark"] :is(.btn-search, .btn-add-cart, .btn-primary, .cart-btn[data-count]::after) {
    background: var(--gold-soft) !important;
    color: #111111 !important;
}

html[data-theme="dark"] :is(.btn-search:hover, .btn-add-cart:hover, .btn-primary:hover) {
    background: #FFE38A !important;
    color: #080808 !important;
}

html[data-theme="dark"] :is(.badge, .staff-tab, .pdp-stock-badge, .pdp-discount-tag, .role-badge, [class*="badge"]) {
    background: var(--surface-3) !important;
    color: #E6E6E6 !important;
    border-color: #3A3A3A !important;
}

/* Dark mode: store link text & product description text */
html[data-theme="dark"] .pdp-store-link {
    color: #D0D0D0 !important;
}
html[data-theme="dark"] .pdp-store-link span {
    color: #D0D0D0 !important;
}
html[data-theme="dark"] .pdp-store-link:hover {
    color: var(--gold-soft) !important;
}
html[data-theme="dark"] .pdp-store-link:hover span {
    color: var(--gold-soft) !important;
}
html[data-theme="dark"] .pdp-desc-body {
    color: #C8C8C8 !important;
}

html[data-theme="dark"] :is(.flash-success, [style*="#D1FAE5" i], [style*="#ECFDF5" i], [style*="#DCFCE7" i]) {
    background: var(--green-dim) !important;
    color: var(--green-soft) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

html[data-theme="dark"] :is(.flash-error, [style*="#FEE2E2" i], [style*="#FEF2F2" i]) {
    background: var(--red-dim) !important;
    color: var(--red-soft) !important;
    border-color: rgba(248, 113, 113, 0.28) !important;
}

html[data-theme="dark"] :is([style*="#EFF6FF" i], [style*="#DBEAFE" i], [style*="#E0E7FF" i], [style*="#FAF5FF" i], [style*="#FFFBEB" i], [style*="#FFFDF5" i], [style*="#FEF3C7" i]) {
    background: var(--gold-dim) !important;
    color: var(--gold-soft) !important;
    border-color: rgba(246, 201, 76, 0.25) !important;
}

html[data-theme="dark"] :is(table, thead, tbody, tr) {
    background: transparent !important;
}

html[data-theme="dark"] :is(th, td) {
    border-color: var(--border-soft) !important;
}

html[data-theme="dark"] :is(.old-price, .text-danger, [style*="#EF4444" i], [style*="#DC2626" i], [style*="#B91C1C" i]) {
    color: var(--red-soft) !important;
}

html[data-theme="dark"] :is([style*="#059669" i], [style*="#10B981" i], [style*="#16A34A" i], [style*="#28A745" i]) {
    color: var(--green-soft) !important;
}

html[data-theme="dark"] :is([style*="#3B82F6" i], [style*="#2563EB" i], [style*="#0284C7" i], [style*="#4F46E5" i], [style*="#9333EA" i]) {
    color: var(--gold-soft) !important;
}

html[data-theme="dark"] .site-logo-dark {
    filter: drop-shadow(0 8px 18px rgba(246, 201, 76, 0.12));
}

/* Dark Theme Overrides for Section Tags */
html[data-theme="dark"] .tag-red {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #FCA5A5 !important;
}
html[data-theme="dark"] .tag-orange {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #FCD34D !important;
}
html[data-theme="dark"] .tag-blue {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93C5FD !important;
}
html[data-theme="dark"] .tag-gray {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #CBD5E1 !important;
}


/* ==========================================================================
   RESPONSIVE DESIGN OVERRIDES (Mobile, Tablet, Desktop)
   ========================================================================== */

/* Very Small Phones (Up to 480px) */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    
    /* Navbar compression */
    .nav-inner { gap: 8px; }
    .brand-logo { font-size: 20px !important; }
    .brand-logo img { height: 28px !important; }
    .nav-icon-btn, .cart-btn, .theme-toggle { width: 34px !important; height: 34px !important; }
    .nav-actions { gap: 6px !important; }
    .user-avatar { width: 28px !important; height: 28px !important; font-size: 12px !important; }
    .nav-user { padding: 4px 8px 4px 4px !important; }
    html[dir="rtl"] .nav-user { padding: 4px 4px 4px 8px !important; }
    .nav-user span { display: none; /* Hide username text on very small screens to save space */ }
    
    /* Adjust grid for very small screens (1 col or compact 2 col) */
    .products-grid-5 { gap: 10px; grid-template-columns: repeat(2, 1fr); }
    .product-info { padding: 10px; }
    .product-title { font-size: 12px; min-height: 36px; }
    .product-price { font-size: 14px; }
    .btn-add-cart { width: 28px; height: 28px; }
    .btn-add-cart svg { width: 14px; height: 14px; }
    
    /* Login & Auth Cards */
    .auth-container { padding: 10px 0; }
    .auth-card { padding: 20px 16px; box-shadow: none; border: none; background: transparent !important; }
    
    /* Footer */
    .footer-inner { gap: 20px; }
    .footer-brand img { height: 44px !important; }
}

/* Mobile Phones (Up to 767px) */
@media (max-width: 767px) {
    .container { padding: 0 16px; }
    
    /* Navbar layout fix */
    .nav-inner { flex-wrap: wrap; padding-bottom: 12px; gap: 12px; justify-content: space-between; }
    .brand-logo img { height: 36px !important; }
    .search-bar { order: 3; flex: 1 0 100%; max-width: 100%; margin-top: 8px; }
    .search-bar input { padding: 12px 48px 12px 20px; font-size: 14px; }
    html[dir="rtl"] .search-bar input { padding: 12px 20px 12px 48px; }
    .btn-search { padding: 0 16px; font-size: 13px; right: 4px; top: 4px; bottom: 4px; }
    html[dir="rtl"] .btn-search { left: 4px; right: auto; }
    
    /* Banner/Hero resizing */
    .banner-section-full { width: calc(100% - 16px); margin: 8px auto 32px; }
    .banner-carousel { border-radius: 20px; height: clamp(160px, 45vw, 280px); }
    .carousel-control { width: 36px; height: 36px; }
    .carousel-control svg { width: 18px; height: 18px; }
    .carousel-indicators { bottom: 10px; }
    .indicator-dot { width: 8px; height: 8px; }
    
    /* Grids & Typography */
    .products-grid-5 { gap: 12px; grid-template-columns: repeat(2, 1fr); }
    .home-section { padding: 32px 0; }
    .home-section-header h2 { font-size: 22px; }
    .stores-strip { padding: 32px 0; }
    .stores-title { font-size: 18px; margin-bottom: 16px; }
    .store-pill { padding: 8px 16px; font-size: 13px; }
    
    /* Auth Form */
    .auth-card { border-radius: var(--radius-md); }
    .auth-header h2 { font-size: 24px; }
    .form-control { padding: 10px 14px; font-size: 13px; }
    .btn-auth { padding: 12px; font-size: 15px; }
    
    /* Navigation Categories Scrollable */
    .nav-cats-inner { gap: 6px; padding-bottom: 4px; }
    .nav-cat { padding: 7px 12px; font-size: 13px; }
    .nav-cat svg { width: 14px; height: 14px; }
}

/* Tablets (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container { padding: 0 20px; }
    
    /* Navbar */
    .nav-inner { gap: 16px; }
    .search-bar { max-width: 400px; }
    
    /* Grid */
    .products-grid-5 { gap: 16px; grid-template-columns: repeat(3, 1fr); }
    .banner-carousel { border-radius: 28px; }
}

/* Laptops (1024px to 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .products-grid-5 { grid-template-columns: repeat(4, 1fr); }
}



/* ===== MOBILE BANNER FIT FIX ===== */
@media (max-width: 1023px) {
    .banner-carousel {
        height: auto !important;
        aspect-ratio: 16 / 5 !important;
    }
    .banner-img {
        object-fit: contain !important;
        background-color: var(--gray-bg);
    }
}

/* ===== MOBILE SEARCH FIX ===== */
@media (max-width: 767px) {
    .search-icon { display: none !important; }
    .search-bar input { padding: 12px 70px 12px 16px !important; }
    html[dir="rtl"] .search-bar input { padding: 12px 16px 12px 70px !important; }
}


/* Super Aggressive Global Thin Yellow Scrollbar */
::-webkit-scrollbar {
    width: 4px !important;
    height: 4px !important;
}
::-webkit-scrollbar-track {
    background: transparent !important;
}
::-webkit-scrollbar-thumb {
    background: #FFE92B !important;
    border-radius: 10px !important;
}
::-webkit-scrollbar-thumb:hover {
    background: #e5d027 !important;
}
* {
    scrollbar-width: thin !important;
    scrollbar-color: #FFE92B transparent !important;
}

/* Homepage Digital Section Tags */
.tag-purple {
    background: #F3E8FF;
    color: #7C3AED;
}

html[data-theme="dark"] .tag-purple {
    background: rgba(168, 85, 247, 0.15) !important;
    color: #C084FC !important;
}

/* Phone verification warning alert banner */
.phone-unverified-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 16px;
    padding: 14px 20px;
    color: #991B1B;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.05);
    margin-bottom: 16px;
}

html[data-theme="dark"] .phone-unverified-alert {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.25), rgba(153, 27, 27, 0.2));
    border-color: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    box-shadow: none;
}

.phone-unverified-alert .alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 14px;
}

.phone-unverified-alert .alert-content svg {
    width: 20px;
    height: 20px;
    color: #DC2626;
    flex-shrink: 0;
}

html[data-theme="dark"] .phone-unverified-alert .alert-content svg {
    color: #EF4444;
}

.phone-unverified-alert .alert-btn {
    display: inline-flex;
    align-items: center;
    background: #DC2626;
    color: #FFFFFF !important;
    font-weight: 800;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15);
}

.phone-unverified-alert .alert-btn:hover {
    background: #B91C1C;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

html[data-theme="dark"] .phone-unverified-alert .alert-btn {
    background: #EF4444;
    color: #111111 !important;
    box-shadow: none;
}

html[data-theme="dark"] .phone-unverified-alert .alert-btn:hover {
    background: #F87171;
}

@media (max-width: 640px) {
    .phone-unverified-alert {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    .phone-unverified-alert .alert-btn {
        width: 100%;
        justify-content: center;
    }
}
