/* Homepage Enhancements - Stats, Category Showcase, Improved Spacing */

/* ========== Stats Section ========== */
.stats-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.stat-card {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== Category Showcase ========== */
.category-showcase {
    padding: 25px 0;
    background: #f9fafb;
    position: relative;
}

.category-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    /* Add padding for the buttons so they don't overlap cards or fall off screen */
    padding: 0 60px;
}

.category-grid {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 20px;
    /* Space for scrollbar if visible, or just breathing room */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */

    /* Gradient mask removed to ensure last card is fully visible */
    /* mask-image: linear-gradient(to right, black 95%, transparent 100%); */
    /* -webkit-mask-image: linear-gradient(to right, black 95%, transparent 100%); */

    padding-right: 20px;
}

.category-grid::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

.category-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e5e7eb;

    /* Flex sizing for horizontal scroll */
    flex: 0 0 auto;
    /* Desktop: 8.5 cards visible */
    width: calc((100% - (8 * 16px)) / 8.5);
    scroll-snap-align: start;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

.category-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-bg-image {
    transform: scale(1.05);
}

.category-overlay {
    display: none;
}

.category-icon {
    font-size: 48px;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-title {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    padding: 12px 10px;
    color: #1f2937;
    text-align: center;
    background: white;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation Buttons */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
}

.category-wrapper:hover .scroll-btn {
    opacity: 1;
    visibility: visible;
}

.scroll-btn:hover {
    background: #f3f4f6;
    transform: translateY(-50%) scale(1.1);
}

/* Position buttons inside the padding area */
.scroll-btn.left {
    left: 10px;
}

.scroll-btn.right {
    right: 10px;
}

/* Responsive Sizing */
@media (max-width: 1200px) {
    .category-card {
        /* Tablet Landscape: 5.5 cards */
        width: calc((100% - (5 * 16px)) / 5.5);
    }
}

@media (max-width: 768px) {
    .category-wrapper {
        padding: 0 16px;
        /* Remove button padding on mobile */
    }

    .category-card {
        /* Tablet Portrait: 4.5 cards */
        width: calc((100% - (4 * 16px)) / 4.5);
    }

    .scroll-btn {
        display: none;
        /* Hide buttons on touch devices */
    }
}

@media (max-width: 480px) {
    .category-card {
        /* Mobile: 2.5 cards */
        width: calc((100% - (2 * 16px)) / 2.5);
    }

    .category-title {
        font-size: 13px;
        padding: 8px;
    }

    .category-icon {
        font-size: 32px;
    }
}

/* ========== Improved Section Spacing ========== */
.featured-preview {
    padding: 25px 0;
    background: white;
}

.bestsellers-preview {
    padding: 25px 0;
    background: #f9fafb;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 42px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: #1f2937;
    margin-bottom: 16px;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 18px;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Section CTA removed - using original styles */

/* ========== Hero Section Enhancements ========== */
.hero-section {
    padding: 50px 0 0px;
    background: white;
}

.hero-content h1 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-content p {
    font-size: 20px;
    line-height: 1.6;
    margin-bottom: 40px;
}

/* ========== Responsive Design ========== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-section {
        padding: 60px 0;
    }

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

    .stat-number {
        font-size: 36px;
    }

    .stat-label {
        font-size: 14px;
    }

    .category-showcase {
        padding: 25px 0;
    }

    /* Responsive Category Grid */
    .category-grid {
        /* Reset grid styles if any leak through */
        display: flex;
        overflow-x: auto;
    }

    .section-title {
        font-size: 32px;
    }

    .section-subtitle {
        font-size: 16px;
    }

    .featured-preview,
    .bestsellers-preview {
        padding: 25px 0;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px 15px;
    }
}

/* ========== Animation Enhancements ========== */
[data-aos] {
    pointer-events: auto;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.fade-in-delay {
    animation-delay: 0.3s;
}

/* ========== Genres Section Improvements ========== */
.genres-section {
    padding: 80px 0;
    background: white;
}

.genre-chip {
    transition: all 0.3s ease;
}

.genre-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}