/**
 * Styles pour la gestion des adresses dans le checkout
 * Gère l'affichage des adresses pour les clients particuliers et professionnels
 */

/* ===================================
   ADRESSES GÉNÉRALES
   =================================== */

.address-section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #163C5D;
    margin-bottom: 25px;
}

#checkout-addresses-step {
    padding-top: 24px !important;
}

/* Barre séparatrice entre adresse de livraison et facturation */
#invoice-address-section {
    border-top: 1px solid #ddd;
    padding-top: 40px;
    margin-top: 40px;
}

.address-selector-block {
    margin: 15px 0;
}

/* ===================================
   MESSAGE AUCUNE ADRESSE
   =================================== */

.no-address-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 25px;
    margin: 15px 0;
}

.no-address-message {
    color: #2B8FF2;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: normal;
    margin: 0;
}


/* ===================================
   BOUTON AJOUTER UNE ADRESSE
   =================================== */

.add-address-button-container {
    display: flex;
    align-items: center;
}

.add-address-link {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #163C5D !important;
    text-decoration: underline;
    cursor: pointer;
}

.add-address-link:hover {
    color: #2B8FF2 !important;
}

.address-item {
    font-family: Poppins, Sans-serif;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.address-item:hover {
    border-color: #999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

span.custom-radio > span::before {
    background-color: #2B8FF2;
    color: #FFF;
}

.address-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
}

.address-label input[type="radio"] {
    margin-top: 5px;
    margin-right: 15px;
    flex-shrink: 0;
}

.address-content {
    flex: 1;
}

.address-alias {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
    color: #163C5D;
}

.address-details {
    display: block;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ===================================
   BOUTONS D'ACTION SUR LES ADRESSES
   =================================== */

.address-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.address-actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

.address-actions .material-icons {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 3px;
}

/* ===================================
   ADRESSES VERROUILLÉES (PROFESSIONNELS)
   =================================== */

.address-item-locked {
    background-color: #f5f5f5;
    border-color: #d3d3d3 !important;
    opacity: 0.85;
}

.address-item-locked.address-item-invoice {
    background-color: #e9ecef;
    position: relative;
}

/* Motif diagonal pour indiquer le verrouillage */
.address-item-locked.address-item-invoice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,.02) 10px,
        rgba(0,0,0,.02) 20px
    );
    pointer-events: none;
    border-radius: 4px;
}

.address-item-locked.address-item-invoice .address-content {
    color: #6c757d;
}

.address-item-locked.address-item-invoice .address-alias {
    color: #495057;
}

.address-item-locked.address-item-invoice input[type="radio"] {
    cursor: default;
}

/* ===================================
   BADGE "LOCKED"
   =================================== */

.address-locked-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #ffc107;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #856404;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.address-locked-icon .material-icons {
    font-size: 16px;
    color: #856404;
}

.address-locked-icon .locked-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   MESSAGE INFORMATIF ADRESSE VERROUILLÉE
   =================================== */

.address-locked-message {
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #856404;
    line-height: 1.5;
}

.address-locked-message .material-icons {
    margin-right: 10px;
    color: #ffc107;
    font-size: 20px;
    flex-shrink: 0;
}

.address-locked-message a {
    color: #0056b3;
    text-decoration: underline;
    font-weight: bold;
}

.address-locked-message a:hover {
    color: #003d82;
}

/* ===================================
   FORMULAIRE D'ADRESSE
   =================================== */

.address-form-container {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* ===================================
   BARRE DE RECHERCHE D'ADRESSE
   =================================== */

#search-address {
    border: 1px solid #ddd !important;
    border-radius: 50px !important;
    padding: 10px 20px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

#search-address:focus {
    box-shadow: 0 0 0 0.2rem rgba(22, 60, 93, 0.15) !important;
    outline: none;
}

#search-address::placeholder {
    color: #999;
    font-style: italic;
}

/* ===================================
   RAPPEL ADRESSES DE LIVRAISON ET FACTURATION
   =================================== */

.delivery-address-reminder,
.invoice-address-reminder {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: normal;
    color: #163C5D;
}

.delivery-address-reminder {
    padding-top: 20px;
}

.invoice-address-reminder {
    padding-top: 12px;
}

.delivery-address-reminder strong,
.invoice-address-reminder strong {
    color: #163C5D;
}

.delivery-address-reminder .material-icons,
.invoice-address-reminder .fa-credit-card {
    vertical-align: middle;
    font-size: 18px;
    color: #163C5D;
    margin-right: 5px;
}

.delivery-address-reminder #delivery-address-text,
.invoice-address-reminder #invoice-address-text {
    margin-left: 10px;
    color: #163C5D;
}

/* ===================================
   NOUVEAU DESIGN SIMPLIFIÉ DES ADRESSES
   =================================== */

/* Forcer l'affichage en colonne (une adresse par ligne) */
#delivery-addresses.address-selector,
#invoice-addresses.address-selector {
    display: flex;
    flex-direction: column;
}

.address-item-simple {
    margin-left: 35px;
    width: 100%;
    margin-bottom: 30px;
}

.address-label-simple {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
}

.address-radio-icon {
    margin-right: 12px;
    font-size: 18px;
    line-height: 1;
    margin-top: 2px;
    font-family: 'Font Awesome 5 Free' !important;
}

.address-radio-icon .fa-circle-dot {
    color: #2B8FF2;
}

.address-radio-icon .fa-circle {
    color: #7a7a7a;
}

.address-radio-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.address-content-simple {
    font-family: 'Poppins', sans-serif;
    color: #163C5D;
    font-size: 14px;
    line-height: 1.5;
}

.address-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.address-details-simple {
    font-weight: 400;
    margin-bottom: 0;
}

.address-phone {
    font-weight: 400;
    margin-bottom: 0;
}

.address-actions-simple {
    margin-top: 10px;
}

.edit-address-simple,
.delete-address-simple {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #2B8FF2 !important;
    text-decoration: underline;
    cursor: pointer;
}

.edit-address-simple:hover,
.delete-address-simple:hover {
    color: #137CE3 !important;
}

.address-action-separator {
    font-weight: 700;
    margin: 0 8px;
    color: #163C5D;
}

/* ===================================
   PAGINATION DES ADRESSES
   =================================== */

.address-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

.address-footer-row .add-address-button-container {
    flex: 0 0 auto;
}

.address-pagination {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

/* Style pour les adresses fiscales */
.fiscal-info-inline {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #163c5d;
    margin-top: 12px;
}

.fiscal-info-inline i {
    margin-right: 5px;
    color: #2B8FF2;
}

.fiscal-info-inline .contact-link {
    color: #2B8FF2;
    font-weight: 600;
    text-decoration: underline;
}

.fiscal-info-inline .contact-link:hover {
    color: #e84242 !important;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0;
}

.pagination-btn {
    background: none;
    border: none;
    color: #7a7a7a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    padding: 0 3px;
}

.pagination-btn.pagination-prev,
.pagination-btn.pagination-next {
    font-size: 18px;
    font-family: 'Font Awesome 5 Free' !important;
    padding: 0 5px;
    color: #2B8FF2 !important;
}

.pagination-btn.pagination-page:hover:not(:disabled),
.pagination-btn.pagination-page.active {
    color: #2B8FF2;
}

.pagination-btn.pagination-prev:hover,
.pagination-btn.pagination-next:hover {
    color: #2B8FF2;
}

.pagination-btn.pagination-page.active {
    text-decoration: underline;
    font-weight: 600;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 1023px) {
    .address-item {
        margin-bottom: 15px;
    }
}

/* ===================================
   BLOC INFORMATION ADRESSE FISCALE
   =================================== */

.fiscal-notice-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: -webkit-fill-available;
    flex: 0 0 49%;
}

.fiscal-notice-block:hover .fiscal-info-text {
    border-color: rgba(43, 143, 242, 0.25);
    box-shadow: 0 2px 5px rgba(43, 143, 242, 0.1);
}

.fiscal-spacer {
    flex: 1;
}

.fiscal-info-text {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #163C5D;
    margin: 0;
    line-height: 1.6;
    background-color: rgba(43, 143, 242, 0.07);
    border: 1px solid rgba(43, 143, 242, 0.15);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.fiscal-info-text .material-icons {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 5px;
    color: #163C5D;
}

.fiscal-info-text .contact-link {
    color: #163C5D;
    text-decoration: underline;
    font-weight: 500;
}

.fiscal-info-text .contact-link:hover {
    color: #2B8FF2;
}

@media (max-width: 768px) {
    .address-selector {
        display: flex;
        flex-direction: column;
    }

    .address-item {
        width: 100%;
        flex: 0 0 100%;
        padding: 12px;
        margin-bottom: 15px;
    }

    .address-locked-icon {
        position: static;
        margin-bottom: 10px;
        width: fit-content;
    }

    .address-actions {
        flex-direction: column;
    }

    .address-actions .btn {
        width: 100%;
    }

    #checkout-addresses-step {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .address-item-simple {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .address-content-simple {
        max-width: calc(100% - 30px);
        overflow: hidden;
    }

    .address-details-simple {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        max-width: 100%;
    }
}
