/* ============================================
   EgyMerch Theme - Green Color Scheme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    /* Primary Colors - Green Theme */
    --primary: #1BA87E;
    --primary-dark: #158F6A;
    --primary-light: #27C193;
    --primary-gradient: linear-gradient(135deg, #1BA87E 0%, #27C193 100%);
    
    /* Secondary/Accent */
    --accent-orange: #FF5722;
    --accent-red: #E53935;
    --accent-yellow: #FFC107;
    
    /* Neutrals */
    --dark: #333333;
    --gray-700: #555555;
    --gray-500: #888888;
    --gray-300: #CCCCCC;
    --gray-100: #F5F5F5;
    --white: #FFFFFF;
    
    /* Background */
    --bg-primary: #F5F5F5;
    --bg-card: #FFFFFF;
    --bg-header: #FFFFFF;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
}

/* ============================================
   Base Styles
   ============================================ */

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-primary);
    color: var(--dark);
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Top Banner
   ============================================ */

.top-banner {
    background: var(--primary-gradient);
    padding: 8px 0;
}

.top-banner a {
    color: var(--white);
}

.top-banner a:hover {
    color: rgba(255,255,255,0.9);
}

/* ============================================
   Main Header
   ============================================ */

.main-header {
    background: var(--bg-header);
    box-shadow: var(--shadow-sm);
    z-index: 2050;
        /* Increased and ensured visibility */
        overflow: visible !important;
    }
    
    .main-header .container,
    .main-header .navbar,
    .main-header .header-actions {
        overflow: visible !important;
}

.main-header .navbar {
    padding: 1rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

/* Header Search */
.header-search .input-group {
    max-width: 500px;
    width: 100%;
}

.header-search .form-control {
    border: 2px solid var(--gray-300);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.75rem 1rem;
}

.header-search .form-control:focus {
    border-color: var(--primary);
    box-shadow: none;
}

.header-search .btn {
    background: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--white);
    padding: 0.75rem 1.25rem;
}

.header-search .btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Navigation Links */
.nav-link {
    font-weight: 600;
    color: var(--dark) !important;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

/* Mega Menu */
.mega-dropdown {
    position: static;
}

.mega-menu {
    width: 100%;
    padding: 1.5rem;
    border: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.mega-menu .dropdown-header {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-100);
}

.mega-menu .dropdown-item {
    padding: 0.5rem 0;
    color: var(--gray-700);
}

.mega-menu .dropdown-item:hover {
    background: none;
    color: var(--primary);
    padding-right: 0.5rem;
}

/* User Actions */
.header-actions .btn-link {
    padding: 0.5rem;
    color: var(--dark);
}

.header-actions .btn-link:hover {
    color: var(--primary);
}

.header-actions .dropdown-menu {
    text-align: right;
    left: auto !important;
        /* z-index: 3000 !important; */
        /* Extremely high to ensure it displays over hero slides */
        /* overflow: visible !important; */
}
/* ============================================
   Shipping Banner
   ============================================ */

.shipping-banner {
    background: var(--gray-100);
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-300);
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

/* Category Card */
.category-card {
    cursor: pointer;
    transition: var(--transition-normal);
    border: 2px solid transparent;
}

.category-card:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary), transparent 95%);
}

.category-card h5 {
    color: var(--dark);
}

/* ============================================
   Product Card
   ============================================ */

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.product-card .product-image {
    position: relative;
    padding-top: 100%;
    background: var(--gray-100);
    overflow: hidden;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform var(--transition-normal);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .badge-sale {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-orange);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.product-card .product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    margin-top: auto;
}

.product-card .current-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.product-card .original-price {
    font-size: 0.9rem;
    color: var(--gray-500);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.product-card .quick-add {
    opacity: 0;
    transition: var(--transition-fast);
}

.product-card:hover .quick-add {
    opacity: 1;
}

/* Wishlist button */
.product-card .wishlist-btn {
    position: absolute;
    top: 15px;
        left: 15px;
    width: 36px;
    height: 36px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.product-card .wishlist-btn:hover {
    color: var(--accent-red);
    transform: scale(1.1);
}

/* ============================================
   Hero Section
   ============================================ */

/* ============================================
   Enhanced Hero Carousel
   ============================================ */
.hero-carousel {
    margin-bottom: 3rem;
        border-radius: var(--radius-lg);
        overflow: hidden;
        box-shadow: var(--shadow-lg);
}

.hero-slide {
    height: 500px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    }
    
    .hero-bg-img {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: translate(-50%, -50%);
        z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
}
.hero-slide .hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
        max-width: 600px;
        color: var(--white);
}

.hero-slide h2 {
    font-weight: 800;
    font-size: 3.5rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
        animation: fadeInUp 0.8s ease;
}

.hero-slide p {
    font-size: 1.25rem;
        margin-bottom: 2rem;
        opacity: 0.9;
        animation: fadeInUp 1s ease;
}

@media (max-width: 768px) {
    .hero-slide {
        height: 380px;
    }
    .hero-slide .hero-content {
        padding: 2rem 1.5rem;
        max-width: 100%;
        text-align: center;
        margin: 0 auto;
    }
    .hero-slide h2 {
        font-size: 2.2rem;
            margin-bottom: 1rem;
        }
        
        .hero-slide p {
            font-size: 1rem;
            margin-bottom: 1.5rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        }
        
        /* Category Slider */
        .category-slider-wrapper {
            margin-bottom: 3rem;
            padding: 1rem 0;
            position: relative;
            user-select: none;
        }
        
        .category-slider-container {
            position: relative;
            display: flex;
            align-items: center;
            max-width: 100%;
            width: 100%;
            margin: 0 auto;
            padding: 0 45px;
                /* Add space for arrows on mobile too */
            /* Arrows will float over */
        }
        
        @media (min-width: 992px) {
            .category-slider-container {
                /* max-width: 900px; */
                padding: 0 45px;
            }
        }
        
        .category-slider {
            display: flex;
            gap: 1.5rem;
            overflow-x: auto;
            padding: 1.5rem 0.5rem;
            scrollbar-width: none;
            /* Firefox */
            -ms-overflow-style: none;
            /* IE and Edge */
            scroll-behavior: smooth;
            width: 100%;
            justify-content: flex-start;
            /* Content starts from right (RTL) or left */
        }
        
        @media (min-width: 992px) {
            .category-slider {
                justify-content: flex-start;
                    /* Removed center to prevent RTL clipping */
            }
        }
        
        .category-slider::-webkit-scrollbar {
            display: none;
            /* Chrome, Safari, Opera */
        }
        
        /* Slider Navigation Arrows */
        .slider-arrow {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 42px;
            height: 42px;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
            transition: all 0.3s ease;
            font-size: 1.25rem;
        }
        
        .slider-arrow:hover {
            background: var(--primary);
            color: var(--white);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
            transform: translateY(-50%) scale(1.1);
        }
        
        .slider-arrow.arrow-prev {
            inset-inline-start: 0;
        }
        
        .slider-arrow.arrow-next {
            inset-inline-end: 0;
        }
        
        @media (max-width: 992px) {
            .slider-arrow {
                width: 36px;
                height: 36px;
                font-size: 1rem;
                background: rgba(255, 255, 255, 0.85);
            }
        
            .slider-arrow.arrow-prev {
                inset-inline-start: 10px;
            }
        
            .slider-arrow.arrow-next {
                inset-inline-end: 10px;
            }
        }
        
        .category-item {
            flex: 0 0 auto;
            width: 20%;
            text-align: center;
            cursor: pointer;
            transition: var(--transition-normal);
            display: flex;
                flex-direction: column;
                align-items: center;
                gap: 0.5rem;
            }
            
            .category-item.active span {
                color: var(--primary);
                font-weight: 700;
        }
        
        @media (max-width: 768px) {
            .category-item {
                width: 95px;
            }
        
            .category-icon-circle {
                width: 65px;
                height: 65px;
                font-size: 1.5rem;
            }
        }
        
        .category-icon-circle {
            width: 80px;
            height: 80px;
            background: var(--white);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 0.75rem;
            box-shadow: var(--shadow-sm);
            border: 2px solid transparent;
            transition: var(--transition-normal);
            font-size: 2rem;
            color: var(--primary);
            overflow: hidden;
                /* Ensure images are rounded */
            }
            
            .category-icon-circle img {
                transition: transform 0.3s ease;
            }
            
            .category-item:hover .category-icon-circle img {
                transform: scale(1.1);
        }
        
        .category-item:hover .category-icon-circle {
            transform: translateY(-5px);
            box-shadow: var(--shadow-md);
            border-color: var(--primary);
            background: var(--primary);
            color: var(--white);
        }
        
        .category-item span {
            font-weight: 700;
            font-size: 0.9rem;
            color: var(--dark);
            display: block;
        }
        
        .category-item.active .category-icon-circle {
            background: var(--primary);
            color: var(--white);
            box-shadow: 0 0 0 4px rgba(27, 168, 126, 0.2);
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
        
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        
        /* Horizontal Sliders (Products & Categories) */
        .category-slider,
        .product-slider {
            display: flex;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            scroll-behavior: smooth;
            width: 100%;
        }
        
        .category-slider::-webkit-scrollbar,
        .product-slider::-webkit-scrollbar {
            display: none;
        }
        
        .category-slider {
            gap: 1.5rem;
            padding: 1rem 0.5rem;
            /* justify-content: center; */
        }
        
        .product-slider-wrapper {
            position: relative;
            padding: 0 10px;
        }
        
        .product-slider {
            gap: 1.5rem;
            padding: 1rem 0;
        }
        
        .product-slider-item {
            flex: 0 0 280px;
            /* Fixed width for 1-by-1 feel */
            min-width: 250px;
            scroll-snap-align: start;
            transition: transform 0.3s ease;
        }
        
        @media (max-width: 768px) {
            .product-slider-item {
                flex: 0 0 75%;
                /* The Peek Effect */
                max-width: 250px;
            }
        
            .product-slider {
                padding: 1rem;
                gap: 1rem;
            }
        
            .category-slider {
                justify-content: flex-start;
                /* Don't center on mobile to allow swipe */
    }
}

/* ============================================
   Section Titles
   ============================================ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

.view-more {
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.view-more:hover {
    color: var(--primary-dark);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand .logo-text {
    color: var(--primary-light);
}

.footer-title {
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-300);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

/* ============================================
   Form Controls
   ============================================ */

.form-control {
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-300);
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 168, 126, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* ============================================
   Auth Pages
   ============================================ */

.auth-wrapper {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    width: 100%;
    /* max-width: 450px; */
}

.auth-title {
    font-weight: 800;
    color: var(--dark);
    text-align: center;
    margin-bottom: 1.5rem;
}

.social-auth {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-auth .btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.btn-google {
    background: var(--white);
    border: 2px solid var(--gray-300);
    color: var(--dark);
}

.btn-google:hover {
    border-color: var(--primary);
    background: var(--gray-100);
}

.btn-facebook {
    background: #1877F2;
    border: none;
    color: var(--white);
}

.btn-facebook:hover {
    background: #166FE5;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--gray-500);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-300);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.9rem;
}

/* ============================================
   Utilities
   ============================================ */

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.badge-primary {
    background: var(--primary);
    color: var(--white);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 991px) {
    .header-search {
        display: none !important;
    }
    
    .mega-menu {
        position: static;
        box-shadow: none;
        padding: 0.5rem 1rem;
    }
    
    .mega-menu .row {
        flex-direction: column;
    }
    
    .mega-menu .col-md-3 {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--gray-100);
    }
}

/* ============================================
   Review Avatars
   ============================================ */
.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--white);
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 1.5rem;
    text-transform: uppercase;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.nav-pills .nav-link.active {
    background-color: var(--primary) !important;
    color: var(--white) !important;
    border-radius: var(--radius-md) !important;
}

/* ============================================
   About Us Section
   ============================================ */
.about-section {
    background: var(--bg-card);
}

.about-section .about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 350px;
}

.about-section .stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(27, 168, 126, 0.1);
    border-radius: var(--radius-md);
}

@media (max-width: 991px) {
    .about-section .row {
        flex-direction: column-reverse;
    }

    .about-section .about-img {
        max-height: 300px;
    }
}

.review-card {
    background: var(--bg-card);
}

/* Quill Editor Output Styles */
.ql-size-small {
    font-size: 0.75em;
}

.ql-size-large {
    font-size: 1.5em;
}

.ql-size-huge {
    font-size: 2.5em;
}

.ql-direction-rtl {
    direction: rtl;
    text-align: right;
}

.ql-align-center {
    text-align: center;
}

.ql-align-right {
    text-align: right;
}

.ql-align-justify {
    text-align: justify;
}

.ql-align-left {
    text-align: left;
}