/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

/* ===== PRODUCTS PAGE STYLES ===== */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, sans-serif;
    line-height: 1.4;
    color: black;
    overflow-x: hidden;
    width: 100%;
}

/* Main products container */
.products-main-content {
    background-color: #f1f4f5;
    width: 100%;
    max-width: 100%;
    padding: 0 0 60px 0;
    overflow-x: hidden;
}

/* Page title */
.products-page-title {
    font-size: 2.5rem;
    color: black;
    text-align: center;
    margin: 80px 0 60px 0;
    position: relative;
    font-weight: 700;
}

/* Content wrapper */
.products-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Products grid */
.products-container {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Product item */
.product-item {
    flex: 0 0 calc(33.333% - 20px);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    min-height: 500px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

/* Image container */
.product-image-container {
    height: auto;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 3px 3px 0 0;
}

.product-image-container img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 3px;
}

/* Desktop product text content */
.product-text {
    padding: 15px 20px 30px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    min-height: 200px;
}

.product-title {
    font-size: 1.1rem;
    color: black;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: left;
    width: 100%;
}

.product-description {
    font-size: 0.9rem;
    color: grey;
    line-height: 1.4;
    margin-bottom: 15px;
    text-align: left;
    width: 100%;
    flex-grow: 0;
}

/* Desktop button */
.read-more-btn {
    display: inline-block;
    color: black;
    background-color: transparent;
    padding: 8px 25px;
    text-decoration: none;
    border-radius: 30px;
    border: 2px solid #0c8cc4;
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    align-self: flex-start;
    margin-top: auto;
}

.read-more-btn:hover {
    background-color: #0c8cc4;
    color: white;
    border-color: #0c8cc4;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .product-item {
        flex: 0 0 calc(50% - 15px);
        min-height: 470px;
    }
    
    .products-page-title {
        font-size: 2rem;
        margin: 60px 0 50px 0;
    }
    
    .product-image-container {
        height: 180px;
        padding: 15px;
    }
    
    .product-text {
        padding: 15px 20px 20px 20px;
        align-items: center;
        text-align: center;
        flex-grow: 1;
    }
    
    .product-title {
        text-align: center;
        margin-bottom: 12px;
    }
    
    .product-description {
        text-align: center;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    .read-more-btn {
        align-self: center;
        margin-top: auto;
        margin-bottom: 10px;
    }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
    .products-main-content {
        padding: 0 0 40px 0;
    }
    
    .products-page-title {
        font-size: 1.8rem;
        margin: 40px 0 40px 0;
    }
    
    .products-content-wrapper {
        padding: 0 15px;
    }
    
    .product-item {
        flex: 0 0 100%;
        min-height: 450px;
    }
    
    .products-container {
        gap: 25px;
    }
    
    /* Mobile: Make product image larger and more prominent */
    .product-image-container {
        height: auto; /* Remove fixed height for better responsiveness */
        padding: 40px 10px 20px 10px; 
        width: 100%;
    }
    
    .product-image-container img {
        width: auto; /* Keep natural image proportions */
        max-width: 90%; /* Allow image to be wider but maintain quality */
        max-height: 200px; /* Add max-height to prevent excessive stretching */
        height: auto;
    }
    
    .product-text {
        padding: 20px 25px 25px 25px;
        align-items: center;
        text-align: center;
        flex-grow: 1;
    }
    
    .product-title {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .product-description {
        font-size: 0.95rem;
        margin-bottom: 15px;
        text-align: center;
        line-height: 1.5;
    }
    
    .read-more-btn {
        padding: 10px 30px;
        font-size: 1rem;
        align-self: center;
        margin-top: auto;
        margin-bottom: 10px;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .products-page-title {
        font-size: 1.6rem;
        margin: 30px 0 30px 0;
    }
    
    .product-item {
        min-height: 420px;
    }
    
    /* Small mobile: Maintain consistent padding with desktop */
    .product-image-container {
        height: auto;
        padding: 30px 5px 15px 5px;
    }
    
    .product-image-container img {
        width: auto; /* Maintain aspect ratio */
        max-width: 85%; /* Slightly smaller to prevent blurriness */
        max-height: 180px; /* Control height to maintain quality */
    }
    
    .product-text {
        padding: 18px 20px 20px 20px;
        flex-grow: 1;
    }
    
    .product-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .product-description {
        font-size: 0.9rem;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    .read-more-btn {
        padding: 8px 25px;
        font-size: 0.95rem;
        margin-top: auto;
        margin-bottom: 8px;
    }
}

/* Landscape phones */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    .products-page-title {
        margin: 20px 0 18px 0;
    }
    
    .product-item {
        min-height: 320px; /* Reduced height for landscape */
    }
    
    /* Landscape mode: Prevent image from becoming too large and blurry */
    .product-image-container {
        height: auto;
        padding: 25px 20px; 
    }
    
    .product-image-container img {
        width: auto; /* Keep natural proportions */
        max-width: 80%; /* Reduced to prevent blurriness */
        max-height: 150px; /* Fixed max-height to maintain quality */
    }
    
    .product-text {
        padding: 12px 15px 15px 15px;
        flex-grow: 1;
        min-height: 180px; 
        display: flex;
        flex-direction: column;
    }
    
    .product-title {
        margin-bottom: 8px;
        font-size: 1rem;
    }
    
    .product-description {
        margin-bottom: 5px; 
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .read-more-btn {
        padding: 6px 20px;
        font-size: 0.85rem;
        margin-top: auto; 
        margin-bottom: 8px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .product-item {
        transition: none;
    }
    
    .product-item:hover {
        transform: none;
    }
}

/* ===== SCROLL ANIMATION ===== */
.products-fade-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.products-fade-animation.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PRODUCTS PAGE FOOTER FIX ===== */
body.products-page {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

.products-main-content {
    flex: 1 0 auto !important;
    background-color: #f1f4f5;
    width: 100%;
    max-width: 100%;
    padding: 0 0 60px 0;
    overflow-x: hidden;
}

.products-container {
    min-height: 50vh;
}

@media (max-width: 768px) {
    .products-container {
        min-height: 60vh;
    }
}