/* Styles pour la transformation des cartes produits avec effet d'expansion */

/* Classe pour les grilles avec transformation */
.transform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    align-items: start;
}

.product-card-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 380px; /* Hauteur initiale compacte */
    perspective: 1200px;
    margin-bottom: 30px;
    border-radius: 16px;
    overflow: visible !important;
    transform-style: preserve-3d;
    transition: min-height 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hauteur ÉTENDUE pour afficher TOUT le contenu */
.product-card-wrapper:hover {
    min-height: 620px !important; /* HAUTEUR AUGMENTÉE pour tout afficher */
}

.product-card-simple,
.product-card-premium {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    backface-visibility: hidden;
    box-sizing: border-box;
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Version simple - compacte */
.product-card-simple {
    opacity: 1;
    transform: translateZ(0) rotateY(0deg) scale(1);
    z-index: 2;
    height: 380px; /* Hauteur compacte fixe */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    background: white;
    border: 1px solid #eee;
}

/* Version premium - HAUTEUR AUGMENTÉE pour tout afficher */
.product-card-premium {
    opacity: 0;
    transform: translateZ(-30px) rotateY(180deg) scale(0.95);
    z-index: 1;
    height: 620px !important; /* HAUTEUR AUGMENTÉE */
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #f39c12;
    box-shadow: 0 10px 40px rgba(243, 156, 18, 0.15);
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

/* Effet au survol */
.product-card-wrapper:hover .product-card-simple {
    opacity: 0;
    transform: translateZ(-30px) rotateY(-180deg) scale(0.95);
    pointer-events: none;
}

.product-card-wrapper:hover .product-card-premium {
    opacity: 1;
    transform: translateZ(0) rotateY(0deg) scale(1);
    pointer-events: auto;
    z-index: 10;
}

/* =========== STYLE PREMIUM COMPLET - Ajusté pour la nouvelle hauteur =========== */

/* Image container premium */
.product-card-premium .product-image-container.premium {
    position: relative;
    height: 220px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

/* Content premium avec hauteur ajustée */
.product-card-premium .product-content.premium {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-height: 400px; /* Hauteur minimale pour le contenu */
}

/* Ajustements pour TOUT le contenu soit visible */
.product-card-premium .product-header {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.product-card-premium .product-title.premium {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 50px;
}

.product-card-premium .product-price.premium {
    margin: 15px 0;
    flex-shrink: 0;
}

/* Countdown - bien visible */
.product-card-premium .promo-countdown.premium {
    background: linear-gradient(135deg, #ff6b6b 0%, #e74c3c 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    text-align: center;
    flex-shrink: 0;
}

/* Description avec hauteur fixe pour éviter l'écrasement */
.product-card-premium .product-description.premium {
    color: #34495e;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 15px 0;
    flex: 1;
    min-height: 80px;
    max-height: 120px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    padding-top: 15px;
    flex-shrink: 0;
}

/* Actions premium TOUJOURS visibles en bas */
.product-card-premium .product-actions.premium {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    min-height: 120px; /* Garantit que les boutons sont visibles */
}

/* Boutons bien espacés */
.product-card-premium .action-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.product-card-premium .btn-premium {
    flex-grow: 1;
    background: linear-gradient(135deg, rgb(147, 112, 44) 0%, #93702c 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    min-height: 50px;
}

/* Stock info visible */
.product-card-premium .stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 10px;
    flex-shrink: 0;
}

/* =========== VERSION SIMPLE ULTRA COMPACTE =========== */

.product-card-simple .product-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f9f9f9;
}

.product-card-simple .product-info {
    padding: 20px;
    height: 160px; /* Hauteur restante après l'image */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
}

.product-card-simple h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
    min-height: 40px;
    max-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-simple .product-price-container {
    margin: 10px 0;
    flex-shrink: 0;
}

.product-card-simple .price-current {
    font-size: 1.4rem;
    color: #e74c3c;
    font-weight: 600;
}

.product-card-simple .btn-view {
    display: inline-block;
    padding: 10px 15px;
    background: transparent;
    color: #93702c;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgb(147, 112, 44);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: auto;
    margin-bottom: 5px;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Animation d'entrée */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.product-card-wrapper {
    animation: cardEntrance 0.6s ease-out forwards;
    animation-delay: calc(var(--card-index, 0) * 0.08s);
}

/* Responsive avec nouvelles hauteurs */
@media (max-width: 1024px) {
    .transform-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .product-card-wrapper {
        min-height: 360px;
    }
    
    .product-card-wrapper:hover {
        min-height: 580px !important;
    }
    
    .product-card-simple {
        height: 360px;
    }
    
    .product-card-premium {
        height: 580px !important;
    }
}

@media (max-width: 768px) {
    .product-card-wrapper {
        min-height: 340px;
    }
    
    .product-card-wrapper:hover {
        min-height: 550px !important;
    }
    
    .transform-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .product-card-simple {
        height: 340px;
    }
    
    .product-card-premium {
        height: 550px !important;
    }
    
    .product-card-simple .product-info {
        height: 150px;
        padding: 15px;
    }
    
    .product-card-premium .product-content.premium {
        padding: 20px;
        min-height: 380px;
    }
    
    .product-card-premium .product-actions.premium {
        min-height: 110px;
    }
}

@media (max-width: 480px) {
    .transform-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-card-wrapper {
        min-height: 320px;
    }
    
    .product-card-wrapper:hover {
        min-height: 520px !important;
    }
    
    .product-card-simple {
        height: 320px;
    }
    
    .product-card-premium {
        height: 520px !important;
    }
    
    .product-card-premium .product-title.premium {
        font-size: 1.2rem;
        min-height: 45px;
    }
    
    .product-card-premium .product-actions.premium {
        min-height: 100px;
    }
}

/* Mode mobile */
.product-card-wrapper.mobile-premium {
    min-height: 620px !important;
}

.product-card-wrapper.mobile-premium .product-card-simple {
    opacity: 0;
    transform: translateZ(-30px) rotateY(-180deg) scale(0.95);
    pointer-events: none;
}

.product-card-wrapper.mobile-premium .product-card-premium {
    opacity: 1;
    transform: translateZ(0) rotateY(0deg) scale(1);
    pointer-events: auto;
    z-index: 10;
    height: 620px !important;
}

/* Pour les écrans très hauts */
@media (min-height: 900px) {
    .product-card-wrapper:hover {
        min-height: 650px !important;
    }
    
    .product-card-premium {
        height: 650px !important;
    }
    
    .product-card-premium .product-description.premium {
        max-height: 150px;
    }
}

/* Garantir que rien ne dépasse */
.product-card-premium * {
    box-sizing: border-box;
}

/* Debug helper */
.debug-overflow {
    outline: 2px solid red !important;
}