/* Leyenda como subtítulo fuera del mapa */
.leaflet-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 0 !important;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.leaflet-legend.visible {
    opacity: 1;
}

.legend-text {
    color: #333;
}

.legend-icon {
    width: 18px;
    height: 18px;
    animation: pulse 1.5s infinite ease-in-out;
}

/* Contenedor para el mapa y las tarjetas */
.content-wrapper {
    width: 100%;
    max-width: 1100px;
    display: flex;
    gap: 1rem; /* Espacio entre mapa y tarjetas */
    align-items: flex-start; /* Alinear en la parte superior */
    margin: 0 auto; /* Centrar contenedor en la página */
}
@media (min-width: 1024px) {
  .content-wrapper {
    transform: translateX(100px);
  }
  .leaflet-legend{
    transform: translateX(100px);
  }
}


/* Contenedor para tarjetas y distancias */
.info-wrapper {
    display: block;
    width: calc(50% - 0.5rem);
    gap: 1rem;
}

/* Ajustes específicos para Leaflet */
#mapa2d {
    width: calc(50% - 0.5rem);
    height: 70vh;
    max-height: 600px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    border: none;
}

/* Ocultar el logo y el enlace de atribución de Leaflet */
.leaflet-control-attribution {
    display: none !important;
}

/* Estilo para el grid de alojamientos */
/* ====== ESTILO ESCRITORIO (por defecto) ====== */
.alojamiento-grid {
    width: 100%;
    height: 70vh;
    max-height: 600px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 15px;
    z-index: 1;
    overflow: visible; /* Mostrar todas las tarjetas sin scroll */
    padding: 10px;
    box-sizing: border-box;
}

.alojamiento-card {
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: auto;         /* dejar que la tarjeta se ajuste al contenido */
    min-height: 170px;    /* tamaño ligeramente mayor */
    box-sizing: border-box;
    margin-bottom: 10px;
}


.alojamiento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.alojamiento-card h3 {
    margin: 8px 8px 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.alojamiento-card .precio-desde {
    margin: 8px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #000000;
    text-align: center;
    margin-top: -10px;
}

.alojamiento-card img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    flex-shrink: 0;
}

.alojamiento-card .amenities {
    display: flex;
    justify-content: center; /* Centrar iconos */
    gap: 35px;
    padding-left: 30px;
    margin: 8px;
    font-size: 0.8rem;
    color: #666;
    align-items: center;
    flex-wrap: wrap; /* Permitir que los iconos se ajusten si no caben en una línea */
}

.alojamiento-card .amenity {
    display: flex;
    flex-direction: row; /* Icono y texto en línea */
    align-items: center;
    gap: 4px;
    color: #666;
}

.alojamiento-card .amenity i {
    font-size: 0.9rem; /* Ligeramente más pequeño */
    color: #2563eb; /* Color azul para que coincida con el modal */
    display: inline-block; /* Asegurar que el icono sea visible */
    visibility: visible; /* Asegurar visibilidad */
    opacity: 1; /* Asegurar que no esté oculto */
}

/* Forzar visibilidad del icono fa-washer en tarjetas */
.alojamiento-card .amenity i.fa-washer {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.alojamiento-card .amenity span {
    font-size: 0.8rem;
}

.alojamiento-card .rooms,
.alojamiento-card .room-icons {
    display: none;
}

.alojamiento-card.highlighted {
    border: 2px solid #2563eb;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
    background: #fff;
    animation: pulse 1.5s infinite ease-in-out;
}

.alojamiento-card.highlighted::before {
    content: '\2192';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #2563eb;
    animation: point-right 1.5s infinite ease-in-out;
}

.alojamiento-card.highlighted::after {
    content: '\2190';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #2563eb;
    animation: point-left 1.5s infinite ease-in-out;
}

/* Estilo para el carrusel de botones de rutas */
#route-buttons-container {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    max-width: 80%;
    pointer-events: auto;
}

.buttons-inner {
    display: flex;
    gap: 6px;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    padding: 0 4px;
    user-select: none;
}

.route-button {
    font-size: 11px;
    font-weight: 500;
    color: #333;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
}

.route-button:hover {
    background: #e9ecef;
    color: #000;
    transform: scale(1.05);
}

.carousel-nav {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-nav:disabled {
    background: rgba(0, 0, 0, 0.2);
    cursor: not-allowed;
}

.carousel-nav.prev {
    margin-right: 4px;
}

.carousel-nav.next {
    margin-left: 4px;
}

.route-button[data-category="universidades"] { color: #2563eb; }
.route-button[data-category="universidades"]:hover { background: #e7f1ff; }
.route-button[data-category="sitiosTuristicos"] { color: #28a745; }
.route-button[data-category="sitiosTuristicos"]:hover { background: #e6f4ea; }
.route-button[data-category="supermercados"] { color: #fd7e14; }
.route-button[data-category="supermercados"]:hover { background: #ffeee6; }
.route-button[data-category="farmacias"] { color: #dc3545; }
.route-button[data-category="farmacias"]:hover { background: #f8e1e4; }
.route-button[data-category="puerto"] { color: #6f42c1; }
.route-button[data-category="puerto"]:hover { background: #f0e7fb; }
.route-button[data-category="museos"] { color: #17a2b8; }
.route-button[data-category="museos"]:hover { background: #e3f3f6; }
.route-button[data-category="restaurantes"] { color: #ffc107; }
.route-button[data-category="restaurantes"]:hover { background: #fff3cd; }
.route-button[data-category="hospitales"] { color: #20c997; }
.route-button[data-category="hospitales"]:hover { background: #e6f6f2; }
.route-button[data-category="cajeros"] { color: #6c757d; }
.route-button[data-category="cajeros"]:hover { background: #e9ecef; }
.route-button[data-category="ciudades"] { color: #000000; }
.route-button[data-category="ciudades"]:hover { background: #d3d3d3; }

@media (min-width: 768px) {
    .alojamiento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 1fr;
    }

    .alojamiento-card {
        aspect-ratio: 1 / 1;
    }
}

/* Desktop layout: cards arranged next to the map */
@media (min-width: 992px) {
    .content-wrapper {
        position: relative;
        display: flex;
        align-items: stretch;
    }

    #mapa2d {
        position: relative;
        width: calc(50% - 0.5rem);
        height: 70vh;
        max-height: 600px;
    }

    .info-wrapper {
        position: static;
        width: calc(50% - 0.5rem);
        display: flex;
        pointer-events: auto;
    }

    #alojamientoGrid {
        position: static;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, auto);
        gap: 15px;
    }
}
@media (min-width: 1919px) and (max-width: 1921px) and (min-height: 1079px) and (max-height: 1081px) {
  body, html {
    padding: 0 !important;
    margin: 0 !important;
  }
  .container,
  .main-container,
  .content-section,
  .content-wrapper,
  .info-wrapper,
  .alojamiento-grid {
    margin: 0 !important;
    padding: 0 !important;
  }

  .content-wrapper {
    display: grid;
    grid-template-columns: 740px 740px !important;
    gap: 20px !important;
    width: 1500px !important;
    max-width: 1500px !important;
    margin-left: 90px !important;    /* ← Ajusta este valor para centrar el conjunto */
    margin-right: auto !important;
    margin-top: 180px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  #mapa2d {
    width: 740px !important;
    height: 740px !important;
    max-width: 740px !important;
    max-height: 740px !important;
    border-radius: 22px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13) !important;
    margin: 0 !important;
    position: relative !important;
  }

  /* LEYENDA CENTRADA EN TODO EL BLOQUE */
  .leaflet-legend,
  #mapa-legend {
    font-size: 1.16rem !important;             /* Letras más grandes */
    padding: 11px 18px !important;
    border-radius: 16px !important;
    top: 79px !important;                     /* Más arriba respecto al mapa */
    left: 71% !important;
    transform: translateX(-50%) !important;
    background: rgba(255,255,255,0.94) !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07) !important;
    z-index: 1010 !important;
    color: #111 !important;
    position: absolute !important;
    min-width: 340px !important;               /* Mantiene proporción en leyenda */
    text-align: center !important;
  }
  .leaflet-legend img,
  #mapa-legend img {
    width: 34px !important;                    /* Icono más grande */
    height: 34px !important;
    margin-right: 10px !important;
    vertical-align: middle !important;
  }

  .info-wrapper {
    width: 740px !important;
    max-width: 740px !important;
    min-width: 740px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  .alojamiento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    width: 740px !important;
    max-width: 740px !important;
    min-width: 740px !important;
    height: 740px !important;
    min-height: 740px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
  }
  .alojamiento-card {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    font-size: 1.22rem !important;         /* Texto de la tarjeta más grande */
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  .alojamiento-card img {
    height: 240px !important;
    max-height: 240px !important;
    border-radius: 12px !important;
    width: 100% !important;
    object-fit: cover !important;
  }
  .alojamiento-card .amenities,
  .alojamiento-card .amenity {
    font-size: 1.22rem !important;        /* Tamaño de iconos y amenities */
  }
  .alojamiento-card .amenity i,
  .alojamiento-card i {
    font-size: 1.55rem !important;        /* Iconos aún más grandes */
  }
}
