/* --- HABILLAGE MODERNE ET AÉRÉ --- */

/* 1. Carte globale blanche */
.acf-form, .fea-form {
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 40px !important; /* Un peu plus d'espace sur les bords intérieurs */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #f0f0f0 !important;
    max-width: 1000px !important;
    margin: 30px auto !important;
}

/* 2. Style des Onglets ACF */
.acf-tab-wrap {
    border-bottom: 2px solid #e2e8f0 !important;
    margin-bottom: 35px !important; /* Espacement augmenté sous la barre d'onglets */
}

ul.acf-tab-group {
    border: none !important;
    gap: 8px !important;
    display: flex !important;
}

ul.acf-tab-group li a {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom: none !important;
    border-radius: 8px 8px 0 0 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    padding: 12px 22px !important; /* Onglets plus confortables */
}

ul.acf-tab-group li.active a {
    background: #5cc9b2 !important;
    color: #ffffff !important;
    border-color: #5cc9b2 !important;
}

/* 3. AÉRATION ET ESPACEMENT DES CHAMPS */
.acf-field {
    margin-bottom: 25px !important; /* Espace vertical important entre chaque champ/ligne */
    padding: 0 !important;
    border: none !important;
}

/* Espacement entre le titre du champ (Label) et la case de saisie */
.acf-label {
    margin-bottom: 8px !important;
}

.acf-label label {
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 14px !important;
}

/* Style et hauteur des cases de saisie */
.acf-field input[type="text"], 
.acf-field input[type="email"], 
.acf-field input[type="url"],
.acf-field textarea,
.acf-field select {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important; /* Intérieur des cases plus respirant */
    font-size: 14px !important;
}

.acf-field input:focus, 
.acf-field textarea:focus {
    background-color: #ffffff !important;
    border-color: #5cc9b2 !important;
    box-shadow: 0 0 0 3px rgba(92, 201, 178, 0.15) !important;
}

/* 4. Bouton Enregistrer */
.acf-form-submit {
    margin-top: 35px !important; /* Espacement au-dessus du bouton */
}

.acf-form-submit input[type="submit"],
.fea-submit-button {
    background-color: #5cc9b2 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 14px 32px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer !important;
}
/* --- ADAPTATION RESPONSIVE (MOBILE & TABLETTE) --- */

@media (max-width: 768px) {
    
    /* 1. Réduire le padding de la carte sur mobile pour gagner de la place */
    .acf-form, .fea-form {
        padding: 20px 15px !important;
        margin: 10px auto !important;
    }

    /* 2. BARRE D'ONGLETS À DÉFILEMENT HORIZONTAL FLUIDE */
    .acf-tab-wrap {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important; /* Défilement doux sur iOS */
        padding-bottom: 5px !important;
        margin-bottom: 20px !important;
    }

    ul.acf-tab-group {
        display: inline-flex !important; /* Garde les onglets en ligne */
        flex-wrap: nowrap !important;
        gap: 6px !important;
    }

    ul.acf-tab-group li a {
        padding: 8px 14px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    /* 3. Passer les champs côte à côte en 100% de largeur sur mobile */
    .acf-field[data-width] {
        width: 100% !important;
    }
}
/* --- HABILLAGE ET UNIFORMISATION DES BLOCS IMAGES ACF --- */

/* 1. Unification du cadre d'aperçu d'image */
.acf-field-image .acf-image-uploader,
.acf-field-image .image-wrap,
.acf-field-image .uploader-editor {
    border: 2px dashed #cbd5e1 !important; /* Bordure pointillée moderne */
    border-radius: 12px !important;
    background-color: #f8fafc !important;
    padding: 8px !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
}

.acf-field-image .acf-image-uploader:hover {
    border-color: #5cc9b2 !important;
    background-color: #ffffff !important;
}

/* 2. Fixer la taille et le cadre de l'image (Rendu uniforme) */
.acf-field-image img {
    width: 100% !important;
    height: 180px !important; /* Hauteur fixe pour toutes les images */
    object-fit: cover !important; /* Recadre proprement l'image sans la déformer */
    border-radius: 8px !important;
    display: block !important;
}

/* 3. Espacement et aération entre les blocs photos */
.acf-field-image {
    margin-bottom: 30px !important;
    padding: 0 10px !important;
}

/* Alignement et espacement des boutons de modification/suppression d'image */
.acf-field-image .actions,
.acf-field-image .has-value .actions {
    margin-top: 8px !important;
    display: flex !important;
    gap: 8px !important;
    justify-content: center !important;
}

.acf-field-image .actions a {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

.acf-field-image .actions a:hover {
    background: #ef4444 !important; /* Rouge pour supprimer */
    color: #ffffff !important;
    border-color: #ef4444 !important;
}

/* ==========================================================
   LOOK DASHBOARD APP - CARTES & BOUTONS DYNAMIQUES
   ========================================================== */

/* 1. Structure globale */
.woocommerce-account .woocommerce {
    display: flex !important;
    flex-direction: column !important;
    max-width: 1000px !important;
    margin: 30px auto !important;
    gap: 25px !important;
}

/* 2. Cacher le menu latéral classique et le transformer en Grille de Cartes */
.woocommerce-MyAccount-navigation {
    width: 100% !important;
}

.woocommerce-MyAccount-navigation ul {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* 3 colonnes sur PC */
    gap: 15px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Base de toutes les cartes */
.woocommerce-MyAccount-navigation li {
    margin: 0 !important;
    list-style: none !important;
}

.woocommerce-MyAccount-navigation li a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 22px 15px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
}

.woocommerce-MyAccount-navigation li a:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08) !important;
    border-color: #5cc9b2 !important;
    color: #5cc9b2 !important;
}

/* 🌟 3. MISE EN AVANT DU BOUTON CENTRAL "MODIFIER MA FICHE" (HERO CARD) */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--ma-vitrine {
    grid-column: span 3 !important; /* Prend toute la largeur de la première ligne */
}

.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--ma-vitrine a {
    background: linear-gradient(135deg, #5cc9b2 0%, #3bb198 100%) !important;
    color: #ffffff !important;
    font-size: 18px !important;
    padding: 28px 20px !important;
    box-shadow: 0 8px 25px rgba(92, 201, 178, 0.35) !important;
    border: none !important;
    flex-direction: row !important; /* Icône et texte côte à côte */
    gap: 12px !important;
}

.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--ma-vitrine a:hover {
    transform: translateY(-3px) scale(1.01) !important;
    box-shadow: 0 12px 30px rgba(92, 201, 178, 0.45) !important;
    color: #ffffff !important;
}

/* 4. AJOUT D'ICÔNES AUTOMATIQUES (Dashicons WordPress) */
.woocommerce-MyAccount-navigation li a::before {
    font-family: "dashicons" !important;
    font-size: 26px !important;
    width: 26px !important;
    height: 26px !important;
    margin-bottom: 8px !important;
    display: inline-block !important;
}

/* Icône pour Modifier ma fiche (Magasin) */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--ma-vitrine a::before {
    content: "\f513" !important; /* Icône Store/Magasin */
    margin-bottom: 0 !important;
    font-size: 30px !important;
}

/* Icône Tableau de bord */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--dashboard a::before {
    content: "\f226" !important;
}

/* Icône Commandes */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--orders a::before {
    content: "\f174" !important;
}

/* Icône Téléchargements */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--downloads a::before {
    content: "\f106" !important;
}

/* Icône Adresse */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--edit-address a::before {
    content: "\f102" !important;
}

/* Icône Détails du compte */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--edit-account a::before {
    content: "\f110" !important;
}

/* Icône Se déconnecter */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a::before {
    content: "\f153" !important;
    color: #ef4444 !important;
}

/* 5. Style de la Zone de contenu en dessous */
.woocommerce-MyAccount-content {
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 30px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
    margin-top: 10px !important;
}

/* 6. Adaptation Mobile */
@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation ul {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 cartes par ligne sur mobile */
    }
    
    .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--ma-vitrine {
        grid-column: span 2 !important; /* Garde le grand bouton sur toute la largeur */
    }
}

/* ==========================================================
   MISE EN AVANT DU BOUTON "PARRAINAGE" DANS LE MENU
   ========================================================== */

/* Carte "Parrainage" : couleur distincte pour qu'elle ressorte visuellement */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--parrainage a {
    background: linear-gradient(135deg, #f2a65e 0%, #d97b3f 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 8px 25px rgba(217, 123, 63, 0.35) !important;
}

.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--parrainage a:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 30px rgba(217, 123, 63, 0.45) !important;
    color: #ffffff !important;
}

/* Icône "Parrainage" : symbole € au lieu d'un dashicon */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--parrainage a::before {
    font-family: inherit !important;
    content: "€" !important;
    font-size: 26px !important;
    font-weight: 800 !important;
}