:root {
    --cdfranchise-text-color: #000000; /* Fallback si le CSS inline n'est pas chargé */
}

:root {
    --cdfranchise-primary-color: #000000; /* Fallback si le CSS inline n'est pas chargé */
}

:root {
    --cdfranchise-secondary-color: #000000; /* Fallback si le CSS inline n'est pas chargé */
}

:root {
    --cdfranchise-button-border-radius: 0px; /* Fallback si le CSS inline n'est pas chargé */
}

:root {
    --cdfranchise-border-radius-searchbar: 0px; /* Fallback si le CSS inline n'est pas chargé */
}

:root {
    --cdfranchise-border-radius-card: 0px; /* Fallback si le CSS inline n'est pas chargé */
}
:root {
    --cdfranchise-border-radius-map: 0px; /* Fallback si le CSS inline n'est pas chargé */
}

:root {
    --cdfranchise-box-shadow: none; /* Fallback si le CSS inline n'est pas chargé */
}

/* Appliquer le style Bulma au conteneur principal Select2 */
.select-departement {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    border-radius: var(--cdfranchise-button-border-radius) !important; /* Même arrondi que ton input */
    border: 0 !important; /* Couleur de la bordure Bulma */
    padding: 10px 15px !important; /* Espacement pour correspondre au style input */
    font-size: calc(0.6rem + 0.5vw) !important; /* Taille de police adaptative */

    background-color: white !important;
    width: 100% !important;
    transition: border-color 0.25s ease-in-out, box-shadow 0.25s ease-in-out !important;
    line-height: 1.2 !important; /* Pour une bonne lisibilité */

}

/* Style de focus pour le select */
.select-departement:focus{
    outline: 0 !important;
    border:0 !important;
}
.select-departement:hover {
    outline: none !important;
}

/* Style pour l'icône flèche du select */
.select-departement::after {
    content: '▼'; /* Icône de flèche */
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 0.75em !important;
  
}

/* Style pour l'élément contenant le select */
.select-departement-container {
    position: relative !important;
    border-radius: var(--cdfranchise-button-border-radius) !important;
    padding: 10px 15px !important;
    box-shadow: var(--cdfranchise-box-shadow) !important;
    background-color: white !important;
    display: flex !important;
    align-items: center !important;
}

/* Option dropdown si nécessaire */
.select-departement option {
    color: #4a4a4a !important;
    padding: 10px !important;
}

.cdfranchise-departement-button {
    border-radius: var(--cdfranchise-button-border-radius) !important;
    border-color: var(--cdfranchise-primary-color) !important;
    color: var(--cdfranchise-text-color) !important;
    background-color: var(--cdfranchise-primary-color) !important;
    font-size: calc(0.5rem + 0.5vw) !important; /* La police s'adapte à la largeur de l'écran */
    width: 400px !important; /* Largeur par défaut pour les écrans plus larges */
}

.cdfranchise-departement-button:hover {
    transform: scale(0.95) !important;
    transition: 0.5s !important;
}

/* Style mobile pour le select */
@media (max-width: 768px) {
    .select-departement {
        font-size: calc(0.5rem + 1vw) !important; /* Adaptation de la taille de police */
    }
}




.cdfranchise-ville-form {
    background-color: white !important;
    border-radius:var(--cdfranchise-border-radius-searchbar) !important;
    padding:10px 15px 10px 10px !important;
    border:0 !important;
    display: flex !important;
    flex-direction: right !important;
    box-shadow: var(--cdfranchise-box-shadow) !important;
    position: relative !important;
    z-index: 1200 !important;
    overflow: visible !important;
}

.cdfranchise-ville {
    border:0 !important;
    background-color: transparent !important;
    width:100% !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    outline:none !important;
    box-shadow: none !important;
}

.cdfranchise-ville::placeholder {
    font-size: 14px !important;
    opacity: 0.75 !important;
}

.findsearch {
    display: none;
    mask-image: url('/wp-content/plugins/maps-franchise/css/magnifying-glass-thin.svg');
    background-size: contain;
    width: 20px;
    height: 20px;
    background-color: white;
    color: var(--cdfranchise-text-color) !important;
    mask-repeat: no-repeat;
    mask-position: center;
    


}
.findinter {
    display: inline;
}




.cdfranchise-ville:focus {
    border:0 !important;
    outline:none !important;
}



.cdfranchise-ville-button {
    border-radius: var(--cdfranchise-button-border-radius) !important;
    border-color: var(--cdfranchise-primary-color) !important;
    color: var(--cdfranchise-text-color) !important;
    background-color: var(--cdfranchise-primary-color) !important;
    font-size: calc(0.5rem + 0.5vw) !important; /* La police s'adapte à la largeur de l'écran */
    width: 400px !important; /* Largeur par défaut pour les écrans plus larges */
}

.cdfranchise-ville-button:hover {
    transform: scale(0.95) !important;
    transition: 0.5s !important;
}

.cdfranchise-autocomplete-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    max-height: min(320px, calc(100vh - 120px));
    overflow-y: auto;
}

.cdfranchise-ville-form .cdfranchise-autocomplete-results .cdfranchise-autocomplete-item {
    width: 100% !important;
    height: auto !important;
    min-height: 40px !important;
    display: block !important;
    appearance: none !important;
    border: 0 !important;
    background: #f7f7f7 !important;
    color: #1f2937 !important;
    text-align: left !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    text-transform: none !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: break-word !important;
    transform: none !important;
}

.cdfranchise-ville-form .cdfranchise-autocomplete-results .cdfranchise-autocomplete-item:hover,
.cdfranchise-ville-form .cdfranchise-autocomplete-results .cdfranchise-autocomplete-item:focus,
.cdfranchise-ville-form .cdfranchise-autocomplete-results .cdfranchise-autocomplete-item:active {
    background: #ececec !important;
    color: #111827 !important;
    outline: 2px solid rgba(207, 32, 39, 0.25) !important;
    outline-offset: 2px !important;
}

/* Styles pour les écrans de téléphone */
@media (max-width: 768px) {
    .cdfranchise-ville-button {
        width: 52px !important; /* Largeur de 50% de sa div parent */
        min-width: 52px !important;
        height: 52px !important;
        font-size: calc(0.5rem + 1vw) !important; /* La police devient plus petite sur les petits écrans */
        padding:0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .cdfranchise-departement-button {
        width: 40px !important;
        font-size: calc(0.5rem + 1vw) !important; /* Adaptation de la taille de police */
        padding-left:10px !important;
    }

    .cdfranchise-ville {
        font-size: 16px !important;
        padding: 0 14px !important;
    }
    .cdfranchise-ville::placeholder {
        font-size: 13.5px !important;
    }
    .findsearch {
        display: block !important;
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 20px !important;
        background-color: #fff !important;
        -webkit-mask: url('/wp-content/plugins/maps-franchise/css/magnifying-glass-thin.svg') center / contain no-repeat !important;
        mask: url('/wp-content/plugins/maps-franchise/css/magnifying-glass-thin.svg') center / contain no-repeat !important;
    }
    .findinter {
        display:none !important;
    }
}

.cdfranchise-map-render {
    display: flex;
    justify-content: space-between;
    gap:15px;
    
}

.cdfranchise-custom-google-map {
    border-radius: var(--cdfranchise-border-radius-map) !important;
    width: 100%; 
    height: 500px;
    position: relative;
    z-index: 1;
}
.is-cdfranchise-primary {
    background-color: var(--cdfranchise-primary-color) !important;
    color: var(--cdfranchise-text-color) !important;
    border-radius: var(--cdfranchise-button-border-radius) !important;
    border-color: var(--cdfranchise-primary-color)4d !important;
}


.is-cdfranchise-secondary {
    border-radius: var(--cdfranchise-button-border-radius) !important;

}

.cdfranchise-liste-render-franchise {
    width: 50%;
    height:500px;
    overflow-y: scroll;
    display: flex;
    flex-direction: column;
    gap:0;
    scrollbar-color:white;
    scrollbar-width: none;
    
}

@media (max-width: 1023px) {
  .cdfranchise-liste-render-franchise {
    display: none;
  }
}

.cdfranchise-liste-render-franchise .card {
    border-radius: var(--cdfranchise-border-radius-card) !important;
}

/* Barre de recherche ville accessible */
.cdfranchise-ville-form {
    position: relative !important;
    z-index: 1200 !important;
    display: block !important;
    overflow: visible !important;
    padding: 14px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: var(--cdfranchise-border-radius-searchbar) !important;
    background-color: #ffffff !important;
    box-shadow: var(--cdfranchise-box-shadow) !important;
}

.cdfranchise-ville-label {
    display: block;
    margin: 0 0 8px;
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.cdfranchise-ville-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.cdfranchise-ville-field {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    min-height: 54px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cdfranchise-ville-field:focus-within {
    border-color: #cf2027;
    box-shadow: 0 0 0 3px rgba(207, 32, 39, 0.2);
}

.cdfranchise-ville-icon {
    flex: 0 0 auto;
    margin-right: 10px;
    color: #64748b;
    font-size: 20px;
}

.cdfranchise-ville-form .cdfranchise-ville {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #111827 !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
}

.cdfranchise-ville-form .cdfranchise-ville::placeholder {
    color: #64748b !important;
    font-size: 16px !important;
    opacity: 1 !important;
}

.cdfranchise-ville-form .cdfranchise-ville-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-height: 54px !important;
    width: auto !important;
    min-width: 230px !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    transition: transform 0.2s ease, filter 0.2s ease !important;
}

.cdfranchise-ville-form .cdfranchise-ville-button:hover {
    transform: translateY(-1px) !important;
    filter: brightness(0.94);
}

.cdfranchise-ville-form .cdfranchise-ville-button:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: -5px !important;
    box-shadow: 0 0 0 3px #111827 !important;
}

.cdfranchise-ville-form .cdfranchise-ville-button:disabled {
    cursor: wait !important;
    opacity: 0.72 !important;
    transform: none !important;
}

.cdfranchise-ville-form .cdfranchise-autocomplete-results[hidden] {
    display: none !important;
}

.cdfranchise-ville-form .cdfranchise-autocomplete-results .cdfranchise-autocomplete-item {
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
}

.cdfranchise-ville-form .cdfranchise-autocomplete-results .cdfranchise-autocomplete-item:hover,
.cdfranchise-ville-form .cdfranchise-autocomplete-results .cdfranchise-autocomplete-item.is-active {
    background: #ececec !important;
    color: #111827 !important;
    outline: 2px solid rgba(207, 32, 39, 0.25) !important;
    outline-offset: 2px !important;
}

.cdfranchise-ville-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.cdfranchise-ville-error {
    margin: 9px 2px 0 !important;
    color: #9f1239 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

.cdfranchise-ville-error[hidden] {
    display: none !important;
}

.cdfranchise-ville-form.has-error .cdfranchise-ville-field {
    border-color: #be123c;
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.15);
}

@media (max-width: 768px) {
    .cdfranchise-ville-form {
        padding: 12px !important;
    }

    .cdfranchise-ville-row {
        flex-direction: column;
        gap: 10px;
    }

    .cdfranchise-ville-form .cdfranchise-ville-button {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 50px !important;
        padding: 12px 18px !important;
        font-size: 16px !important;
    }

    .cdfranchise-ville-form .findsearch {
        display: none !important;
    }

    .cdfranchise-ville-form .findinter {
        display: inline !important;
    }

    .cdfranchise-ville-form .cdfranchise-autocomplete-results {
        max-height: min(280px, calc(100vh - 100px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .cdfranchise-ville-field,
    .cdfranchise-ville-button {
        transition: none !important;
    }
}

/* Proportions finales : carte compacte, pas de forme pilule héritée */
.cdfranchise-ville-form {
    padding: 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1) !important;
}

.cdfranchise-ville-label {
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 650;
}

.cdfranchise-ville-field {
    min-height: 50px;
    padding: 0 14px;
    border-radius: 10px;
}

.cdfranchise-ville-form .cdfranchise-ville {
    min-height: 48px !important;
}

.cdfranchise-ville-form .cdfranchise-ville-button {
    min-width: 215px !important;
    min-height: 50px !important;
    padding: 11px 20px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
}

@media (max-width: 768px) {
    .cdfranchise-ville-form {
        padding: 11px !important;
        border-radius: 14px !important;
    }

    .cdfranchise-ville-form .cdfranchise-ville-button {
        min-height: 48px !important;
    }
}

/* Bouton isolé des anciennes règles mobiles du shortcode */
.cdfranchise-ville-submit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 215px !important;
    min-height: 50px !important;
    padding: 11px 20px !important;
    border: 2px solid var(--cdfranchise-primary-color) !important;
    border-radius: 10px !important;
    background: var(--cdfranchise-primary-color) !important;
    color: var(--cdfranchise-text-color) !important;
    font: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, filter 0.2s ease !important;
}

.cdfranchise-ville-submit:hover {
    transform: translateY(-1px) !important;
    filter: brightness(0.94);
}

.cdfranchise-ville-submit:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: -5px !important;
    box-shadow: 0 0 0 3px #111827 !important;
}

.cdfranchise-ville-submit:disabled {
    cursor: wait !important;
    opacity: 0.72 !important;
    transform: none !important;
}

@media (max-width: 768px) {
    .cdfranchise-ville-submit {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 48px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cdfranchise-ville-submit {
        transition: none !important;
    }
}
