/* ====================================
   HOMEPAGE PROFESSIONAL UI/UX ENHANCEMENTS
   ==================================== */

/* Modern Section Spacing & Layout */
section {
    position: relative;
    overflow: hidden;
}

/* Enhanced Container Widths */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Professional Section Headers */
.section-header {
    margin-bottom: 50px;
    text-align: center;
}

.section-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Enhanced Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 50%, #f1f5f9 100%);
    padding: 0px 0 80px;
    position: relative;
    min-height: 600px;
}

/* Top categories strip */
.home-top-categories {
    background: linear-gradient(180deg, #f3f6ff, #0350e8eb);
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
    padding: 20px 0 10px;
}

.top-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.top-category-card {
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 14px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #0f172a;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.top-category-card:hover {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.18);
    transform: translateY(-4px);
}

.top-category-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.top-category-name {
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    color: #0f172a;
}

@media (max-width: 576px) {
    .home-top-categories {
        padding: 16px 0 6px;
    }

    .top-categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .top-category-card {
        padding: 12px 6px;
    }

    .top-category-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }

    .top-category-name {
        font-size: 0.85rem;
    }
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

/* Animated Background Shapes */
.hero-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    bottom: -50px;
    left: -50px;
    animation-delay: 5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Hero Content Enhancement */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-content h1 span {
    -webkit-background-clip: text;
    -webkit-text-fill-color: #fff9f9;
    background-clip: text;
}

.hero-content p {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: #475569;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Enhanced Search Bar */
.hero-search {
    max-width: 800px;
    margin: 0 auto 30px;
    position: relative;
}

.hero-search .search-container {
    background: #ffffff;
    border-radius: 60px;
    padding: 8px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-search .search-container:hover {
    box-shadow:
        0 20px 60px rgba(59, 130, 246, 0.15),
        0 4px 15px rgba(59, 130, 246, 0.08);
    transform: translateY(-2px);
}

/* Professional Stats Section */
.stats-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.stats-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.stat-icon {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Enhanced Categories Section */
.categories-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.category-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.category-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #06b6d4);
    transform: scaleY(0);
    transition: transform 0.4s ease;
}

.category-box:hover {
    transform: translateX(8px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

.category-box:hover::before {
    transform: scaleY(1);
}

.category-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #3b82f6;
    transition: all 0.3s ease;
}

.category-box:hover .category-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    transform: scale(1.1) rotate(-5deg);
}

/* Enhanced Product Cards */
.product-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 50px rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Section Dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 60px auto;
    max-width: 800px;
}

.section-divider.gradient {
    display: block !important;
    height: 4px !important;
    background: #3b82f6 !important;
    /* Fallback solid color */
    background: linear-gradient(90deg, rgba(59, 130, 246, 0) 0%, rgba(59, 130, 246, 1) 50%, rgba(59, 130, 246, 0) 100%) !important;
    opacity: 1 !important;
    border-radius: 100px;
    margin: 60px auto !important;
    width: 100% !important;
    max-width: 800px !important;
    border: none !important;
    position: relative;
    z-index: 10;
}

/* Fade-in Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0 60px;
        min-height: 500px;
    }

    .stats-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .section-header {
        margin-bottom: 35px;
    }
}

/* Ultra-small devices refinements */
@media (max-width: 576px) {
    .container {
        padding: 0 12px;
    }

    .hero-section {
        padding: 60px 0 40px;
        min-height: 440px;
    }

    .hero-content p {
        margin-bottom: 24px;
        max-width: 92%;
    }

    /* Ensure hero badges wrap nicely on small screens */
    .hero-features {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 12px;
        padding: 0 6px;
    }

    .hero-features .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(6px);
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .hero-section {
        min-height: 400px;
        padding: 48px 0 32px;
    }

    .hero-content h1 {
        letter-spacing: -0.01em;
    }

    .hero-features .hero-badge {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}

/* Loading State Enhancements */
.loading-shimmer {
    background: linear-gradient(90deg,
            #f1f5f9 0%,
            #e2e8f0 50%,
            #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Professional Typography */
* {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1e293b;
    line-height: 1.6;
}

/* Enhanced Focus States */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 4px;
}

/* Subtle Glass Morphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Professional Shadows */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.shadow-md {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.shadow-xl {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Professional Spacing System */
.spacing-xs {
    padding: 20px 0;
}

.spacing-sm {
    padding: 40px 0;
}

.spacing-md {
    padding: 60px 0;
}

.spacing-lg {
    padding: 80px 0;
}

.spacing-xl {
    padding: 120px 0;
}


.category-icon-home {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}