/* ============================================
   Homepage Components - Production Level Styling
   ============================================ */

/* Section Animations - Fade in on scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Section Base Styles */
section {
    will-change: transform, opacity;
}

/* Scroll Animation Classes */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Best Selling Products Section */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #fff;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.product-card img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.product-card:hover img {
    transform: scale(1.1);
}

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 2;
    animation: scaleIn 0.3s ease-out;
}

.product-card .btn {
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.product-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Stagger animation for product cards */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }

/* Featured Product Section */
.featured-product-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.featured-product-section img {
    transition: transform 0.5s ease;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.featured-product-section:hover img {
    transform: scale(1.05);
}

.featured-product-section .badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.featured-product-section .btn {
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 0.75rem 2rem;
}

.featured-product-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Shop by Category Section */
.category-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    position: relative;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

.category-card img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1);
}

.category-card:hover img {
    transform: scale(1.15);
    filter: brightness(1.1);
}

.category-card small {
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.category-card:hover small {
    color: #28a745 !important;
    font-weight: 700;
}

/* Stagger animation for category cards */
.category-card:nth-child(1) { animation-delay: 0.05s; }
.category-card:nth-child(2) { animation-delay: 0.1s; }
.category-card:nth-child(3) { animation-delay: 0.15s; }
.category-card:nth-child(4) { animation-delay: 0.2s; }
.category-card:nth-child(5) { animation-delay: 0.25s; }
.category-card:nth-child(6) { animation-delay: 0.3s; }
.category-card:nth-child(7) { animation-delay: 0.35s; }
.category-card:nth-child(8) { animation-delay: 0.4s; }

/* Testimonials Section */
.testimonials-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.testimonials-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(40, 167, 69, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.testimonials-section .card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    background: #fff;
    position: relative;
    z-index: 1;
}

.testimonials-section .card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.testimonials-section .card img,
.testimonials-section .card .bg-primary {
    transition: transform 0.3s ease;
}

.testimonials-section .card:hover img,
.testimonials-section .card:hover .bg-primary {
    transform: scale(1.1);
}

.testimonials-section .bi-star-fill {
    animation: twinkle 2s infinite;
}

.testimonials-section .bi-star-fill:nth-child(1) { animation-delay: 0s; }
.testimonials-section .bi-star-fill:nth-child(2) { animation-delay: 0.2s; }
.testimonials-section .bi-star-fill:nth-child(3) { animation-delay: 0.4s; }
.testimonials-section .bi-star-fill:nth-child(4) { animation-delay: 0.6s; }
.testimonials-section .bi-star-fill:nth-child(5) { animation-delay: 0.8s; }

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin: 2rem 0;
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(30px, 30px);
    }
}

.newsletter-section .container {
    position: relative;
    z-index: 1;
}

.newsletter-section h3 {
    animation: fadeInUp 0.8s ease-out;
}

.newsletter-section form {
    animation: fadeInUp 1s ease-out;
}

.newsletter-section input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.newsletter-section input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.newsletter-section .btn {
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.newsletter-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.newsletter-section img,
.newsletter-section .bi-envelope {
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Section Headers */
section h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 2px;
    animation: expandLine 0.8s ease-out;
}

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

/* View All Links - Add arrow via CSS (only for View All links, not product links) */
.view-all,
.view-all-link,
section .section-header a[href="/Products"],
section .section-header a[href*="/Categories"] {
    transition: all 0.3s ease;
    position: relative;
    padding-right: 1.5rem;
    display: inline-block;
}

.view-all::after,
.view-all-link::after,
section .section-header a[href="/Products"]::after,
section .section-header a[href*="/Categories"]::after {
    content: '→';
    position: absolute;
    right: 0;
    transition: transform 0.3s ease;
}

.view-all:hover::after,
.view-all-link:hover::after,
section .section-header a[href="/Products"]:hover::after,
section .section-header a[href*="/Categories"]:hover::after {
    transform: translateX(5px);
}

.view-all:hover,
.view-all-link:hover,
section .section-header a[href="/Products"]:hover,
section .section-header a[href*="/Categories"]:hover {
    transform: translateX(-3px);
}

/* Ensure product card links NEVER show arrows */
.product-card a::after,
.product-card a::before,
.card a::after,
.card a::before,
.product-image-wrapper a::after,
.product-image-wrapper a::before,
.card-img-wrapper a::after,
.card-img-wrapper a::before {
    content: none !important;
    display: none !important;
}

/* Hide any icons that might be in View All links (shouldn't be any after cleanup) */
.view-all i,
.view-all .bi {
    display: none !important;
}

/* Exclusive Offers Section */
.exclusive-offer-section .product-card {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #ff6b35, #f7931e) border-box;
}

.exclusive-offer-section .product-card:hover {
    border-color: #ff6b35;
}

/* Promotional Banner Section */
.promotional-banner {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.promotional-banner:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.promotional-banner img,
.promotional-banner .bi-bag {
    transition: transform 0.3s ease;
}

.promotional-banner:hover img,
.promotional-banner:hover .bi-bag {
    transform: scale(1.1) rotate(5deg);
}

.promotional-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* About Section */
.about-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 3rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-card:hover {
        transform: translateY(-4px);
    }
    
    .category-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    section h2::after {
        width: 40px;
    }
}

/* Performance Optimizations */
.product-card,
.category-card,
.testimonials-section .card {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Loading States */
.product-card img,
.category-card img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.product-card img[src],
.category-card img[src] {
    animation: none;
    background: none;
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

