.leaflet-pin-modal, #leaflet-pin-modal {
    overflow: hidden;
}
/**
 * Styles CSS pour le composant WPBakery Leaflet Map
 */

/* Empêcher le scroll de fond quand une modale est ouverte */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    height: 100%;
}

/* Container principal de la carte */
.leaflet-map-container {
    margin-bottom: 2em;
    position: relative;
}

/* Titre de la carte */
.leaflet-map-title {
    margin-bottom: 0.5em;
    color: #000 !important;
    text-align: left;
    font-family: 'open_sauce_oneextrabold';
    font-weight: 800;
    font-style: ExtraBold;
    font-size: 40px !important;
    line-height: 135%;
    letter-spacing: 0%;
}

/* Description de la carte */
.leaflet-map-description {
    margin-bottom: 1em;
    color: #000 !important;
    text-align: left;
    font-family: Inter;
    font-weight: 400;
    font-style: Regular;
    font-size: 16px !important;
    line-height: 140%;
    letter-spacing: 0%;
}
/* .leaflet-map-title,
.leaflet-map-description {
    max-width: 50%;
} */

/* Container de la carte Leaflet */
.leaflet-map {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Popups personnalisés */
.leaflet-popup-content h4 {
    margin: 0 0 0.5em 0;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
}

.leaflet-popup-content p {
    margin: 0.5em 0;
    line-height: 1.4;
}

.leaflet-popup-content small {
    color: #888;
    font-size: 0.9em;
}

/* Contrôle de chargement */
.leaflet-control-loading {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 5px 10px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    font-size: 16px;
    animation: spin 1s linear infinite;
    color: #007cba;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .leaflet-map-title {
        font-size: 1.5em;
    }
    
    .leaflet-map-description {
        font-size: 0.9em;
        padding: 0 1em;
    }
    
    .leaflet-map {
        border-radius: 4px;
    }
    
    /* Ajustements pour les popups sur mobile */
    .leaflet-popup-content {
        font-size: 0.9em;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .leaflet-map-title {
        font-size: 1.3em;
    }
    
    .leaflet-map-description {
        font-size: 0.85em;
    }
    
    /* Réduire la taille des contrôles sur très petits écrans */
    .leaflet-control-zoom {
        transform: scale(0.9);
    }
    
    .leaflet-control-attribution {
        font-size: 0.7em;
    }
}

/* Styles pour l'édition dans WPBakery */
.vc_element .leaflet-map {
    min-height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vc_element .leaflet-map:before {
    content: "📍 Carte Leaflet";
    color: #999;
    font-size: 1.2em;
}

/* Pins personnalisés SVG */
.custom-leaflet-marker {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-leaflet-marker svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.custom-leaflet-marker:hover svg {
    transform: scale(1.2);
}

/* Amélioration des markers par défaut (fallback) */
.leaflet-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Style pour les clusters de markers (si utilisé plus tard) */
.marker-cluster {
    background-color: rgba(0, 124, 186, 0.8);
    border-radius: 50%;
    color: white;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster-small {
    width: 40px;
    height: 40px;
    font-size: 12px;
}

.marker-cluster-medium {
    width: 50px;
    height: 50px;
    font-size: 14px;
}

.marker-cluster-large {
    width: 60px;
    height: 60px;
    font-size: 16px;
}

/* Animation pour l'apparition des markers */
@keyframes markerFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.leaflet-marker-icon {
    animation: markerFadeIn 0.3s ease-out;
}

/* Couleur noire pour les boutons de zoom + et - */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    color: #000 !important;
}

/* Style pour les attributions */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 0.8em;
}

/* Assurer que la carte prend toute la largeur disponible */
.leaflet-map-container .leaflet-map {
    width: 100% !important;
}

/* Correction pour les problèmes de z-index avec WPBakery */
.vc_row .leaflet-map-container {
    position: relative;
    z-index: 1;
}

/* Style pour les erreurs de géocodage */
.geocoding-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

/* ============================================
   STYLES POUR LA MODAL NATIVE <dialog>
   ============================================ */

.pin-modal {
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    max-width: 95vw;
    max-height: 90vh;
    min-width: 800px;
    width: fit-content;
    min-height: fit-content;
    background: #1a2332;
    overflow: visible;
}

.pin-modal::backdrop {
    /* background: rgba(0, 0, 0, 0.8); */
    background: #06131F4D;
}

.modal-container {
    background: #06131F;
    padding: 30px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    width: fit-content;
    height: fit-content;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    max-height: 540px;
}

.modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: white;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-content {
    padding: 0;
    max-height: calc(100vh - 80px);
    overflow-y: auto; /* autoriser le scroll dans la modal */
    -webkit-overflow-scrolling: touch; /* inertie iOS */
    overscroll-behavior: contain; /* éviter le scroll chaining sur desktop */
}

/* Layout principal horizontal */
.modal-layout {
    display: flex;
    gap: 20px;
    height: 100%;
    min-height: 460px;
    width: fit-content;
}

/* Partie gauche - Image */
.modal-left {
    flex: 1;
    background: #1a2332;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 24px 0 0 24px;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 24px 0 0 24px;
}

.modal-image-default {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 24px 0 0 24px;
}

.default-image-content {
    text-align: center;
    font-size: 2em;
    opacity: 0.8;
}

.default-image-content i {
    display: block;
    margin-bottom: 10px;
    font-size: 3em;
}

/* Partie droite - Contenu */
.modal-right {
    flex: 2;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: white;
    position: relative;
    border-radius: 20px;
    min-width: 400px;
    width: fit-content;
}

/* @media (min-width: 1024px) {
    .modal-left, .modal-right {
        margin-bottom: 90px;
    }
} */

/* En-tête avec logo et drapeau */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;;
    border-bottom: 1px solid #00EF81;
}

.modal-logo {
    max-width: 260px;
    max-height: 70px;
}

.modal-logo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
}

.modal-header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-flag {
    font-size: 2.5em;
    line-height: 1;
    margin-left: 15px;
}

/* Titre principal */
.modal-title {
    font-family: 'Inter';
    margin: 0 0 25px 0;
    font-size: 30px !important;
    font-weight: 800;
    color: #1a2332 !important;
    line-height: 100%;
    letter-spacing: -0.5px;
    word-wrap: break-word !important;
    overflow-wrap: break-word;
    hyphens: auto;

letter-spacing: 0%;

}

/* Description */
.modal-description {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1.05em;
    margin-bottom: 20px;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Informations de localisation */
.modal-location-info {
    margin-bottom: 20px;
}

.modal-address,
.modal-coordinates {
    margin: 8px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
    color: #666;
}

/* Icônes personnalisées */
.modal-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.modal-icon-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.modal-icon-item i {
    font-size: 1.4em;
    color: #007cba;
    min-width: 24px;
    text-align: center;
}

.modal-icon-item .modal-icon-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    min-width: 24px;
    border-radius: 4px;
}

.modal-icon-item span {
    font-size: 1em;
    color: #333;
    font-weight: 500;
}

/* Actions - Bouton principal */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    /* margin-top: auto; */
    padding-top: 30px;
}

.btn-primary {
    background: #48bb78;
    color: white !important;
    border: none;
    padding: 16px 35px;
    border-radius: 30px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.25);
    letter-spacing: 0.2px;
}

.btn-primary:hover {
    transition: all .3s;
    opacity: .8;
    /* background: #38a169; */
    /* transform: translateY(-2px); */
    /* box-shadow: 0 8px 25px rgba(72, 187, 120, 0.35); */
}

/* Anciens boutons (cachés par défaut) */
.btn-directions,
.btn-share {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-directions:hover,
.btn-share:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* Responsive pour la modal */
@media (max-width: 1024px) {
    .pin-modal {
        min-width: 90vw;
        width: fit-content;
        max-width: 90vw;
        min-height: fit-content;
        border-radius: 20px;
    }
    
    .modal-container {
        border-radius: 20px;
        min-height: 460px;
    }
    
    .modal-layout {
        flex-direction: column;
        min-height: 460px;
        width: 100%;
    }
    
    .modal-left {
        flex: none;
        height: 280px;
        border-radius: 20px 20px 0 0;
        width: 100%;
    }
    
    .modal-image,
    .modal-image img,
    .modal-image-default {
        border-radius: 20px 20px 0 0;
    }
    
    .modal-right {
        flex: 1;
        padding: 40px 35px 35px 35px;
        border-radius: 0 0 20px 20px;
        min-width: auto;
        width: 100%;
    }
    
    .modal-title {
        font-size: 1.8em;
    }
    
    .modal-description {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .pin-modal {
        min-width: 95vw;
        width: fit-content;
        max-width: 95vw;
        min-height: fit-content;
        border-radius: 18px;
    }
    
    .modal-container {
        border-radius: 18px;
        min-height: 420px;
    }
    
    .modal-left {
        height: 240px;
        border-radius: 18px 18px 0 0;
        width: 100%;
    }
    
    .modal-image,
    .modal-image img,
    .modal-image-default {
        border-radius: 18px 18px 0 0;
    }
    
    .modal-right {
        padding: 30px 25px 25px 25px;
        border-radius: 0 0 18px 18px;
        min-width: auto;
        width: 100%;
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .modal-logo {
        align-self: flex-end;
        max-width: 180px;
        max-height: 55px;
    }
    
    .modal-title {
        font-size: 1.6em;
        margin-bottom: 18px;
    }
    
    .modal-description {
        font-size: 0.98em;
        margin-bottom: 25px;
    }
    
    .modal-icons {
        flex-direction: column;
        gap: 15px;
        margin: 15px 0 25px 0;
    }
    
    .btn-primary {
        width: 100%;
        min-width: auto;
        padding: 14px 25px;
    }
}

@media (max-width: 480px) {
    .pin-modal {
        min-height: fit-content;
        border-radius: 16px;
    }
    
    .modal-container {
        border-radius: 16px;
        min-height: 380px;
    }
    
    .modal-left {
        height: 200px;
        border-radius: 16px 16px 0 0;
        width: 100%;
    }
    
    .modal-image,
    .modal-image img,
    .modal-image-default {
        border-radius: 16px 16px 0 0;
    }
    
    .modal-right {
        padding: 25px 20px 20px 20px;
        border-radius: 0 0 16px 16px;
        min-width: auto;
        width: 100%;
    }
    
    .modal-header {
        margin-bottom: 20px;
    }
    
    .modal-logo {
        max-width: 140px;
        max-height: 45px;
    }
    
    .modal-flag {
        font-size: 2em;
    }
    
    .modal-title {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .modal-description {
        font-size: 0.92em;
        margin-bottom: 20px;
    }
    
    .modal-icons {
        padding: 15px;
        margin: 15px 0 20px 0;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 16px;
        top: 15px;
        right: 15px;
    }
    
    .btn-primary {
        padding: 13px 25px;
        font-size: 0.95em;
        border-radius: 25px;
    }
}

/* Animation d'ouverture de la modal native */
@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes backdropFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.pin-modal[open] {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-modal[open]::backdrop {
    animation: backdropFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Styles supplémentaires pour améliorer l'apparence */
.modal-content * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Amélioration des contrastes et de la lisibilité */
.modal-title {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.modal-description {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
}

/* Animation du bouton */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(72, 187, 120, 0.25);
    }
    50% {
        box-shadow: 0 6px 20px rgba(72, 187, 120, 0.35);
    }
}

.btn-primary:focus {
    outline: none;
    animation: buttonPulse 2s infinite;
}

/* Styles spécifiques pour les liens avec la classe btn-primary */
a.btn-primary {
    display: inline-block;
    text-decoration: none;
}

a.btn-primary:hover {
    text-decoration: none;
}

a.btn-primary:focus {
    text-decoration: none;
}

.modal-header img {
    max-height: 40px;
}