/**
 * Styles additionnels pour la page d'accueil
 * 
 * @package Superette_Romain
 */

/* ===================================
   GRILLE PRODUITS RESPONSIVE
   =================================== */
.produits-grid {
    width: 100% !important;
    box-sizing: border-box !important;
}

.produits-grid ul.products,
.produits-grid > ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.produits-grid ul.products li.product,
.produits-grid > ul.products > li.product {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    display: block !important;
}

/* Tablette : 3 produits */
@media (max-width: 1024px) {
    .produits-grid ul.products,
    .produits-grid > ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
}

/* Mobile : 2 produits */
@media (max-width: 767px) {
    .produits-grid ul.products,
    .produits-grid > ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Petit mobile : 2 produits */
@media (max-width: 480px) {
    .produits-grid ul.products,
    .produits-grid > ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

/* ===================================
   HERO SECTION STYLING
   =================================== */
.hero-section {
    position: relative;
    overflow: hidden;
    background: url('../images/hero-bg.png') center/cover no-repeat;
    background-attachment: fixed;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(46, 204, 112, 0.137), rgba(39, 174, 95, 0.174));
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* ===================================
   SECTION TITLES
   =================================== */
.section-title {
    font-size: 32px;
    text-align: center;
    margin-bottom: 40px;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

/* ===================================
   CATEGORIES GRID
   =================================== */
.product-categories-section {
    padding: 50px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.category-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card h3 {
    font-size: 20px;
    padding: 20px 15px 10px;
    color: var(--dark-color);
}

.category-card .product-count {
    display: block;
    padding-bottom: 20px;
    color: #666;
    font-size: 14px;
}

/* ===================================
   FEATURED PRODUCTS SECTION
   =================================== */
.featured-products-section,
.new-products-section,
.sale-products-section {
    padding: 50px 0;
    background: var(--white);
    width: 100%;
    box-sizing: border-box;
}

.new-products-section {
    background: #f8f9fa;
}

/* Wrapper pour forcer la grille */
.products-grid-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.products-grid-wrapper ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 30px !important;
    width: 100% !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Neutraliser les largeurs forcées */
.products-grid-wrapper ul.products li.product {
    width: auto !important;
    flex: none !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
}

/* Tablette */
@media (max-width: 1024px) {
    .products-grid-wrapper ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .products-grid-wrapper ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Forcer l'affichage responsive des produits WooCommerce */
.featured-products-section ul.products,
.new-products-section ul.products,
.sale-products-section ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    gap: 30px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.featured-products-section ul.products li.product,
.new-products-section ul.products li.product,
.sale-products-section ul.products li.product {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    grid-column: auto !important;
    grid-row: auto !important;
}

.featured-products-section ul.products li.product.first,
.featured-products-section ul.products li.product.last,
.new-products-section ul.products li.product.first,
.new-products-section ul.products li.product.last,
.sale-products-section ul.products li.product.first,
.sale-products-section ul.products li.product.last {
    clear: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ===================================
   WHY CHOOSE US SECTION
   =================================== */
.why-choose-us {
    padding: 60px 0;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 50px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* ===================================
   BLOG SECTION
   =================================== */
.blog-section {
    padding: 50px 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.blog-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.blog-thumbnail {
    overflow: hidden;
}

.blog-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-thumbnail img {
    transform: scale(1.1);
}

.blog-content {
    padding: 25px;
}

.blog-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.blog-content h3 a {
    color: var(--dark-color);
    transition: color 0.3s ease;
}

.blog-content h3 a:hover {
    color: var(--primary-color);
}

.blog-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.blog-meta i {
    margin-right: 5px;
}

.blog-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
    gap: 10px;
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.animated {
    animation: fadeInUp 0.6s ease forwards;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1024px) {
    .features-grid,
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hero-section {
        padding: 40px 0;
        background-attachment: scroll; /* Désactiver parallax sur mobile/tablette */
    }
    
    .hero-section h1 {
        font-size: 32px;
        text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.95);
    }
    
    .hero-section p {
        font-size: 18px;
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    }
    
    .btn-hero {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    .feature-icon {
        font-size: 40px;
    }
    
    .category-card h3 {
        font-size: 18px;
    }
    
    .product-categories-section,
    .featured-products-section,
    .new-products-section,
    .sale-products-section,
    .why-choose-us,
    .blog-section {
        padding: 30px 0;
    }
}

@media (max-width: 575px) {
    .hero-section {
        padding: 30px 0;
        background-attachment: scroll;
        min-height: 300px;
    }
    
    .hero-section h1 {
        font-size: 24px;
        margin-bottom: 15px;
        text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.95);
    }
    
    .hero-section p {
        font-size: 16px;
        margin-bottom: 20px;
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    }
    
    .btn-hero {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .section-title::after {
        width: 40px;
        height: 2px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-card h3 {
        font-size: 18px;
    }
    
    .feature-icon {
        font-size: 35px;
        margin-bottom: 15px;
    }
    
    .category-card img {
        height: 150px;
    }
    
    .blog-card {
        margin-bottom: 15px;
    }
    
    .blog-content {
        padding: 20px;
    }
    
    .blog-content h3 {
        font-size: 18px;
    }
}
