@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
    --primary-red: #A8112A;
    --navy-blue: #002D5B;
    --bg-light: #F0F2F5;
    --white: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-muted: #707070;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.06);
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    direction: rtl;
    font-family: 'Cairo', sans-serif;
    padding-bottom: 90px;
    overflow-x: hidden;
}

/* === REFINED HEADER === */
.navbar {
    height: var(--header-height);
    background: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hamburger {
    font-size: 22px;
    color: var(--white);
    cursor: pointer;
    order: 3;
    margin-right: 20px;
}

.logo {
    order: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    height: 38px;
    display: block;
}

.logo span {
    color: #e0f2fe; /* Light Blue / Sky Blue */
    font-weight: 900;
    font-size: 20px;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,-45, 91, 0.3);
}

.header-icons {
    display: flex;
    gap: 18px;
    font-size: 20px;
    color: var(--white);
    order: 2;
    align-items: center;
    margin-right: auto;
}

.header-icons a[href="cart.html"] {
    background: #ffffff !important;
    color: var(--navy-blue) !important;
    width: 38px;
    height: 38px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 45, 91, 0.2);
    border: none !important;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.header-icons .toggle-search {
    cursor: pointer;
    color: var(--white);
}

.header-icons a {
    color: var(--white);
    text-decoration: none;
}

.header-icons .about-link-nav {
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    margin-right: 5px;
    white-space: nowrap;
    opacity: 0.95;
    transition: all 0.3s ease;
}

.header-icons .about-link-nav:hover {
    opacity: 1;
    text-decoration: underline;
}

.header-icons a[href="cart.html"]:hover {
    transform: scale(1.05);
}

.header-icons a[href="cart.html"] .cart-badge, 
.header-icons a[href="cart.html"] span[id="cart-count"] {
    background: var(--primary-red) !important;
    color: #ffffff !important;
    position: absolute !important;
    top: -8px !important; /* Slight overlap at the top-center */
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    border: 2px solid #ffffff !important;
    font-size: 10px !important;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

/* === SEARCH OVERLAY === */
.search-overlay {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--navy-blue);
    z-index: 1100;
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: top 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-overlay.active {
    top: 0;
}

.search-container {
    display: flex;
    width: 100%;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    border: none;
    padding: 0 20px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    outline: none;
}

.close-search {
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
}

/* === FLY TO CART ANIMATION === */
.fly-item {
    position: fixed;
    z-index: 9999;
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === MOBILE SIDEBAR === */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 1001;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 30px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header .close-sidebar {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.sidebar-links {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-links a {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--navy-blue);
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    transition: background 0.3s;
}

.sidebar-links a i {
    font-size: 20px;
    color: var(--primary-red);
    width: 25px;
    text-align: center;
}

.sidebar-links a:hover {
    background: #f8fafc;
}

/* === RESPONSIVE HERO SECTION === */
.hero-wrapper {
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9.5;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
}

.hero-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    position: absolute;
    left: 5%;
    transition: opacity 0.4s ease;
}

.hero-overlay-text {
    position: absolute;
    top: 20%;
    right: 8%;
    z-index: 2;
    text-align: right;
    pointer-events: none;
}

.hero-overlay-text h1 {
    font-size: 26px;
    font-weight: 900;
    color: var(--navy-blue);
    line-height: 1.1;
}

.hero-overlay-text h1 span {
    color: var(--primary-red);
}

.hero-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #E0E0E0;
    cursor: pointer;
    transition: all 0.3s;
}

.indicator-dot.active {
    background: var(--primary-red);
    width: 20px;
    border-radius: 10px;
}

/* Laptop/Desktop Hero Adjustments */
@media (min-width: 1024px) {
    .hero-content-card {
        aspect-ratio: 21/9; /* Wider for desktop */
        min-height: 450px;
    }
    
    .hero-overlay-text h1 {
        font-size: 48px;
    }
    
    .hero-wrapper {
        padding: 40px;
    }
    
    .hero-img {
        width: 60%;
        left: 2%;
    }
    
    .hero-overlay-text {
        right: 10%;
        top: 30%;
    }
}

/* === CATEGORIES === */
.categories-container {
    padding: 10px 0 20px 15px;
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scrollbar-width: none;
    max-width: 1400px;
    margin: 0 auto;
}
.categories-container::-webkit-scrollbar { display: none; }

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 75px;
    text-decoration: none;
    color: inherit;
}

.category-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #F8F9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--navy-blue);
    border: 1px solid #EEE;
    transition: all 0.3s;
}

.category-item.active .category-icon-circle {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
    box-shadow: 0 8px 15px rgba(168, 17, 42, 0.2);
}

.category-name {
    font-size: 12px;
    font-weight: 700;
    color: #444;
}

/* === FEATURES BAR === */
.features-bar-mobile {
    margin: 5px 15px 25px;
    background: var(--navy-blue);
    border-radius: 12px;
    display: flex;
    padding: 12px 10px;
    justify-content: space-between;
    color: var(--white);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.feature-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.feature-item-mobile i { font-size: 18px; }
.feature-item-mobile span { font-size: 10px; font-weight: 700; text-align: center; }
.feature-v-divider { width: 1px; background: rgba(255,255,255,0.1); height: 30px; align-self: center; }

/* Desktop category/features grid fallback */
@media (min-width: 1024px) {
    .categories-container {
        justify-content: center;
        gap: 30px;
    }
    .features-bar-mobile {
        padding: 20px 40px;
    }
}

/* === SECTION HEADER === */
.section-header-mobile {
    padding: 0 15px 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header-mobile h2 {
    font-size: 18px;
    font-weight: 900;
    color: var(--navy-blue);
}

/* === PRODUCT GRID === */
.products-grid-mobile {
    padding: 0 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .products-grid-mobile {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
        padding: 0 40px;
    }
}

.product-card-mobile {
    background: var(--white);
    border-radius: 18px;
    padding: 15px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.product-card-mobile:hover {
    transform: translateY(-5px);
}

.product-img-mobile {
    width: 100%;
    aspect-ratio: 1.1;
    object-fit: contain;
    margin-bottom: 12px;
}

.product-info-mobile {
    text-align: right;
}

.product-rating-mobile { color: #FFD700; font-size: 9px; margin-bottom: 6px; }

.product-name-mobile {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.3;
    height: 34px;
    overflow: hidden;
    color: var(--navy-blue);
}

.product-price-row-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price-mobile {
    font-weight: 900;
    color: var(--primary-red);
    font-size: 15px;
}

.product-price-mobile span { font-size: 10px; font-weight: 600; }

.btn-add-quick {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 1001;
    padding-bottom: 10px;
}

/* Hide bottom nav on desktop, maybe show a standard footer if needed */
@media (min-width: 1024px) {
    .bottom-nav { display: none; }
    body { padding-bottom: 40px; }
}

.nav-item-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #A0AEC0;
}

.nav-item-bottom.active {
    color: var(--navy-blue);
}

.nav-item-bottom i { font-size: 22px; }

.nav-item-bottom.home-btn {
    background: var(--navy-blue);
    color: var(--white);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    justify-content: center;
    margin-top: -30px;
    box-shadow: 0 8px 20px rgba(0, 45, 91, 0.3);
    border: 4px solid var(--white);
}

/* SIDEBAR HIDE */
.sidebar-backdrop, .profile-container { display: none !important; }

/* === PREMIUM UI ENHANCEMENTS === */
.premium-btn {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white !important;
    border: none;
    border-radius: 16px;
    padding: 18px 30px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    width: 100%;
}

.premium-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.premium-btn:active {
    transform: translateY(0);
}

.premium-btn i {
    font-size: 20px;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-in {
    animation: fadeInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card {
    background: white;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    padding: 25px;
    transition: all 0.3s ease;
}

.premium-input-group {
    margin-bottom: 20px;
}

.premium-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 10px;
    padding-right: 5px;
}

.premium-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.premium-input-wrapper i {
    position: absolute;
    right: 15px;
    color: #94a3b8;
    font-size: 16px;
}

.premium-input {
    width: 100%;
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    padding: 16px 45px 16px 15px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    transition: all 0.3s ease;
    outline: none;
}

.premium-input:focus {
    background: white;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.payment-tab.active {
    border-color: #6366f1 !important;
    background: #f5f3ff !important;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15) !important;
}

.payment-tab.active .check-mark {
    background: #6366f1 !important;
}


/* ===== MEGA FOOTER ===== */
.mega-footer {
    background: #002D5B; /* Dark Navy */
    color: #fff;
    padding: 60px 20px 20px;
    font-family: 'Cairo', sans-serif;
    border-top: 5px solid #A8112A;
    margin-top: 40px;
}

.mega-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
}

.footer-column {
    flex: 1;
    min-width: 250px;
}

.footer-column h3 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: #A8112A;
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a i {
    font-size: 10px;
    color: #A8112A;
}

.footer-links a:hover {
    color: #fff;
    transform: translateX(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .mega-footer {
        padding: 40px 15px 15px;
        padding-bottom: 80px; /* Space for bottom nav on mobile */
    }
    .mega-footer-content {
        flex-direction: column;
        gap: 30px;
    }
}
