/**
 * Styles pour l'autocomplétion d'adresse Elementor EditMap
 */

/* Empêcher le saut d'écran causé par l'apparition/disparition de la scrollbar */
html.elementor-html {
    overflow-y: scroll;
}

.editmap-address-suggestions {
    position: absolute;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    width: calc(100% - 2px);
    top: 100%; /* Position en dessous du champ input */
    left: 0;
}

.editmap-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
    transition: background-color 0.15s ease;
}

.editmap-suggestion-item:last-child {
    border-bottom: none;
}

.editmap-suggestion-item:hover {
    background-color: #f9fafb;
    color: #111827;
}

.editmap-suggestion-item.editmap-no-results {
    cursor: default;
    color: #9ca3af;
    font-style: italic;
    text-align: center;
}

.editmap-suggestion-item.editmap-no-results:hover {
    background-color: transparent;
}

/* Animation d'apparition */
.editmap-address-suggestions {
    animation: editmap-fadeIn 0.2s ease;
}

@keyframes editmap-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar personnalisée */
.editmap-address-suggestions::-webkit-scrollbar {
    width: 8px;
}

.editmap-address-suggestions::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.editmap-address-suggestions::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.editmap-address-suggestions::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Styles pour le conteneur Google Places Autocomplete */
.pac-container {
    z-index: 99999 !important;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #d1d5db;
    margin-top: 2px !important;
    font-family: inherit;
    max-height: 300px;
    overflow-y: auto;
}

.pac-item {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    border-top: 1px solid #f3f4f6;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover {
    background-color: #f9fafb;
}

.pac-item-query {
    font-size: 14px;
    color: #111827;
}

.pac-matched {
    font-weight: 600;
    color: #111827;
}

/* Responsive */
@media (max-width: 768px) {
    .editmap-suggestion-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .editmap-address-suggestions {
        max-height: 200px;
    }

    .pac-container {
        /* S'assurer que le popup ne dépasse pas de l'écran sur mobile */
        max-width: calc(100vw - 20px) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }

    .pac-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .pac-item-query {
        font-size: 13px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .pac-container {
        font-size: 12px;
    }

    .pac-item {
        padding: 8px 10px;
        font-size: 12px;
    }

    .pac-item-query {
        font-size: 12px;
    }
}
