/**
 * Styles pour Feather Icons dans Mon Compte
 * Assure que les icônes s'affichent correctement
 */

/* ========== BOUTONS D'ACTION AVEC FEATHER ICONS ========== */

/* Container des actions */
#mon-compte .address-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

/* Style des boutons */
#mon-compte .address-actions button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    background: white !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Feather Icons dans les boutons */
#mon-compte .address-actions button i[data-feather],
#mon-compte .address-actions button svg.feather {
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2 !important;
}

/* Couleurs spécifiques pour chaque action */
#mon-compte .btn-edit-address,
#mon-compte .btn-edit-billing-address {
    border-color: #2196F3 !important;
    color: #2196F3 !important;
}

#mon-compte .btn-edit-address:hover,
#mon-compte .btn-edit-billing-address:hover {
    background: #E3F2FD !important;
    border-color: #1976D2 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2) !important;
}

#mon-compte .btn-delete-address,
#mon-compte .btn-delete-billing-address {
    border-color: #f44336 !important;
    color: #f44336 !important;
}

#mon-compte .btn-delete-address:hover,
#mon-compte .btn-delete-billing-address:hover {
    background: #FFEBEE !important;
    border-color: #d32f2f !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.2) !important;
}

#mon-compte .btn-set-default,
#mon-compte .btn-set-default-billing {
    border-color: #FFC107 !important;
    color: #FFC107 !important;
}

#mon-compte .btn-set-default:hover,
#mon-compte .btn-set-default-billing:hover {
    background: #FFF8E1 !important;
    border-color: #FFA000 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.2) !important;
}

/* Active state */
#mon-compte .address-actions button:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

/* S'assurer que les SVG héritent de la couleur */
#mon-compte .address-actions button svg {
    stroke: currentColor !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #mon-compte .address-actions {
        gap: 4px !important;
    }
    
    #mon-compte .address-actions button {
        width: 32px !important;
        height: 32px !important;
    }
    
    #mon-compte .address-actions button svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Header responsive */
    #mon-compte .address-header {
        gap: 8px !important;
    }
    
    #mon-compte .address-header h4 {
        font-size: 0.95rem !important;
        max-width: 150px !important; /* Limite la largeur du titre */
    }
    
    #mon-compte .default-badge {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
    }
}

/* Très petits écrans */
@media (max-width: 400px) {
    #mon-compte .address-header {
        flex-wrap: wrap !important; /* Permet le retour à la ligne si vraiment trop petit */
    }
    
    #mon-compte .address-header > div:first-child {
        flex: 1 1 100% !important;
        margin-bottom: 8px !important;
    }
    
    #mon-compte .address-actions {
        flex: 0 0 auto !important;
    }
}

/* Animation de chargement pour les icônes */
@keyframes fadeInIcon {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

#mon-compte .address-actions button svg.feather {
    animation: fadeInIcon 0.3s ease !important;
}

/* Fallback si Feather ne charge pas - afficher du texte */
#mon-compte .address-actions button:empty:after {
    font-size: 12px !important;
    font-weight: bold !important;
}

#mon-compte .btn-edit-address:empty:after,
#mon-compte .btn-edit-billing-address:empty:after {
    content: "✎" !important;
}

#mon-compte .btn-delete-address:empty:after,
#mon-compte .btn-delete-billing-address:empty:after {
    content: "✕" !important;
}

#mon-compte .btn-set-default:empty:after,
#mon-compte .btn-set-default-billing:empty:after {
    content: "★" !important;
}

/* Fix pour l'alignement du header de la carte */
#mon-compte .address-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
}

/* Partie gauche : titre et badge */
#mon-compte .address-header > div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important; /* Permet au texte de se tronquer si nécessaire */
}

/* Titre de l'adresse */
#mon-compte .address-header h4 {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Badge par défaut amélioré */
#mon-compte .default-badge {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: white !important;
    padding: 4px 10px !important;
    border-radius: 15px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important; /* Empêche le badge de se réduire */
}

#mon-compte .default-badge:before {
    content: "✓" !important;
    margin-right: 3px !important;
    font-weight: bold !important;
}

/* Actions - partie droite */
#mon-compte .address-actions {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    flex-shrink: 0 !important; /* Empêche les boutons de se réduire */
}

/* S'assurer que les cartes ont un bon espacement */
#mon-compte .address-card {
    padding: 20px !important;
    margin-bottom: 15px !important;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease !important;
}

#mon-compte .address-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    transform: translateY(-2px) !important;
}
