/**
 * Custom Product Cards CSS
 * Design moderne et épuré pour les miniatures produit
 */

/* ========================================
   GRILLE PRODUITS - FORCER L'AFFICHAGE
======================================== */

/* Forcer l'affichage en grille pour toutes les listes de produits */
.products,
.featured-products .products,
.product-accessories .products,
.product-miniature-container,
#products .products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 20px !important;
}

/* Article produit : ne pas prendre 100% de largeur */
.products article.product-miniature,
.featured-products article.product-miniature,
.product-accessories article.product-miniature,
#products article.product-miniature {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
}

/* ========================================
   STRUCTURE CARTE PRODUIT
======================================== */

.custom-product-card {
    width: 100%;
    height: 480px; /* Hauteur fixe */
}

.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* ========================================
   IMAGE & OVERLAY
======================================== */

.product-image-container {
    position: relative;
    width: 100%;
    height: 280px; /* Hauteur fixe pour l'image */
    overflow: hidden;
    background: #f8f8f8;
    flex-shrink: 0;
}

.product-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

/* Overlay supprimé - pas d'aperçu rapide */

/* ========================================
   BADGES
======================================== */

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 3;
}

.product-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-new {
    background: #4CAF50;
    color: #ffffff;
}

.badge-on-sale {
    background: #FF9800;
    color: #ffffff;
}

.badge-discount {
    background: #F44336;
    color: #ffffff;
}

.badge-online-only {
    background: #2196F3;
    color: #ffffff;
}

.badge-pack {
    background: #9C27B0;
    color: #ffffff;
}

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

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    height: 220px; /* Augmenté pour faire de la place pour la référence */
    overflow: hidden;
}

/* Titre */
.product-title {
    margin: 0;
    font-size: 16px; /* Augmenté de 14px à 16px */
    font-weight: 700; /* Plus gras : 600 → 700 */
    line-height: 1.4;
    height: 45px; /* Augmenté pour 2 lignes plus grandes */
    overflow: hidden;
}

.product-title a {
    color: #1a1a1a; /* Plus foncé pour meilleur contraste */
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a:hover {
    color: var(--primary-color, #002B6D);
}

/* Référence produit */
.product-reference {
    font-size: 13px;
    color: #555555;
    margin-top: 6px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-reference .reference-label {
    font-weight: 600;
    color: #777777;
    margin-right: 4px;
}

.product-reference .reference-value {
    color: #222222;
    font-weight: 700; /* Gras */
    letter-spacing: 0.3px;
}

/* Prix */
.product-price-block {
    margin-top: auto;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.price-current.price-only {
    font-size: 22px;
}

.price-regular {
    font-size: 16px;
    font-weight: 500;
    color: #999999;
    text-decoration: line-through;
}

/* ========================================
   BOUTON AJOUTER AU PANIER
======================================== */

.product-actions {
    margin-top: 12px;
}

.add-to-cart-form {
    width: 100%;
}

.btn-add-to-cart {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent-color, #FD9F1A);
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: var(--primary-color, #002B6D);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 159, 26, 0.3);
}

.btn-add-to-cart:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-add-to-cart .material-icons {
    font-size: 16px;
}

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

/* Tablet */
@media (max-width: 991px) {
    /* Grille responsive tablet */
    .products,
    .featured-products .products,
    .product-accessories .products,
    .product-miniature-container,
    #products .products {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 15px !important;
    }

    .custom-product-card {
        height: 450px; /* Hauteur réduite pour tablet */
    }

    .product-image-container {
        height: 260px;
    }

    .product-info {
        padding: 14px;
        gap: 8px;
        height: 210px;
    }

    .product-title {
        font-size: 15px;
        height: 42px;
    }

    .price-current {
        font-size: 20px;
    }

    .price-regular {
        font-size: 14px;
    }

    .btn-add-to-cart {
        padding: 10px 14px;
        font-size: 10px;
    }

    .product-badge {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    /* Grille responsive mobile */
    .products,
    .featured-products .products,
    .product-accessories .products,
    .product-miniature-container,
    #products .products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 12px !important;
    }

    .custom-product-card {
        height: 380px; /* Hauteur réduite pour mobile */
    }

    .product-image-container {
        height: 220px;
    }

    .product-info {
        padding: 12px;
        gap: 6px;
        height: 180px;
    }

    .product-title {
        font-size: 14px;
        height: 40px;
    }
    
    .product-reference {
        font-size: 11px;
    }

    .price-current {
        font-size: 18px;
    }

    .price-current.price-only {
        font-size: 16px;
    }

    .price-regular {
        font-size: 13px;
    }

    .btn-add-to-cart {
        padding: 9px 12px;
        font-size: 9px;
    }

    .product-badges {
        top: 8px;
        left: 8px;
        gap: 4px;
    }

    .product-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Très petit mobile */
@media (max-width: 480px) {
    /* Grille responsive très petit mobile */
    .products,
    .featured-products .products,
    .product-accessories .products,
    .product-miniature-container,
    #products .products {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 10px !important;
    }

    .custom-product-card {
        height: 360px;
    }

    .product-image-container {
        height: 200px;
    }

    .product-info {
        height: 180px;
    }

    .product-title {
        font-size: 13px;
        height: 38px;
    }
    
    .product-reference {
        font-size: 10px;
    }

    .price-current {
        font-size: 16px;
    }

    .price-regular {
        font-size: 12px;
    }

    .btn-add-to-cart {
        padding: 8px 10px;
    }
}

/* ========================================
   ANIMATIONS & TRANSITIONS
======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-product-card {
    animation: fadeInUp 0.5s ease;
}

/* Animation au chargement progressif */
.custom-product-card:nth-child(1) { animation-delay: 0s; }
.custom-product-card:nth-child(2) { animation-delay: 0.1s; }
.custom-product-card:nth-child(3) { animation-delay: 0.2s; }
.custom-product-card:nth-child(4) { animation-delay: 0.3s; }
.custom-product-card:nth-child(5) { animation-delay: 0.4s; }
.custom-product-card:nth-child(6) { animation-delay: 0.5s; }
.custom-product-card:nth-child(7) { animation-delay: 0.6s; }
.custom-product-card:nth-child(8) { animation-delay: 0.7s; }
