/* Estilos Generales y Mobile-First */
html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #1320a1;
    --secondary-color: #1e30c8; /* Un tono ligeramente más claro para el efecto hover */
    --text-color: #333;
    --light-gray: #f4f4f4;
    --white: #fff;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    margin: auto;
    overflow: hidden;
}

.section {
    padding: 60px 20px;
    text-align: center;
    scroll-margin-top: 170px; /* Ajustado a la altura del header + margen */
}

/* Estilos de reservas y botón genérico */
#reservas .ibe {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

#reservas .mobile-booking { margin-top: 12px; }

h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--secondary-color);
}

/* Header */
header {
    background: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo a {
    display: inline-block; /* Asegura que el enlace se comporte como un bloque */
}

header .logo img {
    height: 150px;
    vertical-align: middle; /* Evita espacios extra debajo de la imagen */
}

/* Ocultar header al hacer scroll hacia abajo */
header.header-hidden {
    transform: translateY(-100%);
}

/* Estilos para el menú responsive */
.nav-toggle {
    display: none; /* Oculto en escritorio */
    font-size: 1.5rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--primary-color);

}

/* Estilos para el botón de cierre del menú */
.nav-close {
    display: none; /* Oculto por defecto en escritorio */
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--text-color);
}

.main-nav {
    display: flex;
}

header nav ul, .main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
}

header .social-media a {
    color: var(--primary-color);
    font-size: 1.8rem;
}

/* Hero Section */
.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.hero-content .subtitle {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--white);
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

.hero {
    background: url('../img/zonacomun1.jpg') no-repeat center center/cover;
    color: var(--white);
    height: 60vh; /* Ajustamos la altura para que no sea tan grande */
    padding: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-text p {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Rooms Section */
.rooms-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.room-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    text-align: center;
}

.room-card img {
    width: 100%;
    height: auto;
}

.room-card h3 {
    margin: 15px 0;
}

/* (eliminado: estilos del antiguo formulario de reservas) */

/* Contact Section */
#contacto ul {
    list-style: none;
    padding: 0;
}

#contacto ul li {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.map {
    margin-top: 20px;
}

/* Gallery Slider Section */
.slider-container {
    position: relative;
    max-width: 800px;
    margin: auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.slide {
    display: none; /* Ocultar todas las diapositivas por defecto */
}

.slide img {
    width: 100%;
    vertical-align: middle;
}

/* Botones de navegación */
.slider-container .prev,
.slider-container .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.4);
}

.slider-container .prev {
    left: 0;
}

.slider-container .next {
    right: 0;
}

.slider-container .prev:hover,
.slider-container .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Animación Fade */
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4}
    to {opacity: 1}
}

/* Estilos del Botón Volver Arriba */
.go-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: transparent;
    width: 50px;
    height: 50px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 1000;
    border: none;
    cursor: pointer;
}

.go-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
}

.go-top-btn:hover {
    transform: scale(1.1);
}

.go-top-btn img {
    width: 100%;
    height: auto;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    text-align: left;
}

.service-item {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.service-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Activities Section */
.gray-bg {
    background-color: var(--light-gray);
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.activity-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.activity-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Estilos para las dos imágenes de festivales */
.festival-images {
    display: flex;
    width: 100%;
    height: 200px; /* Mantenemos la altura estándar de la tarjeta */
}

.festival-images img {
    width: 50%; /* Cada imagen ocupa la mitad */
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
}

.activity-card h3 {
    font-size: 1.5rem;
    margin: 15px 20px 10px;
}

.activity-card p {
    margin: 0 20px 20px;
    line-height: 1.5;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 20px 0;
}

/* Estilos del Footer */
.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
}

header nav ul li a:hover,
.footer-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
}

footer p {
    margin-top: 10px;
}

/* Estilos para el banner de cookies */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #222;
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
    transform: translateY(0);
    transition: transform 0.5s ease-in-out;
}

.cookie-consent-banner.hidden {
    transform: translateY(100%);
}

.cookie-consent-banner p {
    margin: 0;
    margin-right: 20px;
}

.cookie-consent-banner a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

/* Estilos para las páginas legales */
.legal-page {
    padding: 40px 20px;
}

.legal-page h1, .legal-page h2 {
    color: var(--primary-color);
}

.legal-page p, .legal-page li {
    line-height: 1.8;
}

/* Estilos para Animaciones de Scroll */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll[data-animation="from-left"] {
    transform: translateX(-50px);
}

.animate-on-scroll[data-animation="from-right"] {
    transform: translateX(50px);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Media Queries para Móviles */
@media(max-width: 767px) {
    .nav-toggle {
        display: block; /* Muestra el botón de hamburguesa */
    }

    .main-nav {
        display: none; /* Oculta el menú por defecto */
        position: absolute;
        top: 80px; /* Altura del header */
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .main-nav.is-visible {
        display: block; /* Muestra el menú al hacer clic */
    }

    .main-nav ul {
        flex-direction: column;
    }

    .main-nav ul li {
        width: 100%;
        text-align: center;
    }

    .main-nav ul a {
        padding: 15px 0;
        border-bottom: 1px solid var(--light-gray);
    }

    header .container {
        justify-content: space-between;
    }

    .nav-close {
        display: block; /* Se muestra en móvil */
    }
}

/* Media Queries para Tablets y Escritorios */
@media(min-width: 768px) {
    h2 {
        font-size: 2.5em;
    }

    .hero-text h1 {
        font-size: 4rem;
    }

    .rooms-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Centra la última tarjeta de habitación si el número total es impar */
    .rooms-grid .room-card:last-child:nth-child(odd) {
        grid-column: 1 / -1; /* Hace que la tarjeta ocupe todo el ancho de la rejilla */
        justify-self: center; /* Centra la tarjeta dentro de su celda de rejilla expandida */
        width: 100%;
        max-width: 500px; /* Establece un ancho máximo para que no sea demasiado ancha y se asemeje a las otras */
    }


}

@media(max-width: 768px) {
    header .container {
        flex-direction: column;
    }

    header nav ul {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    header nav ul li {
        margin: 5px 10px;
    }

    header .social-media {
        margin-top: 1rem;
    }
}
