/**
 * Styles pour le retrait en point de vente
 * ThÃ¨me: Astra Child - L'Or des Plantes
 * Version: 2.1 - Affichage uniforme de l'adresse
 */

/* ========================================
   MASQUAGE DES CHAMPS DE LIVRAISON
   ======================================== */

/* Masquer les champs d'adresse de livraison quand local pickup est sÃ©lectionnÃ© */
body.local-pickup-selected #ship-to-different-address-checkbox,
body.local-pickup-selected .woocommerce-shipping-fields,
body.local-pickup-selected .shipping_address {
    display: none !important;
}

/* ========================================
   MISE EN PAGE 2 COLONNES - PAGE PANIER
   ======================================== */

/* Le wrapper est crÃ©Ã© par JavaScript */
.cart-collaterals-wrapper {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    margin-top: 20px !important;
    align-items: start !important;
}

/* Colonne gauche : contient les boîtes d'adresse (retrait OU livraison) */
.cart-address-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    width: 100% !important;
}

/* Bloc "Total panier" */
.cart-collaterals-wrapper .cart_totals {
    width: 100% !important;
}

/* ========================================
   MASQUAGE DE LA DESTINATION WC DANS LE TOTAL PANIER
   (affichée dans la colonne gauche à la place)
   ======================================== */

.woocommerce-cart .cart_totals .woocommerce-shipping-destination {
    display: none !important;
}

/* Masquer le bouton "Modifier l'adresse" et le formulaire de calcul dans le Total panier */
/* L'adresse se modifie à l'étape suivante (page checkout) */
.woocommerce-cart .cart_totals .shipping-calculator-button,
.woocommerce-cart .cart_totals .shipping-calculator-form {
    display: none !important;
}

/* ========================================
   BOÎTE "ADRESSE DE LIVRAISON" (domicile)
   Style similaire à la boîte "Adresse de retrait" mais en bleu/gris
   ======================================== */

.delivery-address-box {
    background: #f8f8f8 !important;
    border: 2px solid #6699cc !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin: 0 !important;
    display: none; /* Caché par défaut, affiché par JS */
}

.delivery-address-box h3 {
    color: #336699 !important;
    margin: 0 0 15px 0 !important;
    font-size: 20px !important;
}

.delivery-address-box .delivery-address-content {
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #333 !important;
    margin-bottom: 10px !important;
}

/* Lien "Modifier l'adresse" déplacé depuis WooCommerce */
.delivery-address-box .delivery-address-content a {
    color: #6699cc !important;
    font-size: 14px !important;
    display: inline-block !important;
    margin-top: 8px !important;
    text-decoration: none !important;
}

.delivery-address-box .delivery-address-content a:hover {
    text-decoration: underline !important;
}

/* VERSION COMPACTE pour la page PANIER */
.delivery-address-box-compact {
    padding: 12px 20px !important;
}

.delivery-address-box-compact h3 {
    margin: 0 0 8px 0 !important;
    font-size: 20px !important;
}

.delivery-address-box-compact .delivery-address-content {
    margin: 0 0 6px 0 !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* ========================================
   AFFICHAGE DE L'ADRESSE SUR LE LABEL
   Style uniforme pour PANIER et CHECKOUT
   TOUTE L'ADRESSE EN ORANGE - ALIGNÉE À GAUCHE
   BOUTONS RADIO À CÔTÉ DU TEXTE
   ======================================== */

/* S'assurer que les li restent en mode normal (bouton à côté du texte) */
body.woocommerce-cart #shipping_method li,
body.woocommerce-checkout #shipping_method li,
.woocommerce-cart #shipping_method li,
.woocommerce-checkout #shipping_method li,
#order_review #shipping_method li {
    text-align: left !important;
    /* NE PAS mettre display: block ici pour garder les boutons radio à côté */
}

/* S'assurer que les labels restent inline avec les boutons radio */
body.woocommerce-cart #shipping_method li label,
body.woocommerce-checkout #shipping_method li label,
.woocommerce-cart #shipping_method li label,
.woocommerce-checkout #shipping_method li label,
#order_review #shipping_method li label {
    text-align: left !important;
    display: inline !important; /* AJOUT: forcer inline pour garder le bouton à côté */
    vertical-align: top !important; /* AJOUT: alignement vertical en haut */
    /* NE PAS mettre display: block ici pour garder les boutons à côté */
}

/* Conteneur de l'adresse dans le label - PANIER - BON SÉLECTEUR */
body.woocommerce-cart #shipping_method li label span.paid-shipping-method > div,
.woocommerce-cart #shipping_method li label span.paid-shipping-method > div,
.cart-collaterals #shipping_method li label span.paid-shipping-method > div {
    margin-top: 8px !important;
    margin-left: 25px !important;
    padding-left: 0 !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    color: #ff6600 !important;
    text-align: left !important;
    display: block !important;
}

/* Conteneur de l'adresse dans le label - CHECKOUT - BON SÉLECTEUR */
body.woocommerce-checkout #shipping_method li label span.paid-shipping-method > div,
.woocommerce-checkout #shipping_method li label span.paid-shipping-method > div,
#order_review #shipping_method li label span.paid-shipping-method > div {
    margin-top: 8px !important;
    margin-left: 25px !important;
    padding-left: 0 !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    color: #ff6600 !important;
    text-align: left !important;
    display: block !important;
}

/* Sélecteur générique - BON SÉLECTEUR */
#shipping_method li label span.paid-shipping-method > div,
#shipping_method li label span > div {
    margin-top: 8px !important;
    margin-left: 25px !important;
    padding-left: 0 !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    color: #ff6600 !important;
    text-align: left !important;
    display: block !important;
}
/* Nom du point de vente en orange et en gras */
#shipping_method li label span.paid-shipping-method > div strong,
#shipping_method li label span > div strong {
    color: #ff6600 !important;
    display: block !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    text-align: left !important;
}

/* Lignes d'adresse - AUSSI EN ORANGE - ALIGNÉES À GAUCHE */
#shipping_method li label span.paid-shipping-method > div span,
#shipping_method li label span > div span {
    color: #ff6600 !important;
    display: block !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    text-align: left !important;
}

/* ========================================
   MESSAGE INFORMATIF (Colonne gauche)
   ======================================== */

.local-pickup-message {
    background: linear-gradient(135deg, #fff9f0 0%, #ffe8cc 100%);
    border: 2px solid #ff6600;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.local-pickup-message h3 {
    color: #ff6600;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.local-pickup-message p {
    margin: 10px 0;
    line-height: 1.6;
}

/* ========================================
   RAPPEL D'ADRESSE (Colonne gauche)
   ======================================== */

.pickup-address-box {
    background: #f8f8f8;
    border: 2px solid #ff6600;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    display: none; /* CachÃ© par dÃ©faut */
}

.pickup-address-box h3 {
    color: #ff6600;
    margin: 0 0 15px 0;
    font-size: 20px;
}

.pickup-address-box p {
    margin: 10px 0;
    font-size: 16px;
    line-height: 1.6;
}

.pickup-address-box p strong {
    color: #333;
}

.pickup-address-box p.pickup-hours {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* VERSION COMPACTE pour la page PANIER */
.pickup-address-box-compact {
    padding: 12px 20px !important;  /* Moins d'espace en haut/bas */
}

.pickup-address-box-compact h3 {
    margin: 0 0 8px 0 !important;   /* Moins d'espace sous le titre */
    font-size: 20px !important;      /* Titre GRAND (comme avant) */
}

.pickup-address-box-compact p {
    margin: 0 0 6px 0 !important;   /* Moins d'espace entre paragraphes */
    font-size: 16px !important;      /* Texte NORMAL (comme avant) */
    line-height: 1.5 !important;
}

.pickup-address-box-compact p.pickup-hours {
    margin: 0 !important;
    font-size: 14px !important;
}

/* ========================================
   ADRESSE DE RETRAIT (Colonne droite)
   CORRECTION DES DOUBLONS
   ======================================== */

/* Masquer TOUTES les lignes d'adresse de retrait sauf la premiÃ¨re */
.pickup-address-row {
    display: table-row !important;
}

/* Cacher les doublons : garder seulement la premiÃ¨re occurrence */
.pickup-address-row ~ .pickup-address-row {
    display: none !important;
}

/* Style de la ligne d'adresse visible */
.pickup-address-row th {
    text-align: left !important;
    padding: 10px 0 !important;
    border-top: 1px solid #e5e5e5 !important;
    font-weight: normal !important;
}

.pickup-address-row td {
    text-align: right !important;
    padding: 10px 0 !important;
    border-top: 1px solid #e5e5e5 !important;
}

.pickup-address-row td strong {
    color: #ff6600 !important;
    font-weight: 600 !important;
}

/* ========================================
   ANIMATIONS
   ======================================== */

.local-pickup-message,
.pickup-address-box {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive 2 colonnes : 1 colonne sur mobile */
@media (max-width: 768px) {
    .cart-collaterals-wrapper {
        grid-template-columns: 1fr !important;
    }

    .cart-address-column {
        order: 2; /* Sur mobile : adresse après le total */
    }

    .cart-collaterals-wrapper .cart_totals {
        order: 1;
    }

    .local-pickup-message,
    .pickup-address-box,
    .delivery-address-box {
        padding: 15px;
        margin: 15px 0;
    }

    .local-pickup-message h3,
    .pickup-address-box h3,
    .delivery-address-box h3 {
        font-size: 16px;
    }

    .pickup-address-row th,
    .pickup-address-row td {
        font-size: 14px;
    }

    /* Adresse dans le label sur mobile */
    #shipping_method li label > div {
        font-size: 13px !important;
    }
}
