/* =====================================================
   SHOP PATCH - CORRECTION COMPLÈTE DES CARTES PRODUITS
   ===================================================== */

/* Grille de produits - 3 colonnes fixes sur desktop */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes fixes */
    gap: 30px;
    margin-top: 30px;
}

/* Structure de la carte produit avec hauteur uniforme */
.product-card {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

/* =====================================================
   CONTENEUR D'IMAGE AVEC HAUTEUR FIXE
   ===================================================== */

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 300px; /* Hauteur fixe pour toutes les images */
    overflow: hidden;
    background: white; /* Fond blanc pour s'accorder avec les images */
    border-bottom: 1px solid #f0f0f0; /* Légère séparation */
}

.product-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.product-image-link img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Affiche l'image entière sans la couper */
    object-position: center;
    transition: transform 0.3s ease;
    background: white; /* Fond blanc si l'image ne remplit pas tout */
}

.product-card:hover .product-image-link img {
    transform: scale(1.08); /* Zoom léger pour ne pas couper l'image */
}

/* Placeholder si pas d'image */
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #999;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 14px;
    font-weight: 500;
}

/* =====================================================
   BADGES POSITIONNÉS CORRECTEMENT
   ===================================================== */

.badge {
    position: absolute;
    top: 15px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.badge-new {
    left: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.badge-sale {
    right: 15px;
    background: linear-gradient(135deg, #FF5252 0%, #f44336 100%);
    color: white;
}

/* Si les deux badges existent */
.badge-new + .badge-sale {
    top: 55px;
}

/* =====================================================
   OVERLAY APERÇU RAPIDE
   ===================================================== */

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.product-image-wrapper:hover .product-overlay {
    opacity: 1;
    pointer-events: auto;
}

.btn-quick-view {
    background: white;
    color: #333;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-quick-view:hover {
    background: var(--accent-color, #c9a961);
    color: white;
    transform: scale(1.05);
}

/* =====================================================
   INFORMATIONS PRODUIT
   ===================================================== */

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-link {
    text-decoration: none;
    color: inherit;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #333;
    line-height: 1.4;
    min-height: 44px; /* Hauteur minimale pour uniformiser */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.product-link:hover .product-title {
    color: var(--accent-color, #c9a961);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color, #333);
}

.price-old {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

/* Stock status */
.out-of-stock,
.low-stock {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: auto;
    margin-bottom: 15px;
}

.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

.low-stock {
    background: #fff3e0;
    color: #e65100;
}

/* =====================================================
   ACTIONS (BOUTONS) TOUJOURS EN BAS
   ===================================================== */

.product-actions {
    padding: 0 20px 20px;
    margin-top: auto; /* Pousse les boutons vers le bas */
}

.btn-add-cart,
.btn-notify {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-add-cart {
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    color: white;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, var(--accent-color, #c9a961) 0%, #b8994a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

.btn-add-cart:active {
    transform: translateY(0);
}

.btn-notify {
    background: #f0f0f0;
    color: #666;
}

.btn-notify:hover {
    background: #e0e0e0;
    color: #333;
}

/* =====================================================
   SIDEBAR FILTERS (Amélioration)
   ===================================================== */

.shop-sidebar {
    background: white;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.filter-section {
    margin-bottom: 35px;
}

.filter-section h3 {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color, #c9a961);
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.category-list li:hover {
    padding-left: 10px;
}

.category-list li.active {
    background: linear-gradient(to right, rgba(201, 169, 97, 0.1), transparent);
}

.category-list li.active a {
    color: var(--accent-color, #c9a961);
    font-weight: 600;
}

.category-list a {
    text-decoration: none;
    color: #333;
    flex: 1;
    transition: color 0.3s ease;
}

.category-list a:hover {
    color: var(--accent-color, #c9a961);
}

.category-list .count {
    color: #999;
    font-size: 13px;
    font-weight: 500;
}

/* Prix filter amélioration */
.btn-filter {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-color, #c9a961) 0%, #b8994a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

/* =====================================================
   TOOLBAR (Tri et résultats)
   ===================================================== */

.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.results-count {
    color: #666;
    font-weight: 500;
}

.sort-options select {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sort-options select:hover {
    border-color: var(--accent-color, #c9a961);
}

.sort-options select:focus {
    outline: none;
    border-color: var(--accent-color, #c9a961);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
}

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

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr); /* Garde 3 colonnes */
        gap: 20px;
    }
    
    .product-image-wrapper {
        height: 280px; /* Légèrement plus petit */
    }
}

@media (max-width: 992px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
    
    .shop-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* Passe à 2 colonnes */
        gap: 20px;
    }
    
    .product-image-wrapper {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .shop-toolbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* Garde 2 colonnes */
        gap: 15px;
    }
    
    .product-image-wrapper {
        height: 200px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-actions {
        padding: 0 15px 15px;
    }
    
    .product-title {
        font-size: 14px;
        min-height: 38px;
    }
    
    .price-current {
        font-size: 18px;
    }
    
    .badge {
        padding: 4px 8px;
        font-size: 10px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur mobile */
        gap: 10px;
    }
    
    .product-image-wrapper {
        height: 180px;
    }
}

@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: 1fr; /* 1 colonne sur très petit écran */
        gap: 15px;
    }
    
    .product-image-wrapper {
        height: 250px; /* Plus grand sur 1 colonne */
    }
    
    .btn-add-cart,
    .btn-notify {
        padding: 12px 15px;
        font-size: 12px;
    }
}