/* ============================================================================
   AL BUNDLES — bloc parcours
   Design System : Lunar Witchy - Palette Améthyste
   ----------------------------------------------------------------------------
   ⚠️ FEUILLE PARTAGÉE : elle habille la FICHE PRODUIT (al-bundles.php) **et**
   la carte du PANIER (al-bundles-panier.php, qui l'enfile aussi). La mise en
   page du panier vit dans al-panier-checkout.css §9 et surcharge d'ici — cette
   §9 est verrouillée sur `html body.woocommerce-cart`, elle ne peut donc pas
   atteindre la fiche produit, et réciproquement.

   Ce dont le PANIER dépend dans ce fichier, ⛔ NE PAS TOUCHER sans tester
   /panier/ dans ses deux variantes :
     · .al-bundle-suggestion              (fond, bordure, radius, padding, marges)
     · .al-bundle-title                   (police, taille de base, couleur)
     · .al-bundle-price-value             (prix du lot)
     · .al-bundle-saving-badge            (badge violet −X %)
     · .al-bundle-saving-text             (« jusqu'à −Y € »)
     · .al-bundle-add-all + :hover/:active/.is-loading/.is-added
     · la règle mobile width:100% du CTA
     · .al-bundle-cart-badge              (« 🌙 Parcours » sur les lignes du panier)
     · .al-toast / .show / .hide / .al-toast-icon   (le toast vit ICI, pas dans style.css)

   Tout le reste est propre à la fiche produit et vit sous `.al-bundle-fiche`.

   @version 1.6.1. Cache-buster : AL_BUNDLES_VERSION (includes/al-bundles.php).
   ============================================================================ */

/* ============================================================================
   COMMUN — fiche produit ET panier
   ============================================================================ */

.al-bundle-suggestion {
    background: linear-gradient(135deg, #f5f0f7 0%, #ffffff 100%) !important;
    border: 1px solid #D5C0DB !important;
    border-radius: 20px !important;
    padding: 25px !important;
    margin: 20px 0 !important;
    box-shadow: 0 8px 25px rgba(107, 50, 123, 0.08) !important;
}

.al-bundle-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 20px !important;
    color: #6B327B !important;
    font-weight: 600 !important;
}

.al-bundle-price-value {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.3em !important;
    color: #6B327B !important;
    font-weight: 700 !important;
}

/* Badge économie */
.al-bundle-saving-badge {
    display: inline-block !important;
    background: #6B327B !important;
    color: white !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.75em !important;
    font-weight: 600 !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    letter-spacing: 0.05em !important;
    box-shadow: 0 4px 12px rgba(107, 50, 123, 0.3) !important;
}

.al-bundle-saving-text {
    font-size: 0.7em !important;
    color: #8B5A9B !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
}

/* Bouton CTA - Gradient Prune→Améthyste */
.al-bundle-suggestion .al-bundle-add-all {
    display: inline-block !important;
    background: linear-gradient(135deg, #6B327B 0%, #8B5A9B 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.75em !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 15px rgba(107, 50, 123, 0.3) !important;
    border-radius: 25px !important;
    line-height: 1.4 !important;
    width: auto !important;
    max-width: fit-content !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.al-bundle-suggestion .al-bundle-add-all:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 6px 20px rgba(107, 50, 123, 0.4) !important;
}

.al-bundle-suggestion .al-bundle-add-all:active {
    transform: scale(0.98) !important;
}

.al-bundle-add-all.is-loading {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

/* État bouton après ajout réussi */
.al-bundle-suggestion .al-bundle-add-all.is-added {
    background: linear-gradient(135deg, #8B5A9B 0%, #AB7ABB 100%) !important;
    cursor: default !important;
    opacity: 0.9 !important;
    pointer-events: none !important;
}

/* Badge sur les lignes du panier (al-bundles.php, al_bundles_cart_item_name) */
.al-bundle-cart-badge {
    display: inline-block !important;
    font-size: 0.75em !important;
    color: #6B327B !important;
    margin-left: 5px !important;
    font-weight: 600 !important;
}

/* Toast notification */
.al-toast {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(20px) !important;
    background: linear-gradient(135deg, #6B327B 0%, #8B5A9B 100%) !important;
    color: white !important;
    padding: 14px 28px !important;
    border-radius: 20px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 8px 30px rgba(107, 50, 123, 0.35) !important;
    z-index: 99999 !important;
    opacity: 0 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
}

.al-toast.show {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
}

.al-toast.hide {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(20px) !important;
}

.al-toast-icon {
    margin-right: 8px !important;
}

/* ============================================================================
   FICHE PRODUIT — BANDEAU (1.5.0)
   ----------------------------------------------------------------------------
   Tout est ancré sur `.al-bundle-fiche` : aucune de ces règles ne peut
   atteindre `.al-bundle-panier`. Le préfixe `html body` est la convention du
   site — l'ordre d'impression des feuilles n'est pas garanti, la spécificité
   fait le travail que l'ordre ne fait pas.
   ============================================================================ */

html body .al-bundle-suggestion.al-bundle-fiche {
    padding: 16px 20px !important;
    margin: 16px 0 !important;
}

/* La rangée haute peut REVENIR À LA LIGNE : les parcours à 4 audios existent
   (relevé : 6 fiches à 2, 12 à 3, 4 à 4). Au-delà de trois vignettes, elles
   mangent la largeur et le corps passe dessous. Aucune condition côté PHP. */
html body .al-bundle-fiche .al-bundle-fiche-haut {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px 20px !important;
}

html body .al-bundle-fiche .al-bundle-fiche-thumbs {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 0 0 auto !important;
}

html body .al-bundle-fiche .al-bundle-fiche-thumb {
    display: block !important;
    position: relative !important;   /* porte le voile ::after */
    width: 64px !important;
    height: 64px !important;
    flex: 0 0 auto !important;
    border-radius: 15px !important;
    overflow: hidden !important;
}

html body .al-bundle-fiche .al-bundle-fiche-thumb img {
    width: 64px !important;
    height: 64px !important;
    max-width: none !important;
    object-fit: cover !important;
    display: block !important;
    border: 1px solid #D5C0DB !important;
    border-radius: 15px !important;
    transition: all 0.3s ease !important;
}

html body .al-bundle-fiche .al-bundle-fiche-thumb:not(.est-courante):hover img {
    border-color: #8B5A9B !important;
}

/* L'audio qu'on est en train de regarder s'estompe : ce sont les AUTRES qu'on
   propose ici. Voile repris VERBATIM de la carte panier (al-panier-checkout.css
   §9), qui reprend lui-même le dégradé de brume de la marque. */
html body .al-bundle-fiche .al-bundle-fiche-thumb.est-courante::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: var(--al-degrade-brume, linear-gradient(135deg, #f5f0f7 0%, #D5C0DB 100%)) !important;
    opacity: 0.72 !important;
    pointer-events: none !important;
}

html body .al-bundle-fiche .al-bundle-fiche-plus {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    color: #AB7ABB !important;
    flex: 0 0 auto !important;
}

html body .al-bundle-fiche .al-bundle-fiche-corps {
    flex: 1 1 280px !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

html body .al-bundle-fiche .al-bundle-title {
    display: block !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
}

/* flex-wrap = filet : sur une économie à quatre chiffres, la rangée descend le
   dernier élément au lieu de déborder. */
html body .al-bundle-fiche .al-bundle-fiche-prix {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
}

html body .al-bundle-fiche .al-bundle-fiche-prix del {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 13px !important;
    color: #AB7ABB !important;
}

html body .al-bundle-fiche .al-bundle-price-value  { font-size: 17px !important; }
html body .al-bundle-fiche .al-bundle-saving-text  { font-size: 12px !important; }
html body .al-bundle-fiche .al-bundle-saving-badge { font-size: 11px !important; padding: 4px 10px !important; }

html body .al-bundle-fiche .al-bundle-fiche-texte {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #8B5A9B !important;
    margin: 8px 0 0 !important;
    padding: 0 !important;
}

html body .al-bundle-fiche .al-bundle-fiche-texte a {
    color: #6B327B !important;
    text-decoration: none !important;
    border-bottom: 1px solid transparent !important;
}

html body .al-bundle-fiche .al-bundle-fiche-texte a:hover,
html body .al-bundle-fiche .al-bundle-fiche-texte a:focus-visible {
    border-bottom-color: currentColor !important;
}

/* CTA pleine largeur : la rangée de prix et le libellé ne tiennent pas ensemble
   dans le corps disponible. Pleine largeur, il fait écho au bouton d'ajout au
   panier juste au-dessus. */
html body .al-bundle-fiche .al-bundle-add-all {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 12px 0 0 !important;
    padding: 12px 24px !important;
    font-size: 11px !important;
    text-align: center !important;
    white-space: normal !important;  /* la base pose nowrap : risqué à 320 px */
}

/* SECONDAIRE (1.6.0) — sur la FICHE seulement, le bouton du parcours prend
   l'habillage du bouton secondaire maison. Valeurs RELEVÉES SUR LE RENDU, pas
   lues dans une feuille : `.view-cart` du mini-panier est réglé dans
   al-fenetres.css (fond transparent, filet PLEIN de 2 px, aucune ombre), qui
   surcharge la version à 1 px et fond translucide de style.css. Le bouton
   « Je me l'offre » du lecteur (`.al-lect-offre`, al-lecteur.css) suit le même
   principe. Survol : fond `--al-brume` (#f5f0f7), sans déplacement.

   Pourquoi : « Je me l'offre » (dégradé plein, pleine largeur, posé par le
   gabarit) doit rester le seul bouton dominant. Mesuré avant : 161×48 aplat
   contre 266×39 dégradé sur téléphone, et 161×48 contre 582×39 sur bureau — le
   visiteur lisait « le vrai bouton, c'est 53,97 € ».

   La base pose tout en !important : on reprend !important avec une spécificité
   supérieure (html body … = 0,3,1 > 0,2,1). L'état .is-added garde la main.
   ⛔ Ne jamais sortir ces règles de `.al-bundle-fiche` : la feuille est partagée
   avec /panier/. */
html body .al-bundle-fiche .al-bundle-add-all {
    background: transparent !important;
    background-image: none !important;
    animation: none !important;
    color: #6B327B !important;
    border: 2px solid #6B327B !important;
    box-shadow: none !important;
}
html body .al-bundle-fiche .al-bundle-add-all:hover,
html body .al-bundle-fiche .al-bundle-add-all:focus-visible {
    background: #f5f0f7 !important;
    color: #6B327B !important;
    transform: none !important;
    box-shadow: none !important;
}
html body .al-bundle-fiche .al-bundle-add-all:active {
    transform: none !important;
}
html body .al-bundle-fiche .al-bundle-add-all.is-added {
    background: linear-gradient(135deg, #8B5A9B 0%, #AB7ABB 100%) !important;
    background-image: linear-gradient(135deg, #8B5A9B 0%, #AB7ABB 100%) !important;
    color: #FFFFFF !important;
    border-color: #8B5A9B !important;
    transform: none !important;
}

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

@media (max-width: 768px) {

    /* CTA pleine largeur — le PANIER en dépend aussi (§9 ne le redit pas). */
    .al-bundle-suggestion .al-bundle-add-all {
        width: 100% !important;
        max-width: 100% !important;
        text-align: center !important;
        padding: 14px !important;
        font-size: 0.75em !important;
        margin-left: 0 !important;
    }

    /* ── fiche produit ── */
    html body .al-bundle-suggestion.al-bundle-fiche {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    html body .al-bundle-fiche .al-bundle-fiche-haut {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }

    html body .al-bundle-fiche .al-bundle-fiche-thumb,
    html body .al-bundle-fiche .al-bundle-fiche-thumb img {
        width: 56px !important;
        height: 56px !important;
        border-radius: 12px !important;
    }

    /* ⚠️ en flex-direction:column, le flex-basis du corps (280px) deviendrait
       une HAUTEUR : sans ce retour à auto, le bandeau se gonfle pour rien. */
    html body .al-bundle-fiche .al-bundle-fiche-corps {
        flex: 1 1 auto !important;
        align-items: center !important;
        text-align: center !important;
    }

    html body .al-bundle-fiche .al-bundle-fiche-prix {
        justify-content: center !important;
    }

    html body .al-bundle-fiche .al-bundle-fiche-texte {
        text-align: center !important;
    }

    html body .al-bundle-fiche .al-bundle-add-all {
        padding: 12px 24px !important;
        font-size: 11px !important;
    }
}
