/**
 * Styles pour les cartes de meilleurs prix par quantité
 * Style inspiré de l'image fournie avec couleurs Lion Industrie
 */

/* Container des cartes */
.dwp-price-tiers-wrapper {
    margin: 30px 0;
}

.dwp-price-tiers-wrapper h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
}

/* Grid des cartes */
.dwp-price-tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 0;
}

@media (max-width: 768px) {
    .dwp-price-tiers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Garder 2 colonnes même sur très petit écran */
@media (max-width: 480px) {
    .dwp-price-tiers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Carte individuelle - CLIQUABLE */
.dwp-tier-card {
    position: relative;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #089944 0%, #006633 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 3px solid transparent;
    overflow: hidden;
}

.dwp-tier-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(8, 153, 68, 0.3);
    background: #ffffff;
    border: 3px solid #089944;
}

/* Textes en vert au hover */
.dwp-tier-card:hover .dwp-tier-range,
.dwp-tier-card:hover .dwp-tier-price,
.dwp-tier-card:hover .dwp-tier-original-price,
.dwp-tier-card:hover .dwp-tier-unit-price {
    color: #089944;
}

.dwp-tier-card:hover .dwp-tier-badge {
    background: #089944;
    color: #ffffff;
    border-color: #089944;
}

/* Animation au clic */
.dwp-tier-card:active,
.dwp-tier-card.tier-clicked {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Carte active - même style que le hover */
.dwp-tier-card.active {
    background: #ffffff;
    border: 3px solid #089944;
    box-shadow: 0 8px 24px rgba(8, 153, 68, 0.4);
    transform: scale(1.05);
}

/* Textes en vert pour la carte active */
.dwp-tier-card.active .dwp-tier-range,
.dwp-tier-card.active .dwp-tier-price,
.dwp-tier-card.active .dwp-tier-original-price,
.dwp-tier-card.active .dwp-tier-unit-price {
    color: #089944;
}

.dwp-tier-card.active .dwp-tier-badge {
    background: #089944;
    color: #ffffff;
    border-color: #089944;
}

/* Check vert au lieu de jaune - positionné à gauche du badge */
.dwp-tier-card.active::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 70px;
    width: 24px;
    height: 24px;
    background: #089944;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(8, 153, 68, 0.3);
}

/* Range de poids */
.dwp-tier-range {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Prix remisé */
.dwp-tier-price {
    font-size: 18px;
    font-weight: 800;
    margin: 1px 0;
    line-height: 1;
}

/* Prix barré (prix normal) */
.dwp-tier-original-price {
    font-size: 12px;
    font-weight: 500;
    text-decoration: line-through;
    opacity: 0.8;
    margin: 0 0 2px 0;
}

/* Prix au kg/g */
.dwp-tier-unit-price {
    font-size: 10px;
    opacity: 0.9;
    margin: 1px 0 0 0;
}

/* Badge de remise - positionné en haut à droite */
.dwp-tier-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0;
}

/* Pas de remise */
.dwp-tier-card.no-discount {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.dwp-tier-card.no-discount .dwp-tier-original-price {
    display: none;
}

.dwp-tier-card.no-discount .dwp-tier-badge {
    background: rgba(255, 255, 255, 0.15);
}

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

.dwp-tier-card {
    animation: tierSlideIn 0.4s ease forwards;
}

/* Animation décalée pour chaque carte */
.dwp-tier-card:nth-child(1) { animation-delay: 0s; }
.dwp-tier-card:nth-child(2) { animation-delay: 0.1s; }
.dwp-tier-card:nth-child(3) { animation-delay: 0.2s; }
.dwp-tier-card:nth-child(4) { animation-delay: 0.3s; }
.dwp-tier-card:nth-child(5) { animation-delay: 0.4s; }
.dwp-tier-card:nth-child(6) { animation-delay: 0.5s; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .dwp-tier-card {
        padding: 6px 8px;
    }
    
    .dwp-tier-range {
        font-size: 11px;
    }
    
    .dwp-tier-price {
        font-size: 16px;
    }
    
    .dwp-tier-original-price {
        font-size: 10px;
    }
    
    .dwp-tier-unit-price {
        font-size: 9px;
    }
    
    .dwp-tier-badge {
        font-size: 9px;
        padding: 2px 6px;
        top: 6px;
        right: 6px;
    }
    
    .dwp-tier-card.active::before {
        width: 20px;
        height: 20px;
        font-size: 12px;
        right: 60px;
        top: 6px;
    }
}

/* ============================================================================
   ANIMATION DU TITRE "MEILLEURS PRIX PAR QUANTITÉ"
   ============================================================================ */

/* Animation du titre principal */
.dwp-price-tiers-title {
    animation: slideInFromLeft 0.6s ease-out;
    display: inline-block;
}

/* Animation de l'emoji feu */
.dwp-fire-emoji {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

/* Animation slide depuis la gauche */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation bounce pour l'emoji */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
}

/* Effet de brillance au survol du titre */
.dwp-price-tiers-title:hover {
    text-shadow: 0 0 10px rgba(8, 153, 68, 0.3);
    cursor: default;
}

/* Animation plus prononcée de l'emoji au survol du titre */
.dwp-price-tiers-title:hover .dwp-fire-emoji {
    animation: bounceHover 0.5s ease-in-out infinite;
}

@keyframes bounceHover {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) scale(1.2) rotate(-10deg);
    }
    75% {
        transform: translateY(-8px) scale(1.2) rotate(10deg);
    }
}

/* Pulsation subtile pour attirer l'attention */
.dwp-price-tiers-title::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, rgba(8, 153, 68, 0.1) 0%, transparent 70%);
    border-radius: 8px;
    animation: pulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Rendre le titre relatif pour le pseudo-élément */
.dwp-price-tiers-title {
    position: relative;
}

/* Animation d'apparition en fondu pour le wrapper */
.dwp-price-tiers-wrapper {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
