/* CSS Variables for Admin Customization */
:root {
    --primary-color: #f1c40f; /* Yellow - can be changed by admin */
    --secondary-color: #27ae60; /* Green - can be changed by admin */
    --header-bg: #000000; /* Solid black header background */
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-light: #f8f9fa;
    --font-arabic: 'Tajawal', sans-serif;
    --font-main: 'Readex Pro', sans-serif;
}

/* Apply Tajawal font for Arabic language */
html[lang="ar"] body,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] p,
html[lang="ar"] a, html[lang="ar"] span, html[lang="ar"] button,
html[lang="ar"] input::placeholder {
    font-family: var(--font-arabic);
}

/* General reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fff;
}

/* Header */
header {
    background: var(--header-bg); /* Solid black background */
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 40px;
}

/* Logo */
.logo img {
    height: 55px;
    transition: transform 0.3s ease;
}
.logo img:hover { transform: scale(1.05); }

/* Center Section (Search + Navigation) */
.center-section { display: flex; align-items: center; flex-grow: 1; gap: 50px; justify-content: center; }

/* Search Container */
.search-container { position: relative; max-width: 400px; flex-shrink: 0; }
.search-container i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #999; font-size: 16px; z-index: 2; cursor: pointer; transition: color 0.3s ease; }
.search-container i:hover { color: var(--primary-color); }
html[dir="rtl"] .search-container i { left: auto; right: 20px; }
.search-container input { width: 100%; padding: 18px 25px 18px 55px; border: none; border-radius: 30px; font-size: 15px; background-color: rgba(255,255,255,0.95); color: var(--text-dark); transition: all 0.3s ease; box-shadow: 0 2px 15px rgba(0,0,0,0.1); }
html[dir="rtl"] .search-container input { padding: 18px 55px 18px 25px; }
.search-container input:focus { outline: none; background-color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.2); transform: translateY(-2px); }
.search-container input::placeholder { color: #999; }

/* User Navigation */
.user-nav { display: flex; align-items: center; gap: 30px; }
#lang-switcher { background: none; color: var(--primary-color); border: none; padding: 0; border-radius: 0; font-weight: bold; font-size: 18px; cursor: pointer; transition: all 0.3s ease; }
#lang-switcher:hover { background: none; transform: scale(1.05); box-shadow: none; }
.user-nav a { color: var(--primary-color); font-size: 20px; padding: 0; border-radius: 0; transition: transform 0.3s ease; position: relative; }
.user-nav a:hover { background-color: transparent; transform: scale(1.15); }
.user-profile-link { display: flex; align-items: center; text-decoration: none; color: var(--text-light); padding: 0; border-radius: 0; background: transparent; transition: all 0.3s ease; }
.user-profile-link:hover { background: transparent; transform: scale(1.05); }
.profile-pic-small { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; margin-right: 10px; border: none; }
html[dir="rtl"] .profile-pic-small { margin-right: 0; margin-left: 10px; }
.user-profile-link span { font-weight: 500; font-size: 15px; transition: color 0.3s ease; }
.user-profile-link:hover span { color: var(--primary-color); }
.profile-icon { color: var(--primary-color) !important; font-size: 24px !important; transition: transform 0.3s ease; }
.profile-icon:hover { transform: scale(1.15); }

/* Inline Navigation */
.inline-nav { display: flex; gap: 40px; align-items: center; }
.inline-nav a { color: var(--text-light); text-decoration: none; font-weight: 500; font-size: 15px; padding: 10px 18px; position: relative; transition: color 0.3s ease; border-radius: 0; }
.inline-nav a::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background: var(--primary-color); transition: all 0.4s ease; transform: translateX(-50%); border-radius: 2px; }
.inline-nav a:hover { color: var(--primary-color); background: transparent; }
.inline-nav a:hover::after { width: 80%; animation: shimmer 0.6s ease; }

@keyframes shimmer {
    0% { opacity: 0.5; transform: translateX(-50%) scale(0.8); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* --- Hero Section Styles (COMPLETELY REWRITTEN) --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 90vh;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: none; /* Hide all slides by default */
    align-items: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

/* Show first slide by default before JavaScript loads */
.hero-slide:first-child {
    display: flex;
    opacity: 1;
}

.hero-slide.active {
    display: flex; /* Show only the active slide */
    opacity: 1;
}

/* Add a subtle overlay for text readability */
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
}
html[dir="rtl"] .hero-slide::before {
    background: linear-gradient(270deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
}

.hero-content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    z-index: 2;
    color: var(--text-light);
}
html[dir="rtl"] .hero-content-container {
    flex-direction: row-reverse;
}

.hero-text {
    flex-basis: 50%;
    animation: fadeInDown 1s both;
}
html[dir="rtl"] .hero-text {
    text-align: right;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.hero-text ul {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}
.hero-text ul li {
    font-size: 1.2rem;
    margin-bottom: 10px;
    padding-left: 1.5em;
    position: relative;
}
html[dir="rtl"] .hero-text ul li {
    padding-left: 0;
    padding-right: 1.5em;
}

.hero-text ul li::before {
    content: '\f058'; /* Font Awesome check-circle */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    left: 0;
    top: 5px;
}
html[dir="rtl"] .hero-text ul li::before {
    left: auto;
    right: 0;
}

.cta-button {
    background-color: var(--primary-color);
    color: var(--text-dark);
    padding: 15px 35px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: inline-block;
}
.cta-button:hover {
    background-color: var(--text-light);
    color: var(--header-bg);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(241,196,15,0.4);
}

.hero-image {
    flex-basis: 45%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-image img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.5));
    animation: fadeInUp 1s both;
}

/* Slider Controls */
.slider-arrow {
    position: absolute;
    top: 50%;
   
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}
.slider-arrow:hover {
    background-color: rgba(255, 255, 255, 0.5);
}
.slider-arrow.prev { left: 30px; }
.slider-arrow.next { right: 30px; }

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.slider-dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.slider-dot.active {
    background-color: #fff;
    transform: scale(1.2);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}



.mobile-menu-btn:hover {
    background: rgba(241, 196, 15, 0.1);
    transform: scale(1.1);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--header-bg);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
}

[dir="rtl"] .mobile-menu {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* اللوجو في المنيو المحمول */
.mobile-menu-header .logo {
    display: flex;
    align-items: center;
}

.mobile-menu-header .logo img,
.mobile-menu-header .logo video {
    max-height: 50px;
    max-width: 150px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mobile-menu-header .logo img:hover,
.mobile-menu-header .logo video:hover {
    transform: scale(1.05);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(241, 196, 15, 0.1);
    transform: scale(1.1);
}

.mobile-search {
    margin-bottom: 2rem;
}

.mobile-search .search-container {
    max-width: 100%;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mobile-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    /* border: 1px solid transparent; */
}

.mobile-nav a:hover {
    background: rgba(241, 196, 15, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mobile-user-section {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.mobile-user-profile img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-user-info h4 {
    color: var(--text-light);
    margin: 0;
    font-size: 16px;
}

.mobile-user-info p {
    color: #999;
    margin: 0;
    font-size: 14px;
}

.mobile-lang-switcher {
    background: var(--primary-color);
    color: var(--text-dark);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.mobile-lang-switcher:hover {
    background: #e6b800;
    transform: translateY(-2px);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* Fix mobile layout issues */
    html, body {
        overflow-x: hidden;
        width: 100%;
        min-height: 100vh;
        background: #fff;
        margin: 0;
        padding: 0;
    }
    
    html {
        font-size: 16px;
    }
    
    .container {
        max-width: 100%;
        padding: 0 1rem;
        margin: 0 auto;
    }
    
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        background: var(--header-bg);
    }
    
    .top-bar {
        padding: 10px 20px;
        gap: 0;
        justify-content: space-between;
        width: 100%;
        background: var(--header-bg);
        display: flex;
        align-items: center;
    }
    
    .center-section {
        display: none !important;
    }
    
    .user-nav {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: block !important;
        z-index: 1001;
    }
    
    .logo img {
        height: 45px;
    }
    
    /* Hero section responsive */
    .hero-section {
        /* padding: 2rem 1rem; */
        min-height: 100%;
    }
    
    .hero-content-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-image {
        order: 1;
        margin-bottom: 2rem;
    }
    
    html[dir="rtl"] .hero-content-container {
        flex-direction: column;
    }
    
    .hero-text {
        flex-basis: 100%;
        order: 2;
    }
    
    .hero-image {
        flex-basis: 100%;
        order: 1;
    }
    
    .hero-text h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-text p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .slider-arrow {
        display: none;
    }
    
    .slider-dots {
        bottom: 15px;
    }
    
    /* Fix sections layout */
    main {
        width: 100%;
        padding: 1rem;
        background: #fff;
    }
    
    section {
        width: 100%;
        margin: 0;
    }
    
    /* Ensure no horizontal overflow */
    *, *::before, *::after {
        /* max-width: 100%; */
        box-sizing: border-box;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Force all containers to stay within viewport */
    .hero-section,
    .featured-products-section,
    .brands-section,
    main {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Fix any flex containers that might overflow */
    .hero-content,
    .featured-products-container,
    .brands-container {
        width: 100%;
        max-width: 100%;
    }
    
    /* FORCE single item display in mobile sliders */
    .featured-products-slider,
    .brands-slider {
        width: 100vw !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        padding: 0 !important;
    }
    
    .featured-products-grid,
    .brands-grid {
        /* padding: 0 1rem !important; */
    }
    
    .featured-product-card,
    .brand-card {
        flex: 0 0 100vw !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
}

/* Print: hide site header and any mobile menu elements */
@media print {
    header,
    .top-bar,
    .inline-nav,
    .user-nav,
    .mobile-menu,
    .mobile-menu-btn { display: none !important; }
    body { background: #fff !important; }
}
 