/* --- Estilos generales --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #eef2f6; /* Fondo más suave */
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
    box-sizing: border-box; /* Asegura que padding y border no aumenten el tamaño final */
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Sombra más pronunciada */
    box-sizing: border-box; /* Incluye padding en el ancho total */
}

h1 {
    color: #2c3e50; /* Color de título oscuro y elegante */
    text-align: center;
    margin-bottom: 40px;
    font-size: 3rem; /* Título más grande */
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 15px;
}

h1::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #d82e88; /* Color de acento rosado */
    border-radius: 2px;
}

/* --- Carousel Wrapper --- */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    overflow: hidden; /* Importante para el carrusel */
}

.carousel-container {
    /* Ajustado para dejar espacio para los botones */
    width: calc(100% - 120px); 
    overflow: hidden;
    border-radius: 10px;
}

.carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Transición suave */
    padding-bottom: 20px; /* Espacio para la sombra de las tarjetas */
    gap: 20px; /* Espacio entre las tarjetas */
    justify-content: flex-start; /* Asegura que las tarjetas se alineen al inicio */
}

/* --- Botones de Carrusel (Flechas) --- */
.carousel-button {
    background: #f122a2; /* Color rosado sólido */
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: background 0.3s ease, transform 0.2s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.carousel-button:hover {
    background: #eb3a95; /* Rosa más claro al pasar el ratón */
    transform: translateY(-50%) scale(1.05);
}

.carousel-button:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-button:disabled {
    background: #ccc; /* Gris cuando están deshabilitados */
    cursor: not-allowed;
    box-shadow: none;
}

.carousel-button.prev {
    left: 5px; /* Más cerca de la orilla izquierda */
}

.carousel-button.next {
    right: 5px; /* Más cerca de la orilla derecha */
}

/* --- Tarjeta de Mapa (map-card-spin) --- */
.map-card-spin {
    flex-shrink: 0; /* Evita que las tarjetas se encojan */
    /* Calcula el ancho para 3 tarjetas, considerando 2 gaps de 20px */
    width: calc((100% - (2 * 20px)) / 3); 
    height: 500px; /* Altura fija para la tarjeta */
    position: relative;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12); /* Sombra inicial más suave */
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    /* backface-visibility: hidden; (Ya no es tan necesario si no hay "flip" 180) */
}

.map-card-spin:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); /* Sombra más intensa al pasar el ratón */
    transform: translateY(-5px); /* Pequeño levantamiento */
}

.map-card-content {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Transición para el efecto de "spin" */
    display: flex;
    flex-direction: column;
}

.map-card-spin:hover .map-card-content {
    transform: rotateY(10deg); /* Ligeramente menos rotación para sutileza */
}

.map-image-container-wrapper {
    height: 75%; /* La imagen ocupa la mayor parte de la altura */
    width: 100%;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    position: relative; /* Necesario para la posición absoluta del info-spin */
}

.map-main-image {
    width: 100%;
    height: 100%; /* La imagen ocupa el 100% de su contenedor */
    object-fit: cover; /* Ajusta la imagen cubriendo el área */
    object-position: center; /* Centra la imagen en el recuadro */
    display: block;
    backface-visibility: hidden; /* Asegura que la parte trasera no sea visible */
    position: relative;
    z-index: 0;
}

/* Título ahora debajo de la imagen */
.map-card-title-bottom {
    padding: 15px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    background-color: #f7f9fc; /* Fondo claro para el título */
    border-radius: 0 0 12px 12px; /* Redondea las esquinas inferiores */
    flex-shrink: 0; /* No se encogerá */
    flex-grow: 1; /* Permite que ocupe el espacio restante si es necesario */
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-card-title-bottom h3 {
    margin: 0;
    padding: 0;
    font-size: 1em; /* Ajuste para el h3 dentro del div */
    line-height: 1.3;
}

.map-info-spin {
    position: absolute; /* Sigue siendo absoluto para el efecto de deslizamiento */
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    text-align: left;
    transform: translateY(100%); /* Oculto inicialmente, deslizado completamente hacia abajo */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    border-radius: 0 0 12px 12px;
    z-index: 2; /* Por encima de la imagen al hacer hover */
    opacity: 0; /* Oculto inicialmente */
    height: 100%; /* Ocupa toda la altura del contenedor de la imagen */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Empuja el contenido hacia abajo */
    pointer-events: none; /* Permite clics a través del div cuando no está activo */
}

.map-card-spin:hover .map-info-spin {
    transform: translateY(0); /* Se desliza hacia arriba */
    opacity: 1; /* Se hace visible */
    pointer-events: auto; /* Habilita clics cuando está activo */
}

/* El h3 dentro de map-info-spin ya no es necesario si el título está abajo */
.map-info-spin h3 {
    display: none; 
}

.map-info-spin p {
    margin: 5px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e0e0e0; /* Color de texto más claro */
}

.map-info-spin strong {
    color: #9fe2bf; /* Color de acento para la categoría */
}

.map-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-button {
    background: #f122a2; /* Color rosado sólido */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px; /* Botones más redondeados */
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    pointer-events: auto; /* Asegura que los botones sean clickeables */
}

.action-button:hover {
    background: #eb3a95; /* Rosa más intenso al pasar el ratón */
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

.no-maps {
    text-align: center;
    font-size: 1.3rem;
    color: #777;
    padding: 60px;
    background-color: #fcfcfc;
    border-radius: 10px;
    border: 2px dashed #e0e0e0;
    grid-column: 1 / -1; /* Ocupa todo el ancho si estás usando grid */
    margin-top: 30px;
}

/* Botón "UBICACIÓN EN MAPS" (Si lo reintroduces) */
.info-button-wrapper {
    text-align: center;
    margin: 50px 0 30px;
}

.info-button {
    display: inline-flex;
    align-items: center;
    background: #f122a2; /* Color rosado sólido */
    color: white;
    padding: 18px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.info-button i {
    margin-right: 15px;
    font-size: 1.8rem;
    transform: translateY(1px);
}

.info-button:hover {
    background: #eb3a95;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.info-button:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 40px;
    font-size: 1.2rem;
    color: #d82e88; /* Color rosado */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.2s ease;
}

.back-link:hover {
    color: #eb3a95; /* Rosa más claro al pasar el ratón */
    transform: translateX(5px);
    text-decoration: underline;
}

/* --- Modales (usados si no se usa Fancybox para todo o para contenido específico) --- */
.modal {
    display: none; /* Controlado por JS */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85); /* Fondo más oscuro */
    display: flex; /* Usar flexbox para centrar contenido */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: #fefefe;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    max-width: 95%; /* Más grande por defecto */
    max-height: 95%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 10px;
    object-fit: contain; /* Asegura que la imagen completa se vea */
}

.modal-content iframe {
    width: 70vw; /* Utiliza un porcentaje del viewport */
    height: 80vh;
    max-width: 800px; /* Ancho máximo para el mapa */
    max-height: 600px; /* Alto máximo para el mapa */
    border: none;
    border-radius: 10px;
}

.close-button {
    color: #fff;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 45px; /* Más grande y visible */
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    text-shadow: 0 0 8px rgba(0,0,0,0.9);
    z-index: 1001; /* Asegura que esté por encima de todo */
}

.close-button:hover,
.close-button:focus {
    color: #ff6b6b; /* Rojo para cerrar */
    transform: rotate(90deg);
}

/* --- Responsive adjustments --- */
@media (max-width: 1024px) {
    .map-card-spin {
        /* Para 2 tarjetas con 20px de gap */
        width: calc((100% - 20px) / 2);
    }
    .carousel-container {
        width: calc(100% - 100px); /* Ajuste por los botones */
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    .container {
        padding: 20px;
        margin: 20px auto;
    }
    .map-card-spin {
        width: 100%; /* 1 tarjeta por vista en móviles */
        height: 450px; /* Ajuste de altura para móviles */
    }
    .carousel-button {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    .carousel-button.prev {
        left: 0px; /* Aún más a la orilla en móviles */
    }
    .carousel-button.next {
        right: 0px; /* Aún más a la orilla en móviles */
    }
    .carousel-container {
        width: calc(100% - 90px); /* Ajuste por los botones */
    }
    .modal-content iframe {
        width: 90vw;
        height: 70vh;
    }
    .info-button {
        font-size: 1rem;
        padding: 15px 25px;
    }
    .info-button i {
        margin-right: 10px; /* Ajuste para el ícono en móviles */
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    .map-card-title-bottom {
        font-size: 1.1rem;
        padding: 10px;
    }
    .map-info-spin p {
        font-size: 0.85rem;
    }
    .action-button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .close-button {
        font-size: 35px;
        top: 10px;
        right: 15px;
    }
}