/* ===================================
   GESTION DES ADRESSES - STYLE PREMIUM LUXE
   =================================== */

.address-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); /* Ombre simplifiée */
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Transitions simplifiées */
    position: relative;
    will-change: transform; /* Optimisation GPU */
}

.address-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); /* Effet hover simplifié */
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.2);
}

.address-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #a855f7, #c084fc);
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.2s ease; /* Transition réduite */
}

.address-card:hover::before {
    opacity: 1;
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    flex-wrap: nowrap;
    gap: 10px;
}

.address-header h4 {
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    letter-spacing: -0.025em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    flex: 1;
}

.address-header h4::before {
    content: "🏢";
    margin-right: 12px;
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.shipping-addresses .address-header h4::before {
    content: "🚚";
}

/* Boutons d'action alignés à droite du titre */
.address-header .address-actions {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
    align-items: center;
}

.address-header .address-actions button {
    padding: 8px;
    font-size: 0;
    border-radius: 8px;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-header .address-actions button svg {
    width: 16px;
    height: 16px;
}

.default-badge {
    background: linear-gradient(135deg, #10b981, #059669, #047857);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 
        0 4px 12px rgba(16, 185, 129, 0.3),
        0 2px 4px rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
    min-width: fit-content;
}

.default-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.default-badge:hover::before {
    left: 100%;
}

.address-content {
    margin: 20px 0;
    line-height: 1.7;
}

.address-content p {
    margin: 0 0 8px 0;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.address-content p:first-child {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.address-content p:last-child {
    margin-bottom: 0;
}

.address-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.address-actions button {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.025em;
}

.btn-edit-address,
.btn-edit-billing-address {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-edit-address:hover,
.btn-edit-billing-address:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed, #9333ea);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-set-default,
.btn-set-default-billing {
    background: linear-gradient(135deg, #f59e0b, #f97316, #ea580c);
    color: white;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-set-default:hover,
.btn-set-default-billing:hover {
    background: linear-gradient(135deg, #d97706, #ea580c, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.btn-delete-address,
.btn-delete-billing-address {
    background: linear-gradient(135deg, #ef4444, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-delete-address:hover,
.btn-delete-billing-address:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

/* Header premium avec boutons alignés */
.addresses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 24px 0;
    border-bottom: 2px solid rgba(226, 232, 240, 0.8);
    position: relative;
}

.addresses-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    border-radius: 1px;
}

.addresses-header h3 {
    color: #1e293b;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #1e293b, #475569);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-add-billing-address,
.btn-add-address {
    background: linear-gradient(135deg, #8b5cf6, #a855f7, #c084fc);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 
        0 6px 20px rgba(139, 92, 246, 0.3),
        0 2px 8px rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.025em;
    backdrop-filter: blur(8px);
}

.btn-add-billing-address::before,
.btn-add-address::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-add-billing-address:hover::before,
.btn-add-address:hover::before {
    left: 100%;
}

.btn-add-billing-address:hover,
.btn-add-address:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea, #a855f7);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(139, 92, 246, 0.4),
        0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-add-billing-address svg,
.btn-add-address svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.btn-add-billing-address:hover svg,
.btn-add-address:hover svg {
    transform: rotate(90deg) scale(1.1);
}

/* Suppression forçée des cartes vides et en-têtes dupliqués */
.no-addresses,
.address-card .no-addresses,
#shipping-addresses-list .no-addresses,
#billing-addresses-list .no-addresses,
#shipping-addresses-list .addresses-header,
#billing-addresses-list .addresses-header {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Masquer tous les en-têtes dupliqués dans les containers d'adresses */
.addresses-grid .addresses-header {
    display: none !important;
}

/* Performance : transitions réduites pour les onglets */
.tab-panel {
    transition: none !important; /* Suppression complète des transitions pour éliminer le lag */
}

.tab-panel.active {
    opacity: 1;
    display: block;
}

.tab-panel:not(.active) {
    opacity: 0;
    display: none; /* Masquage complet pour optimiser les performances */
    pointer-events: none;
}

/* Réduction des animations coûteuses - VERSION ULTRA-OPTIMISÉE */
.address-card {
    animation: none !important; /* Supprimer toutes les animations */
    transition: transform 0.15s ease; /* Transition ultra-rapide */
}

.address-card:hover {
    transform: translateY(-1px); /* Effet minimal */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); /* Ombre simplifiée */
}

/* Supprimer les effets coûteux */
.address-card::before {
    display: none !important; /* Supprimer la barre supérieure */
}

/* Optimisation des boutons */
.address-actions button {
    transition: background-color 0.1s ease !important; /* Transition minimale */
}

.address-actions button:hover {
    transform: none !important; /* Pas de transform */
}

/* Responsive premium */
@media (max-width: 768px) {
    .address-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .addresses-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        text-align: center;
    }
    
    .addresses-header h3 {
        font-size: 1.5rem;
    }
    
    .btn-add-billing-address,
    .btn-add-address {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
    }
    
    .address-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .address-actions {
        flex-direction: column;
    }
    
    .address-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Amélioration des icônes */
.address-actions button svg,
.btn-add-address svg,
.btn-add-billing-address svg {
    transition: all 0.3s ease;
}

.address-actions button:hover svg {
    transform: scale(1.1);
}

/* Effet de profondeur pour le container */
#shipping-addresses-list,
#billing-addresses-list {
    position: relative;
}

#shipping-addresses-list::before,
#billing-addresses-list::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.02), rgba(168, 85, 247, 0.02));
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#shipping-addresses-list:hover::before,
#billing-addresses-list:hover::before {
    opacity: 1;
}

/* ===================================
   CHECKBOXES PREMIUM LUXE - VERSION CORRIGÉE
   =================================== */

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    user-select: none;
    border-radius: 6px;
    margin: 16px 0;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid #e2e8f0;
    width: auto; /* Largeur automatique */
    min-width: 200px; /* Largeur minimum */
    box-sizing: border-box;
    height: auto; /* Hauteur automatique */
    min-height: 44px;
}

.checkbox-wrapper:hover {
    background: rgba(168, 85, 247, 0.03);
}

.checkbox-wrapper input[type="checkbox"] {
    /* Reset complet */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Dimensions fixes */
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    
    /* Style */
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
    
    /* Assurer la visibilité */
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.checkbox-wrapper input[type="checkbox"]:hover {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.1);
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

/* Checkmark avec double méthode pour compatibilité */
.checkbox-wrapper input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Alternative avec symbole Unicode */
.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.checkbox-wrapper input[type="checkbox"]:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.checkbox-wrapper span {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    flex: 0 1 auto;
    white-space: nowrap; /* Forcer sur une ligne */
    display: block;
    user-select: none;
    padding: 2px 0;
}

.checkbox-wrapper:hover span {
    color: #1f2937;
}

.checkbox-wrapper.checked {
    background: rgba(168, 85, 247, 0.05);
}

.checkbox-wrapper.checked span {
    color: #8b5cf6;
    font-weight: 600;
}

/* Styles spécifiques pour les modals - VERSION CORRIGÉE */
.address-modal .checkbox-wrapper {
    margin: 16px 0;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.address-modal .checkbox-wrapper:hover {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.2);
}

/* Forcer la visibilité du checkbox dans les modals */
.address-modal .checkbox-wrapper input[type="checkbox"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    flex-shrink: 0;
    width: 20px !important;
    height: 20px !important;
}

/* Ajustement du texte dans les modals */
.address-modal .checkbox-wrapper span {
    flex: 0 1 auto;
    white-space: nowrap;
    line-height: 1.2;
    padding: 2px 0;
    margin: 0;
    display: block;
    font-size: 0.9rem;
}

/* Animation de sélection - VERSION CORRIGÉE */
.checkbox-wrapper.checked {
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .checkbox-wrapper {
        padding: 16px;
        gap: 16px;
    }
    
    .checkbox-wrapper input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    
    .checkbox-wrapper span {
        font-size: 1rem;
    }
}
