/* ==========================================================================
   PLUGIN : RECHERCHE PRODUIT PRO
   VERSION : 18.6
   AUTHOR : Klorofile
   ========================================================================== */

/* 1. CONTENEUR PRINCIPAL
   -------------------------------------------------------------------------- */
.rpp-outer {
    max-width: 850px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: center;
    color: #333;
}

.rpp-title {
    font-size: 26px;
    margin-bottom: 30px;
    font-weight: 700;
}

/* 2. PALIERS (CATÉGORIES & PRODUITS)
   -------------------------------------------------------------------------- */
.rpp-level-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 30px;
    background: #ffffff;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    animation: rppFadeIn 0.4s ease-out;
}

/* 3. LÉGENDE ET COMPTEUR
   -------------------------------------------------------------------------- */
.rpp-legend {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.rpp-legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.rpp-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 8px;
    display: inline-block;
}

.dot-sans { background-color: #4caf50 !important; }
.dot-avec { background-color: #1440ce !important; }

.rpp-product-count {
    display: block;
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    color: #a0a0a0;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1.2px;
}

/* 4. BOUTONS (PILLS) - ÉTATS PAR DÉFAUT
   -------------------------------------------------------------------------- */
.rpp-btn-choice {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.rpp-btn-cat { background-color: #0073aa !important; }
.rpp-prod-sans { background-color: #4caf50 !important; }
.rpp-prod-avec { background-color: #1440ce !important; }

/* 5. LOGIQUE DE SÉLECTION (GRISAGE)
   -------------------------------------------------------------------------- */
/* Quand une sélection est faite dans un palier, on grise tout */
.has-selection .rpp-btn-choice {
    background-color: #f2f2f2 !important;
    border-color: #e5e5e5 !important;
    color: #aaaaaa !important;
    box-shadow: none !important;
    filter: grayscale(1);
    opacity: 0.6;
    transform: scale(0.96);
}

/* On réactive uniquement l'élément cliqué */
.has-selection .rpp-btn-choice.is-active {
    filter: grayscale(0) !important;
    opacity: 1 !important;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
}

/* Rétablissement des couleurs vives pour l'élément actif */
.has-selection .rpp-btn-cat.is-active { background-color: #0073aa !important; }
.has-selection .rpp-prod-sans.is-active { background-color: #4caf50 !important; }
.has-selection .rpp-prod-avec.is-active { background-color: #1440ce !important; }

/* 6. BOUTON FINAL
   -------------------------------------------------------------------------- */
#rpp-final-btn {
    display: inline-block;
    padding: 16px 45px;
    background-color: #4caf50;
    color: #ffffff !important;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    margin-top: 25px;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
    transition: all 0.2s ease;
    text-decoration: none;
}

#rpp-final-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.rpp-hidden { display: none !important; }

/* 7. ANIMATIONS ET RESPONSIVE
   -------------------------------------------------------------------------- */
@keyframes rppFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .rpp-btn-choice { width: 100%; box-sizing: border-box; }
    .rpp-legend { flex-direction: column; gap: 10px; }
}