/* ================================================
   MODERN STORE - COMPONENTS
   ================================================ */

/* ================================================
   TOP BAR
   ================================================ */

.top-bar {
    background: var(--gradient-primary);
    color: var(--text-light);
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-contact {
    display: flex;
    gap: var(--space-xl);
}

.top-bar-contact a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-light);
    opacity: 0.9;
}

.top-bar-contact a:hover {
    opacity: 1;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.top-bar-actions button {
    color: var(--text-light);
    opacity: 0.9;
    font-size: 0.875rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.top-bar-actions button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* ================================================
   HEADER
   ================================================ */

.header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    padding: var(--space-md) 0;
    transition: var(--transition-normal);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.75rem;
    font-weight: 800;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark mode: make logo text visible */
[data-theme="dark"] .logo-text {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #e8c882;
    background-clip: unset;
    color: #e8c882;
}

/* Navigation */
.nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    gap: var(--space-xs);
}

.mobile-login-item {
    display: none;
    /* Hidden on desktop */
}

.nav-link {
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-md);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-normal);
    z-index: var(--z-dropdown);
}

/* Remove hover trigger, keep only active class trigger */
.nav-dropdown.active .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Icon Rotation */
.nav-dropdown.active .nav-link i {
    transform: rotate(180deg);
}

.nav-link i {
    transition: transform 0.3s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.dropdown-item i {
    width: 24px;
    text-align: center;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-search {
    position: relative;
}

.search-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.search-toggle:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Cart Button */
.cart-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.cart-btn:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 22px;
    height: 22px;
    background: var(--danger);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ================================================
   HERO SECTION
   ================================================ */

.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--gradient-hero);
    padding: var(--space-4xl) 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-text {
    color: var(--text-light);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    animation: fadeInDown 0.8s ease;
}

.hero-badge i {
    color: var(--accent);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.8s ease;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--accent) 0%, #fcd34d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    max-width: 500px;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-btns {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero-btns .btn-primary {
    background: var(--text-light);
    color: var(--primary);
}

.hero-btns .btn-primary:hover {
    background: var(--accent);
    color: var(--text-light);
}

.hero-btns .btn-secondary {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
}

.hero-btns .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--text-light);
}

/* Hero Image/Slider */
.hero-slider {
    position: relative;
    animation: fadeInRight 1s ease;
}

.hero-slide {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-slide img {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

/* Floating Elements */
.hero-floating {
    position: absolute;
    animation: float 3s ease-in-out infinite;
}

.hero-floating-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.hero-floating-2 {
    bottom: 20%;
    right: 5%;
    animation-delay: 0.5s;
}

.hero-floating-3 {
    top: 50%;
    left: 5%;
    animation-delay: 1s;
}

/* Hero Wave */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: var(--bg-primary);
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 100px;
}

/* ================================================
   PROMO BANNER / OFFERS SLIDER
   ================================================ */

.promo-slider {
    position: relative;
    margin: var(--space-xl) 0;
}

.promo-track {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-sm);
}

.promo-track::-webkit-scrollbar {
    display: none;
}

.promo-card {
    flex: 0 0 calc(33.333% - var(--space-lg));
    scroll-snap-align: start;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.promo-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
}

.promo-card-discount {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.promo-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.promo-card-desc {
    opacity: 0.9;
    font-size: 0.9rem;
}

.promo-card.food {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.promo-card.consumer {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.promo-card.clothes {
    background: linear-gradient(135deg, #d4a855 0%, #e8c882 100%);
}

.promo-card.watches {
    background: linear-gradient(135deg, #e8c882 0%, #d4a855 100%);
}

.promo-card.appliances {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.promo-card.mobiles {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

/* ================================================
   CATEGORIES SECTION
   ================================================ */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.category-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: var(--transition-normal);
}

.category-card:hover {
    transform: translateY(-10px);
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
    z-index: 1;
}

.category-img {
    position: absolute;
    inset: 0;
}

.category-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.category-card:hover .category-img img {
    transform: scale(1.1);
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-xl);
    z-index: 2;
    color: var(--text-light);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
}

.category-card.food .category-icon {
    background: rgba(40, 167, 69, 0.3);
}

.category-card.consumer .category-icon {
    background: rgba(59, 130, 246, 0.3);
}

.category-card.clothes .category-icon {
    background: rgba(212, 168, 85, 0.3);
}

.category-card.watches .category-icon {
    background: rgba(232, 200, 130, 0.3);
}

.category-card.appliances .category-icon {
    background: rgba(37, 99, 235, 0.3);
}

.category-card.mobiles .category-icon {
    background: rgba(96, 165, 250, 0.3);
}

.category-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.category-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ================================================
   PRODUCT CARD
   ================================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
}

/* List View Overrides */
.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    max-width: 100%;
}

.products-grid.list-view .product-image {
    width: 250px;
    height: 250px;
    flex-shrink: 0;
}

.products-grid.list-view .product-info {
    padding: var(--space-xl);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: right;
}

.products-grid.list-view .product-actions {
    position: static;
    transform: none;
    opacity: 1;
    margin-top: var(--space-md);
    justify-content: flex-start;
}

.products-grid.list-view .product-rating {
    margin-bottom: var(--space-sm);
}

.products-grid.list-view .product-footer {
    width: 100%;
    margin-top: var(--space-sm);
    justify-content: flex-start;
    gap: var(--space-lg);
}

.products-grid.list-view .add-to-cart-btn {
    width: auto;
    padding: 0 var(--space-lg);
    border-radius: var(--radius-md);
    gap: var(--space-sm);
}

.products-grid.list-view .add-to-cart-btn::after {
    content: "أضف للسلة";
    font-weight: 600;
}

@media (max-width: 768px) {
    .products-grid.list-view .product-card {
        flex-direction: column;
    }

    .products-grid.list-view .product-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .products-grid.list-view .product-info {
        padding: var(--space-md);
        width: 100%;
    }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-badges {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    z-index: 5;
}

.product-actions {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    gap: var(--space-sm);
    opacity: 0;
    transition: var(--transition-normal);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.product-action-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
    border: 1px solid var(--border-color);
}

.product-action-btn:hover {
    background: var(--primary);
    color: var(--text-light);
    border-color: var(--primary);
}

/* Dark mode: ensure action buttons are visible */
[data-theme="dark"] .product-action-btn {
    background: #1a2744 !important;
    color: #ffffff !important;
    border-color: #3d5a80 !important;
}

[data-theme="dark"] .product-action-btn:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

[data-theme="dark"] .product-action-btn i {
    color: #ffffff !important;
}

.product-info {
    padding: var(--space-lg);
}

.product-category {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name:hover {
    color: var(--primary);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.product-price .price-current {
    font-size: 1.25rem;
}

.product-price .price-old {
    font-size: 0.9rem;
}

.add-to-cart-btn {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    color: var(--text-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.add-to-cart-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

/* ================================================
   CART DRAWER
   ================================================ */

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Better mobile support */
    background: var(--bg-card);
    z-index: calc(var(--z-modal) + 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-normal);
    visibility: hidden;
}

.cart-drawer.active {
    right: 0;
    visibility: visible;
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.cart-drawer-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.25rem;
}

.cart-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.cart-close:hover {
    background: var(--bg-secondary);
    color: var(--danger);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.cart-empty {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-muted);
}

.cart-empty i {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.3;
}

.cart-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: var(--space-xs);
    font-size: 0.95rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-remove {
    color: var(--danger);
    font-size: 0.85rem;
}

.cart-drawer-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.cart-total span:last-child {
    color: var(--primary);
}

/* ================================================
   FOOTER
   ================================================ */

.footer {
    background: var(--bg-secondary);
    padding: var(--space-4xl) 0 var(--space-xl);
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-3xl);
    margin-bottom: var(--space-3xl);
}

.footer-brand p {
    color: var(--text-secondary);
    margin: var(--space-lg) 0;
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: var(--space-md);
}

.footer-social a {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.footer-social a:hover {
    background: var(--primary);
    color: var(--text-light);
    border-color: var(--primary);
}

.footer-links h4 {
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.footer-links ul li {
    margin-bottom: var(--space-sm);
}

.footer-links ul a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links ul a:hover {
    color: var(--primary);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.footer-contact i {
    color: var(--primary);
    margin-top: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================================
   NEWSLETTER
   ================================================ */

.newsletter {
    background: var(--gradient-primary);
    padding: var(--space-3xl) 0;
    color: var(--text-light);
}

.newsletter-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2xl);
    flex-wrap: wrap;
}

.newsletter-text h3 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.newsletter-text p {
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: var(--space-md);
    flex: 1;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 1rem;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
    border-color: var(--text-light);
    background: rgba(255, 255, 255, 0.3);
}

.newsletter-form .btn {
    background: var(--text-light);
    color: var(--primary);
    white-space: nowrap;
}

.newsletter-form .btn:hover {
    background: var(--accent);
    color: var(--text-light);
}

/* ================================================
   SEARCH OVERLAY
   ================================================ */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: var(--z-modal);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 700px;
    padding: 0 var(--space-xl);
    transform: translateY(-30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active .search-container {
    transform: translateY(0) scale(1);
}

.search-form {
    position: relative;
    width: 100%;
}

.search-form input {
    width: 100%;
    padding: 24px 32px;
    padding-left: 60px;
    /* Space for icon */
    background: var(--bg-card);
    border: 2px solid transparent;
    /* Remove border */
    border-radius: var(--radius-2xl);
    font-size: 1.5rem;
    color: var(--text-primary);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

/* Search Icon inside input */
.search-form::before {
    content: '\f002';
    /* FontAwesome search */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--text-muted);
    z-index: 1;
    pointer-events: none;
}

.search-form input:focus {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 30px 60px -12px rgba(99, 102, 241, 0.3);
    outline: none;
}

.search-close {
    position: absolute;
    top: var(--space-xl);
    left: var(--space-xl);
    color: var(--text-light);
    font-size: 2rem;
}

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */

@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .promo-card {
        flex: 0 0 calc(50% - var(--space-lg));
    }
}

@media (max-width: 768px) {
    .top-bar-contact {
        gap: var(--space-md);
    }

    .top-bar-contact a {
        font-size: 0;
        /* Hide text */
    }

    .top-bar-contact a i {
        font-size: 1rem;
        /* Show icons */
        color: var(--text-light);
    }

    .top-bar-content {
        justify-content: space-between;
    }

    .top-bar-actions {
        font-size: 0.8rem;
    }

    .top-bar-actions span {
        display: none;
        /* Hide free shipping text on mobile */
    }

    /* Hide Login Button completely on Mobile (Moved to Menu) */
    .header-actions .btn-primary {
        display: none !important;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--space-4xl) var(--space-xl);
        box-shadow: var(--shadow-xl);
        transition: var(--transition-normal);
        z-index: var(--z-modal);
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
    }

    .nav-link {
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-color);
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding-top: var(--space-2xl);
        padding-bottom: 8rem;
        /* Ensure space for the 100px wave */
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-xl);
    }

    .hero-desc {
        margin: 0 auto var(--space-xl);
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-slider {
        display: none;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
    }

    .promo-card {
        flex: 0 0 calc(100% - var(--space-md));
    }

    .cart-drawer {
        width: 100%;
        right: -100%;
    }

    /* Mobile Menu - Absolute below header */
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 85vh;
        overflow-y: auto;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--space-md);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        border-bottom: 2px solid var(--primary);
        z-index: var(--z-fixed);
        display: none;
        opacity: 0;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .nav.active {
        display: flex;
        animation: fadeInMenu 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes fadeInMenu {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Mobile Menu Items Stying */
    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .mobile-login-item {
        display: block;
        /* Show on mobile */
        margin-top: 10px;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
    }

    .mobile-login-item .nav-link {
        justify-content: center;
        background: var(--primary);
        color: #fff !important;
        border: 1px solid var(--primary);
        /* Ensure border for inversion */
        transition: 0.2s;
    }

    .mobile-login-item .nav-link:active,
    .mobile-login-item .nav-link:hover {
        background: transparent !important;
        color: var(--primary) !important;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: transparent;
        border: 1px solid transparent;
        font-weight: 600;
        font-size: 1rem;
    }

    .nav-link:hover,
    .nav-link.active {
        background: var(--bg-secondary);
        color: var(--primary);
        padding-right: 24px;
        border-color: var(--border-color);
    }
}

/* Closing max-width: 1024px */

/* ================================================
   MOBILE FILTERS DRAWER
   ================================================ */

/* Show/Hide logic */
@media (max-width: 1024px) {
    .mobile-only {
        display: block;
    }

    .filter-toggle-btn {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        padding: 8px 16px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 0.5rem;
        /* Add spacing */
        color: var(--text-primary);
        /* Ensure visible text */
    }

    /* Fixed Sidebar for Mobile/Tablet */
    .sidebar {
        display: block !important;
        position: fixed;
        top: 0;
        right: -320px;
        /* Fully hide */
        width: 300px;
        max-width: 85vw;
        /* Prevent overflow on small screens */
        height: 100vh;
        background: var(--bg-card);
        z-index: 99999;
        /* Higher than everything (overlay is usually z-modal ~1000) */
        padding: var(--space-lg);
        box-shadow: var(--shadow-2xl);
        /* Stronger shadow */
        overflow-y: auto;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
    }

    .sidebar.active {
        right: 0;
        visibility: visible;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--space-lg);
        padding-bottom: var(--space-md);
        border-bottom: 1px solid var(--border-color);
    }

    .close-filters {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--bg-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
        font-size: 1.2rem;
        transition: background 0.2s;
        border: none;
        cursor: pointer;
    }

    .close-filters:hover {
        background: var(--danger-light);
        /* Or red tint */
        color: var(--danger);
    }
}

/* Hide mobile elements on desktop */
@media (min-width: 1025px) {
    .mobile-only {
        display: none !important;
    }
}

/* ================================================
   MOBILE IMPROVEMENTS (max-width: 480px)
   ================================================ */

@media (max-width: 480px) {

    /* Header adjustments */
    .logo {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .logo-text {
        font-size: 0.9rem;
        display: none;
        /* Hide text to make space for icons */
    }

    /* Reveal Header Icons but resize them */
    .header-actions {
        gap: 6px;
        /* Tighten spacing */
    }

    .header-actions .cart-btn[aria-label="المفضلة"],
    .header-actions .cart-btn[aria-label="المقارنة"] {
        display: inline-flex;
        /* Show them again */
    }

    .search-toggle,
    .cart-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cart-count {
        width: 14px;
        height: 14px;
        font-size: 0.6rem;
        top: -2px;
        right: -2px;
    }

    /* Hero section */
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-desc {
        font-size: 0.95rem;
    }

    .hero-btns {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .hero-btns .btn {
        width: 100%;
    }

    /* Section titles */
    .section-title {
        font-size: 1.5rem;
    }

    /* Product cards adjustments */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        /* Smaller gap */
    }

    .product-card {
        padding: 10px;
    }

    .product-image {
        margin-bottom: 8px;
    }

    .product-name {
        font-size: 0.8rem;
        margin-bottom: 4px;
        height: 2.4em;
        /* Limit height */
        overflow: hidden;
    }

    .product-info {
        padding: 0;
    }

    .product-rating {
        margin-bottom: 8px;
        font-size: 0.7rem;
    }

    .product-footer {
        flex-direction: column;
        /* Stack price and button */
        align-items: flex-start;
        gap: 8px;
    }

    .product-price {
        font-size: 0.95rem;
        width: 100%;
    }

    .add-to-cart-btn {
        width: 100%;
        /* Full width button on mobile */
        height: 32px;
        border-radius: var(--radius-sm);
        margin-top: 5px;
    }

    .product-actions {
        gap: 4px;
    }

    .product-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    /* Category cards */
    .category-card {
        padding: var(--space-md);
    }

    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .category-name {
        font-size: 0.9rem;
    }

    /* Footer */
    .footer {
        padding: var(--space-2xl) 0 var(--space-xl);
    }

    .footer-brand .logo {
        font-size: 1.25rem;
    }

    .footer-links h4 {
        font-size: 1rem;
    }

    /* Buttons */
    .btn-lg {
        padding: var(--space-md) var(--space-xl);
        font-size: 0.95rem;
    }

    /* Top bar */
    .top-bar {
        font-size: 0.75rem;
        padding: var(--space-xs) 0;
    }

    .top-bar-content {
        justify-content: space-between;
        gap: var(--space-md);
    }

    .top-bar-contact {
        gap: var(--space-md);
    }

    .top-bar-contact a {
        font-size: 0;
        /* Hide text */
    }

    .top-bar-contact a i {
        font-size: 1rem;
        /* Show icons at normal size */
    }

    .top-bar-actions span {
        display: none;
        /* Hide free shipping text */
    }

    /* Preloader */
    .preloader-svg {
        width: 100px;
        height: 100px;
    }

    .preloader-text {
        font-size: 1rem;
    }
}

/* ================================================
   USER DROPDOWN (DESKTOP)
   ================================================ */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    /* Center relative to button */
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: var(--space-xs);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: var(--z-dropdown);
    margin-top: var(--space-sm);
}

/* Arrow indicator for dropdown */
.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

/* Show on Hover */
.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    text-align: right;
    /* RTL */
    white-space: nowrap;
}

.user-dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

/* Dark mode adjustments */
[data-theme="dark"] .user-dropdown-menu {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .user-dropdown-menu::before {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ================================================
   MOBILE SIGNUP ITEM
   ================================================ */
.mobile-signup-item {
    display: none;
    /* Hidden on desktop */
}

@media (max-width: 768px) {
    .mobile-signup-item {
        display: block;
        /* Show on mobile */
        margin-top: 5px;
    }

    .mobile-signup-item .nav-link {
        justify-content: center;
        background: transparent;
        border: 1px solid var(--primary);
        color: var(--primary) !important;
    }

    .mobile-signup-item .nav-link:hover {
        background: var(--primary);
        color: #fff !important;
    }
}
