/**
 * Regroupement des packs variables sur les pages panier et commande.
 *
 * - Ligne unique « pack » (lecture seule) : image + nom + prix total + bouton.
 * - Bouton « Voir le détail » → modale Bootstrap listant les produits factorisés.
 *
 * Chargé via bs_enqueue_variable_pack_cart_assets() (functions.variable-pack.php).
 */

/* -------------------------------------------------------------------------- */
/*  Bouton « Voir le détail » (commun panier + checkout)                       */
/* -------------------------------------------------------------------------- */
.bs-pack-detail-btn {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--bs-green);
    color: var(--bs-green);
    font: 500 14px/16px "Inter";
    cursor: pointer;
    transition: opacity .2s ease;
}

.bs-pack-detail-btn:hover {
    opacity: .7;
}

/* Bouton « Modifier ma sélection » */
.bs-pack-edit-btn {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin: 0;
    padding: 8px 16px;
    background: var(--bs-green);
    border: 1px solid var(--bs-green);
    border-radius: 8px;
    color: #FFF;
    font: 500 14px/16px "Inter";
    cursor: pointer;
    transition: opacity .2s ease;
}

.bs-pack-edit-btn:hover {
    opacity: .85;
}

/* Footer de la modale « Voir le détail » accueillant le bouton « Modifier » */
.bs-pack-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px 20px;
    border-top: 1px solid #21212119;
}

/* -------------------------------------------------------------------------- */
/*  Page panier — ligne pack (lecture seule)                                   */
/* -------------------------------------------------------------------------- */
.woocommerce-cart-form .bs-cart-item--pack .bs-cart-item__name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

/* La croix de suppression du pack est un <button> (suppression du pack entier
   en AJAX) : on neutralise le style natif pour réutiliser l'apparence du lien
   .remove des produits classiques (rond gris + icône FontAwesome). */
.bs-cart-item__remove button.bs-pack-remove {
    margin: 0;
    padding: 0;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* État « suppression en cours » de la croix : feedback léger sans pseudo-élément
   (on évite la classe générique .loading qui injecterait un spinner ::after
   fa-spin débordant du rond). */
.bs-pack-remove.bs-pack-removing {
    opacity: .5;
    pointer-events: none;
    cursor: wait;
}

.bs-cart-item--pack .bs-cart-item__pack-qty {
    font: 400 14px/100% "Inter";
    color: var(--bs-ink);
}

/* -------------------------------------------------------------------------- */
/*  Page commande — carte pack                                                 */
/* -------------------------------------------------------------------------- */
.checkout-review__item--pack .bs-pack-detail-btn {
    margin-top: 8px;
}

/* -------------------------------------------------------------------------- */
/*  Modale « Votre {pack} contient : »                                         */
/* -------------------------------------------------------------------------- */
.bs-pack-modal .modal-content {
    border: none;
    border-radius: 12px;
    padding: 10px;
}

.bs-pack-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #21212119;
}

.bs-pack-modal__title {
    margin: 0;
    font: 600 18px/24px "Inter";
    color: var(--bs-ink);
}

.bs-pack-modal__title strong {
    font-weight: 700;
}

.bs-pack-modal__close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    color: var(--bs-ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: opacity .2s ease;
}

.bs-pack-modal__close:hover {
    opacity: .6;
}

.bs-pack-modal .modal-body {
    padding: 16px 20px 20px;
}

.bs-pack-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bs-pack-modal__line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #21212112;
    font: 400 16px/22px "Inter";
    color: var(--bs-ink);
}

.bs-pack-modal__line:last-child {
    border-bottom: none;
}

.bs-pack-modal__qty {
    flex: 0 0 auto;
    min-width: 34px;
    font-weight: 700;
    color: var(--bs-green);
}

.bs-pack-modal__name {
    flex: 1 1 auto;
}

@media (max-width: 767px) {
    .bs-pack-modal__title {
        font-size: 16px;
        line-height: 22px;
    }

    .bs-pack-modal__line {
        font-size: 15px;
    }
}

/* -------------------------------------------------------------------------- */
/*  Modale d'édition de la sélection (panier)                                  */
/* -------------------------------------------------------------------------- */
.bs-pack-edit-modal .modal-content {
    border: none;
    border-radius: 12px;
    padding: 10px;
}

.bs-pack-edit-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #21212119;
}

.bs-pack-edit-modal .modal-body {
    padding: 16px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Le sélecteur réutilisé prend toute la largeur de la modale. */
.bs-pack-edit__selector .bs_variable_packs {
    width: 100%;
}

.bs-pack-edit-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px 20px;
    border-top: 1px solid #21212119;
}

.bs-pack-edit__submit {
    margin: 0;
    padding: 15px 40px;
    background: var(--bs-green);
    border: none;
    border-radius: 10px;
    color: #FFF;
    font: 500 15px/17px "Inter";
    cursor: pointer;
    transition: opacity .2s ease;
}

.bs-pack-edit__submit:hover {
    opacity: .9;
}

.bs-pack-edit__submit:disabled,
.bs-pack-edit__submit.bs-vp-incomplete {
    opacity: .45;
    cursor: not-allowed;
}

.bs-pack-edit__submit.loading {
    opacity: .6;
    cursor: wait;
}
