/**
 * Seasonal Ingredients Enhanced - Styles pour la section C'est de saison
 * Compteur recettes, CTA hover, indicateur niveau de saison
 * 
 * @version 1.0
 * @date 2026-01-22
 */

/* ============================================
   WRAPPER POUR CARTE INGRÉDIENT + CTA HOVER
   ============================================ */

.seasonal-ingredients-grid .ingredient-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.seasonal-ingredients-grid .ingredient-card {
    position: relative;
    z-index: 1;
}

/* ============================================
   BADGE COMPTEUR DE RECETTES
   ============================================ */

.seasonal-ingredients-grid .ingredient-recipe-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.95) 0%, rgba(229, 92, 92, 0.95) 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.2s ease;
}

.seasonal-ingredients-grid .ingredient-recipe-count i {
    font-size: 0.6rem;
}

.seasonal-ingredients-grid .ingredient-card:hover .ingredient-recipe-count {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
}

/* ============================================
   INDICATEUR NIVEAU DE SAISON
   ============================================ */

.seasonal-ingredients-grid .ingredient-season-level {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Pleine saison - Vert vif */
.seasonal-ingredients-grid .ingredient-season-level.season-peak {
    background: linear-gradient(135deg, #40c057 0%, #2f9e44 100%);
    color: white;
}

.seasonal-ingredients-grid .ingredient-card:hover .ingredient-season-level {
    transform: scale(1.1);
}

/* ============================================
   CTA HOVER - "CUISINER AVEC"
   ============================================ */

.seasonal-ingredients-grid .ingredient-cta-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.97) 0%, rgba(229, 92, 92, 0.97) 100%);
    color: white;
    text-decoration: none;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0 0 var(--border-radius, 8px) var(--border-radius, 8px);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.seasonal-ingredients-grid .ingredient-cta-hover .cta-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.seasonal-ingredients-grid .ingredient-cta-hover i {
    font-size: 0.75rem;
}

/* Afficher au hover de la carte wrapper */
.seasonal-ingredients-grid .ingredient-card-wrapper:hover .ingredient-cta-hover {
    opacity: 1;
    transform: translateY(0);
}

/* Effet sur l'image au hover */
.seasonal-ingredients-grid .ingredient-card-wrapper:hover .ingredient-card {
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.25);
}

/* Overlay subtil sur l'image au hover */
.seasonal-ingredients-grid .ingredient-card-wrapper:hover .ingredient-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(255, 107, 107, 0.1) 100%);
    pointer-events: none;
}

/* Position relative pour l'overlay */
.seasonal-ingredients-grid .ingredient-img {
    position: relative;
}

/* ============================================
   DARK MODE
   ============================================ */

.dark-mode .seasonal-ingredients-grid .ingredient-recipe-count {
    background: linear-gradient(135deg, rgba(229, 92, 92, 0.95) 0%, rgba(200, 70, 70, 0.95) 100%);
}

.dark-mode .seasonal-ingredients-grid .ingredient-cta-hover {
    background: linear-gradient(135deg, rgba(229, 92, 92, 0.97) 0%, rgba(200, 70, 70, 0.97) 100%);
}

.dark-mode .seasonal-ingredients-grid .ingredient-season-level.season-peak {
    background: linear-gradient(135deg, #37b24d 0%, #2b8a3e 100%);
}

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

/* > 1200px : grille 6 colonnes, on masque les items 7 et 8 */
@media (min-width: 1201px) {
    .seasonal-ingredients-grid .ingredient-card-wrapper:nth-child(n+7) {
        display: none;
    }
}

/* 1024–1200px : grille 4 colonnes, 8 items visibles = 2 lignes pleines */
@media (max-width: 1200px) {
    .seasonal-ingredients-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ≤ 768px : grille 3 colonnes, on masque au-delà de 6 items (2 lignes pleines) */
@media (max-width: 768px) {
    .seasonal-ingredients-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .seasonal-ingredients-grid .ingredient-card-wrapper:nth-child(n+7) {
        display: none;
    }

    .seasonal-ingredients-grid .ingredient-recipe-count {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .seasonal-ingredients-grid .ingredient-season-level {
        width: 22px;
        height: 22px;
        font-size: 0.6rem;
    }
    
    .seasonal-ingredients-grid .ingredient-cta-hover {
        font-size: 0.75rem;
        padding: 8px 6px;
    }
}

/* ≤ 480px : grille 2 colonnes, max 4 items (2 lignes pleines) */
@media (max-width: 480px) {
    .seasonal-ingredients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .seasonal-ingredients-grid .ingredient-card-wrapper:nth-child(n+5) {
        display: none;
    }

    .seasonal-ingredients-grid .ingredient-recipe-count {
        top: 5px;
        right: 5px;
        font-size: 0.6rem;
        padding: 2px 5px;
    }
    
    .seasonal-ingredients-grid .ingredient-season-level {
        top: 5px;
        left: 5px;
        width: 20px;
        height: 20px;
        font-size: 0.55rem;
    }
    
    .seasonal-ingredients-grid .ingredient-cta-hover {
        font-size: 0.7rem;
        padding: 7px 5px;
    }
}

/* ============================================
   DÉSACTIVER HOVER SUR TACTILE
   ============================================ */

@media (hover: none), (pointer: coarse) {
    /* Toujours afficher le CTA sur tactile */
    .seasonal-ingredients-grid .ingredient-cta-hover {
        opacity: 1;
        transform: translateY(0);
        position: relative;
        margin-top: -1px;
    }
    
    .seasonal-ingredients-grid .ingredient-card-wrapper:hover .ingredient-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}
