/* Products Page Specific Styles */

/* Products Hero Section */
.products-hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d4a574 0%, var(--primary-green) 100%);
    overflow: hidden;
    padding: 120px 0 80px;
}

.products-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.85) 0%, rgba(212, 165, 116, 0.7) 100%);
    z-index: 1;
}

.products-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    max-width: 900px;
    margin: 0 auto;
}

.products-hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.products-hero-content p {
    font-size: 1.25rem;
    line-height: 1.8;
    opacity: 0.95;
}

/* Categories Section */
.categories {
    padding: 100px 0;
    background: var(--white);
}

.category-section {
    margin-bottom: 80px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 2.5rem;
    color: var(--primary-green);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
}

.category-description {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--gray);
    text-align: center;
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

/* Product Gallery Grid */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(27, 67, 50, 0.2);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.9) 0%, rgba(212, 165, 116, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-view-btn {
    background: var(--white);
    color: var(--primary-green);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
}

.product-card:hover .product-view-btn {
    transform: translateY(0);
}

.product-view-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.product-view-btn svg {
    width: 28px;
    height: 28px;
}

/* ============================
   Responsive Design - Mobile First Approach
   ============================ */

/* Tablet & Small Desktop (992px and below) */
@media (max-width: 992px) {
    /* Container adjustments */
    .container {
        padding: 0 30px;
    }

    /* Products Hero */
    .products-hero {
        height: 60vh;
        min-height: 450px;
    }

    .products-hero-content h1 {
        font-size: 2.8rem;
        line-height: 1.2;
    }

    .products-hero-content p {
        font-size: 1.2rem;
    }

    /* Product Gallery */
    .product-gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }

    /* Category Title */
    .category-title {
        font-size: 2rem;
    }

    /* Category Sections */
    .category-section {
        margin-bottom: 70px;
    }
}

/* Tablet & Mobile (768px and below) */
@media (max-width: 768px) {
    /* Base adjustments */
    .container {
        padding: 0 20px;
    }

    /* Typography */
    h2 {
        font-size: 2.2rem;
    }

    /* Products Hero */
    .products-hero {
        padding: 100px 0 60px;
        min-height: 55vh;
        height: 55vh;
    }

    .products-hero-content {
        padding: 0 20px;
    }

    .products-hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }

    .products-hero-content p {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* Categories Section */
    .categories {
        padding: 60px 0;
    }

    /* Category Sections */
    .category-section {
        margin-bottom: 60px;
        padding: 0;
    }

    /* Category Title & Description */
    .category-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .category-description {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 25px;
    }

    /* Product Gallery */
    .product-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Product Cards */
    .product-card {
        border-radius: 15px;
    }

    .product-image {
        height: 300px;
    }

    .product-overlay {
        padding: 20px;
    }

    .product-view-btn {
        width: 50px;
        height: 50px;
    }

    .product-view-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Typography */
    h2 {
        font-size: 1.8rem;
    }

    /* Products Hero */
    .products-hero {
        height: 50vh;
        min-height: 350px;
        padding: 80px 0 50px;
    }

    .products-hero-content {
        padding: 0 15px;
    }

    .products-hero-content h1 {
        font-size: 1.75rem;
        margin-bottom: 15px;
        line-height: 1.3;
    }

    .products-hero-content p {
        font-size: 0.95rem;
        margin-bottom: 25px;
        line-height: 1.6;
    }

    /* Categories Section */
    .categories {
        padding: 50px 0;
    }

    /* Category Sections */
    .category-section {
        margin-bottom: 50px;
    }

    /* Category Title & Description */
    .category-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .category-description {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    /* Product Gallery */
    .product-gallery {
        gap: 15px;
    }

    /* Product Cards */
    .product-card {
        border-radius: 12px;
    }

    .product-image {
        height: 250px;
    }

    .product-overlay {
        padding: 15px;
    }

    .product-view-btn {
        width: 44px;
        height: 44px;
    }

    .product-view-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .products-hero-content h1 {
        font-size: 1.5rem;
    }

    .category-title {
        font-size: 1.4rem;
    }

    .product-image {
        height: 220px;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .products-hero {
        height: 100vh;
        min-height: 100vh;
    }

    .products-hero-content h1 {
        font-size: 2rem;
    }

    .product-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .product-card,
    .product-view-btn {
        min-height: 44px;
    }

    .product-view-btn {
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .product-card:hover {
        transform: none;
    }

    .product-card:hover .product-overlay {
        opacity: 0;
    }

    /* Show overlay on tap */
    .product-card:active .product-overlay {
        opacity: 1;
    }

    /* Faster transitions */
    * {
        transition-duration: 0.2s;
    }
}

/* Performance Optimizations */
@media (max-width: 768px) {
    /* Disable fixed backgrounds on mobile */
    .products-hero {
        background-attachment: scroll;
    }

    /* Optimize animations */
    .product-card,
    .product-overlay {
        will-change: transform, opacity;
        transform: translateZ(0);
        backface-visibility: hidden;
    }

    /* Optimize images */
    .product-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }

    /* Smooth scrolling */
    .product-gallery {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Better font rendering */
    body {
        text-rendering: optimizeSpeed;
        -webkit-font-smoothing: antialiased;
    }

    /* Prevent text size adjustment */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }

    /* Remove tap highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Reduce motion if preferred */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-overlay,
    .product-view-btn {
        transition: none;
        animation: none;
    }
}

/* Safe Area Support for Notched Devices */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .container {
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
        }
    }

    @media (max-width: 480px) {
        .container {
            padding-left: max(15px, env(safe-area-inset-left));
            padding-right: max(15px, env(safe-area-inset-right));
        }
    }
}

/* Mobile-Specific Enhancements */
@media (max-width: 768px) {
    /* Optimize category sections spacing */
    .category-section:first-of-type {
        margin-top: 0;
    }

    .category-section:last-of-type {
        margin-bottom: 0;
    }

    /* Improve product card spacing */
    .product-card:last-child {
        margin-bottom: 0;
    }
}
