/* ==========================================================================
   MAPA INTERACTIVO DE HOTELES - LEAFLET
   ========================================================================== */

/* ==========================================================================
   MODAL DEL MAPA
   ========================================================================== */

/* Maximizar ancho del modal */
#hotel-map-modal .modal-xl {
    max-width: 90%;
}

/* Eliminar padding del modal-body para que el mapa ocupe todo el espacio */
#hotel-map-modal .modal-body {
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Boton de cierre superpuesto sobre el mapa */
#hotel-map-modal .modal-body .close {
    position: absolute;
    top: 3%;
    right: 2%;
    z-index: 1000;
    margin: 0;
    float: none;
    background-color: var(--color-base-blue);
    color: white;
}

/* Icono del boton de cierre en blanco */
#hotel-map-modal .modal-body .close img {
    filter: brightness(0) invert(1);
}

/* Quitar text-decoration de todos los enlaces dentro del modal del mapa */
#hotel-map-modal a,
#hotel-map-modal a:hover,
#hotel-map-modal a:focus,
#hotel-map-modal a:active {
    text-decoration: none !important;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL DEL MAPA
   ========================================================================== */

#interactive-map {
    width: 100%;
    height: min(800px, 91vh);
    z-index: 1;
    background: var(--surface-complement-opacity-48);
}

/* ==========================================================================
   MARKERS DE LEAFLET
   ========================================================================== */

.leaflet-marker-icon {
    object-fit: contain;
    width: 32px !important;
    height: 32px !important;
}

/* ==========================================================================
   POPUPS DEL HOTEL
   ========================================================================== */

/* Contenedor del popup */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: var(--text-white);
}

.leaflet-popup-content {
    width: 400px !important;
    margin: 0;
    padding: 0;
    font-family: "Urbanist", sans-serif;
    color: var(--color-text);
}

/* Layout del hotel en el popup */
.interactive-map__hotel {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: row;
    gap: 0;
    width: 100%;
    min-height: 200px;
    overflow: hidden;
}

/* Contenedor de la imagen del hotel */
.interactive-map__hotel__image {
    width: 50%;
    padding: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    align-self: stretch;
    overflow: hidden;
}

/* Imagen del hotel dentro del contenedor */
.interactive-map__hotel__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Contenido del hotel */
.interactive-map__hotel__content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 15px;
    width: 50%;
    align-self: stretch;
}

/* Nombre del hotel */
.interactive-map__hotel__content__name {
    font-family: "ArgestaHeadline", serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--title-black-color);
    line-height: 1.3;
    margin: 0;
    display: block;
}

/* Direccion del hotel */
.interactive-map__hotel__content__address {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.4;
    margin: 0;
    display: block;
}

/* Enlace de reserva */
.interactive-map__hotel__content__link {
    font-weight: 700;
    font-size: 12px;
    margin-top: auto;
    padding: 6px 8px;
    border: 1px solid var(--color-base-blue);
    background: transparent;
    color: var(--color-base-blue) !important;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border-radius: 30px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.interactive-map__hotel__content__link:hover {
    background: var(--color-base-blue);
    color: var(--text-white) !important;
    text-decoration: none;
}

/* Contenedor de acciones (botones) */
.interactive-map__hotel__content__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

/* Enlace "Ver Hotel" - estilo igual al botón añadir habitación */
.interactive-map__hotel__content__view-link {
    position: relative;
    font-size: 14px;
    color: var(--color-base-blue);
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}

.interactive-map__hotel__content__view-link::after {
    content: '';
    width: 100%;
    position: absolute;
    bottom: -5px;
    left: 0px;
    height: 1px;
    background-color: var(--color-base-blue);
}

.interactive-map__hotel__content__view-link:hover {
    color: var(--color-base-blue);
    background-color: transparent;
}

/* Flecha del popup */
.leaflet-popup-tip {
    background: var(--text-white);
}

/* ==========================================================================
   CLUSTERS (Agrupacion de markers)
   ========================================================================== */

/* Estilos base de clusters */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
}

.marker-cluster span {
    line-height: 30px;
    color: var(--text-white);
    font-size: 14px;
}

/* Cluster pequeno (menos de 10 hoteles) */
.marker-cluster-small {
    background-color: var(--color-base-blue-40);
}

.marker-cluster-small div {
    background-color: var(--color-base-blue);
}

/* Cluster mediano (10-99 hoteles) */
.marker-cluster-medium {
    background-color: var(--color-light-blue-48);
}

.marker-cluster-medium div {
    background-color: var(--color-light-blue);
}

.marker-cluster-medium span {
    color: var(--text-secondary-solid-100);
}

/* Cluster grande (100+ hoteles) */
.marker-cluster-large {
    background-color: var(--color-base-beige);
}

.marker-cluster-large div {
    background-color: var(--color-base-blue);
}

/* ==========================================================================
   RESPONSIVE: TABLET / MOBILE (< 992px)
   ========================================================================== */

@media (max-width: 991px) {

    /* Reducir altura del mapa */
    #interactive-map {
        height: 400px;
    }

    /* Reducir ancho del popup */
    .leaflet-popup-content {
        width: 250px !important;
    }

    /* Layout vertical en movil */
    .interactive-map__hotel {
        flex-direction: column;
        gap: 0;
    }

    /* Imagen ocupa todo el ancho */
    .interactive-map__hotel__image {
        width: 100%;
        height: 150px;
    }

    /* Contenido ocupa todo el ancho */
    .interactive-map__hotel__content {
        width: 100%;
        padding: 12px;
    }

    /* Ajustar tamano del nombre */
    .interactive-map__hotel__content__name {
        font-size: 15px;
    }

    /* Ajustar tamano de direccion */
    .interactive-map__hotel__content__address {
        font-size: 12px;
    }

    /* Contenedor de acciones: Stack vertical en moviles */
    .interactive-map__hotel__content__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* Enlace "Ver Hotel" centrado en moviles */
    .interactive-map__hotel__content__view-link {
        text-align: center;
        font-size: 13px;
    }

    .interactive-map__hotel__content__view-link::after {
        left: 0;
        right: 0;
    }

    /* Boton de cierre mas pequeno */
    #hotel-map-modal .modal-body .close {
        top: 10px;
        right: 10px;
        font-size: 12px;
    }

    /* Modal mas ancho en movil */
    #hotel-map-modal .modal-xl {
        max-width: 95%;
    }
}

/* ==========================================================================
   RESPONSIVE: DESKTOP GRANDE (> 1920px)
   ========================================================================== */

@media (min-width: 1921px) {

    /* Aumentar altura del mapa */
    #interactive-map {
        height: 700px;
    }

    /* Popup mas grande */
    .leaflet-popup-content {
        width: 480px !important;
    }

    /* Hotel mas alto */
    .interactive-map__hotel {
        min-height: 240px;
    }

    /* Textos mas grandes */
    .interactive-map__hotel__content__name {
        font-size: 18px;
    }

    .interactive-map__hotel__content__address {
        font-size: 14px;
    }

    .interactive-map__hotel__content__link {
        font-size: 15px;
        padding: 10px 20px;
    }
}

/* ==========================================================================
   ANIMACIONES Y TRANSICIONES
   ========================================================================== */

/* Fade in del mapa cuando se muestra el modal */
#hotel-map-modal.show #interactive-map {
    animation: fadeInMap 0.4s ease-in-out;
}

@keyframes fadeInMap {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
