/* ==========================================================================
   1. ESTILOS GLOBALES Y VARIABLES
   ========================================================================== */
:root {
    --color-primary: #3E2723; 
    --color-secondary: #5D4037; 
    --color-tertiary: #8D6E63; 
    --color-background: #F8F5F2; 
    --color-text: #212121;
    --color-light-text: #fff;
    --color-border: #E0E0E0;
}

/* ==========================================================================
   ESTILOS PARA TRANSICIÓN SUAVE ENTRE PÁGINAS
   ========================================================================== */
body {
    /* ... tus estilos de body actuales se quedan igual ... */

    /* Preparamos el body para la animación de fundido */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Cuando el body tenga la clase .fade-in, se hará visible */
body.fade-in {
    opacity: 1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lora', serif; 
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background);
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: bold; 
    color: var(--color-primary);
}

a {
    text-decoration: none;
    color: var(--color-secondary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-tertiary);
}

.section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    color: var(--color-secondary);
    margin-bottom: 50px;
}

main {
    overflow: hidden;
}

/* ==========================================================================
   2. HEADER Y NAVEGACIÓN (VERSIÓN ESCRITORIO)
   ========================================================================== */
.header {
    background-color: var(--color-background);
    position: sticky;
    top: 0;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 9999;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo img {
    height: 85px; 
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li a {
    color: var(--color-primary);
    padding: 10px 20px;
    font-weight: 600;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: var(--color-tertiary);
}

.menu-toggle {
    display: none;
}


/* ==========================================================================
   3. MENÚ MÓVIL (HAMBURGUESA Y OVERLAY)
   ========================================================================== */
.menu-toggle {
  background: none; border: none; cursor: pointer; position: relative;
  width: 30px; height: 25px;
}
.bar {
  display: block; width: 100%; height: 3px;
  background-color: var(--color-secondary); margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
body.menu-open .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .bar:nth-child(2) { opacity: 0; }
body.menu-open .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* ==========================================================================
   4. CONTENIDO COMÚN (BOTONES, MODALES, ETC.)
   ========================================================================== */

/* --- Botones de Contacto (WhatsApp, Teléfono, Ubicación) --- */
.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-top: 20px; 
}
.btn-contact {
    display: flex;
    align-items: center;
    justify-content: center; /* Para centrar el contenido */
    gap: 15px;
    padding: 18px 30px;      /* <-- AUMENTADO: Un poco más grande */
    border-radius: 50px;    /* <-- CAMBIADO: Bordes totalmente redondos */
    font-size: 1.1em;       /* <-- AUMENTADO: Texto más grande */
    font-weight: bold;
    color: var(--color-light-text);
    text-transform: uppercase; /* <-- AÑADIDO: Texto en mayúsculas */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 380px; /* Ancho máximo para que no sean demasiado anchos en ordenador */
}
.btn-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.btn-whatsapp { background-color: #25D366; }
.btn-phone { background-color: var(--color-secondary); }
.btn-location { background-color: #4285F4; }

/* --- Modales --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}
.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 900px;
}
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* ==========================================================================
   5. CONTENIDO ESPECÍFICO DE PÁGINAS
   ========================================================================== */

/* --- Hero Banner (index.php) --- */
.hero-banner {
    height: 90vh; background-image: url('bannercasa.png');
    background-size: cover; background-position: center; display: flex;
    align-items: center; justify-content: center; text-align: center;
    color: var(--color-light-text); position: relative;
}
.hero-banner::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); z-index: 1;
}
.hero-content { position: relative; z-index: 2; padding: 20px; }
.hero-content h1 { font-size: 4rem; margin-bottom: 15px; color: var(--color-light-text); line-height: 1.2; }
.hero-content p { font-size: 1.3rem; margin-bottom: 40px; }
.search-box {
    background-color: rgba(245, 242, 228, 0.719); padding: 20px; border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); max-width: 400px; margin: 0 auto;
}
.search-box form { display: flex; justify-content: center; }
.btn-search {
    background-color: var(--color-secondary); color: var(--color-light-text); padding: 15px 75px;
    border: none; border-radius: 8px; font-size: 1.1rem; font-weight: bold; cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn-search:hover { background-color: var(--color-primary); transform: translateY(-2px); }
.social-hero-buttons { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.btn-instagram, .btn-facebook {
    display: inline-flex; align-items: center; gap: 10px; color: var(--color-light-text); padding: 15px 30px;
    border-radius: 8px; font-size: 1.1rem; font-weight: bold; text-transform: uppercase;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.btn-instagram { background-color: #E1306C; }
.btn-instagram:hover { background-color: #C12A5C; }
.btn-facebook { background-color: #3b5998; }
.btn-facebook:hover { background-color: #2d4373; }

/* --- Descripción y Galería (index.php) --- */
.descripcion { background-color: #fff; }
.descripcion-gallery-container { display: flex; align-items: flex-start; justify-content: center; gap: 40px; }
.side-gallery { display: flex; flex-direction: column; gap: 20px; flex-basis: 250px; padding-top: 20px; }
.galeria-img { width: 100%; height: auto; object-fit: cover; border-radius: 12px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.galeria-img:hover { transform: scale(1.05); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15); }
.descripcion-container { flex-basis: 50%; text-align: left; }
.descripcion-content { font-size: 1.15rem; line-height: 1.8; }
.descripcion-content p { margin-bottom: 30px; }

/* --- Servicios (index.php) --- */
.servicios { background-color: var(--color-background); }
.servicios-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; text-align: left; }
.servicios-categoria { background-color: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.servicios-categoria:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
.servicios-categoria h3 { color: var(--color-secondary); margin-bottom: 20px; border-bottom: 2px solid var(--color-tertiary); padding-bottom: 12px; font-size: 1.5rem; }
.servicios-categoria ul { list-style: none; }
.servicios-categoria li { margin-bottom: 15px; display: flex; align-items: center; font-size: 1.1rem; }
.servicios-categoria li i { color: var(--color-tertiary); margin-right: 15px; font-size: 1.3rem; min-width: 25px; }

/* --- Blog (blog.php) --- */
.blog-container, .rooms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px;}
.blog-post, .room-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); padding: 20px; text-align: left; transition: transform .3s ease, box-shadow .3s ease; overflow:hidden; }
.blog-post:hover, .room-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.blog-post h3, .room-content h3 { margin-bottom: 15px; font-size: 1.4rem; color: var(--color-secondary); }
.post-image, .room-card img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; margin-bottom: 15px; }
.post-excerpt, .room-content { margin-bottom: 15px; color: #444; }
.read-more { display: inline-block; padding: 10px 20px; background: var(--color-secondary); color: #fff; border-radius: 6px; font-weight: bold; transition: background .3s ease; }
.read-more:hover { background: var(--color-primary); }
/* --- Galería de Fotos (fotoscuadra.php) --- */
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); grid-gap: 15px; margin-top: 40px; }
.galeria-img-vertical { grid-row: span 2; }
.galeria-img-grande { grid-column: span 2; }


/* --- ESTILOS ESPECÍFICOS PARA LAS HABITACIONES --- */

.room-content { padding: 20px; text-align: center; }
.room-content h3 { margin-bottom: 5px; font-size: 1.4rem; color: var(--color-secondary);}
.room-card .room-features { font-size: 0.9rem; font-weight: normal; color: #888; margin-bottom: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.room-content p {
    color: #444;
    height: 75px; 
    overflow: hidden; 
    text-overflow: ellipsis; /* 
    margin-bottom: 0; /* Quitamos el margen inferior para compactar */
}


/* ==========================================================================
   6. COMPONENTES GLOBALES (BOTÓN GOOGLE, FOOTER)
   ========================================================================== */
.google-review-btn {
    position: fixed; bottom: 25px; right: 25px; z-index: 1000;
    background-color: #4285F4; color: white; width: 60px; height: 60px;
    border-radius: 50%; text-decoration: none; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; align-items: center; justify-content: center; font-size: 1.8em;
}
.google-review-btn:hover { transform: scale(1.1); }

.footer {
    background-color: var(--color-primary); color: var(--color-light-text);
    text-align: center; padding: 30px;
}
.footer a { color: var(--color-light-text); text-decoration: underline; }


/* ==========================================================================
   7. ESTILOS RESPONSIVE (MEDIA QUERIES)
   ========================================================================== */

/* --- Estilos para Tablets (hasta 992px) --- */
@media (max-width: 992px) {
    .descripcion-gallery-container { flex-direction: column; align-items: center; gap: 20px; }
    .side-gallery { flex-direction: row; width: 100%; gap: 10px; overflow-x: auto; }
    .side-gallery .galeria-img { min-width: 45%; max-width: 45%; }
    .side-gallery.left-gallery { order: 1; }
    .descripcion-container { order: 2; }
    .side-gallery.right-gallery { order: 3; }
}

/* --- Estilos para Móviles (hasta 768px) --- */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    .menu-toggle { display: block; z-index: 2000; }
    .navbar { justify-content: space-between; }
    .nav-links {
        display: flex; flex-direction: column; justify-content: center; align-items: center;
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background-color: rgba(62, 39, 35, 0.95); backdrop-filter: blur(5px);
        opacity: 0; visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
    }
    .nav-links.active { opacity: 1; visibility: visible; }
    .nav-links li a { color: #fff; font-size: 2.2rem; }
}

/* --- Estilos para pantallas muy pequeñas (hasta 600px) --- */
@media (max-width: 600px) {
    .google-review-btn { bottom: 15px; right: 15px; width: 50px; height: 50px; font-size: 1.5em; }
}

/* ==========================================================================
   8. ESTILOS PARA LA PÁGINA DE RESTAURANTES (BLOG)
   ========================================================================== */

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

.restaurant-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.restaurant-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}

.restaurant-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.restaurant-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8em;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.2;
}

.restaurant-content p {
    font-family: 'Lora', serif;
    font-size: 1em;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.restaurant-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.restaurant-actions a {
    flex-grow: 1;
    text-align: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.3s ease;
    width: 100%;
}

.como-llegar-btn {
    background-color: #27ae60;
}

.como-llegar-btn:hover {
    background-color: #229954;
}

.menu-btn {
    background-color: #3498db;
}

.menu-btn:hover {
    background-color: #2980b9;
}

.action-btn i {
    margin-right: 8px;
}

.article-header-image {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .restaurants-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   9. ESTILOS PARA MODAL CON CARRUSEL (SwiperJS) - VERSIÓN MEJORADA
   ========================================================================== */

/* El fondo oscuro del modal */
.modal {
    padding: 20px;
    overflow-y: auto; /* Añadimos padding para que el contenido no pegue a los bordes en móvil */
}

/* La "tarjeta" blanca que contiene todo */
.modal-content .room-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: -10px;      /* <-- CAMBIO: Sube el texto para acercarlo al título */
    margin-bottom: 25px;   /* <-- CAMBIO: Aumenta el espacio con el párrafo de abajo */
    font-size: 1rem;       /* <-- CAMBIO: Texto un poco más pequeño */
    font-weight: normal;   /* <-- CAMBIO: Quitamos la negrita para hacerlo más sutil */
    color: #888;          /* <-- CAMBIO: Un tono de gris elegante */
    font-style: italic;    /* <-- AÑADIDO: Un toque más profesional */
}

/* Y nos aseguramos de que el título H2 tenga el espaciado correcto */
.modal-content h2 {
    margin-bottom: 15px;
}
.modal-content p {
    margin-bottom: 25px;
}

/* El carrusel de imágenes */
.swiper {
    width: 100%;
    height: 500px;
    border-radius: 8px;
}
.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #eee;
}
.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- NUEVO Y MEJORADO: Botón de cierre --- */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10; /* Para que esté siempre por encima del carrusel */
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.close-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Flechas de Swiper */
.swiper-button-next,
.swiper-button-prev {
    color: var(--color-secondary) !important;
    background-color: rgba(255, 255, 255, 0.7);
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}
.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: rgba(255, 255, 255, 0.9);
}
.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 20px !important;
    font-weight: bold;
}

/* --- AJUSTE ADICIONAL PARA MÓVIL --- */
@media (max-width: 768px) {
    .swiper {
        height: 300px; /* Hacemos el carrusel menos alto en móviles */
    }
}

/* ==========================================================================
   ESTILOS FINALES PARA PÁGINA DE DISPONIBILIDAD
   ========================================================================== */

/* --- Contenedor del Calendario (con scroll horizontal forzado) --- */
.calendar-container {
    width: 100%;
    max-width: 680px; /* <-- REDUCIDO: Ajustado al ancho real del widget */
    /* Se ha eliminado min-height para que la altura sea automática */
    margin: 40px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Pop-up de Promoción (corregido) --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.popup-visible {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s ease;
}
.close-popup:hover {
    color: #333;
}

.btn-whatsapp-popup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #25D366;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}
.btn-whatsapp-popup:hover {
    background-color: #128C7E;
}


/* Clase de utilidad para poner texto en color rojo */
.texto-rojo {
    color: #c0392b; /* Un tono de rojo elegante, no tan brillante */
}

/* ==========================================================================
   ESTILOS PARA EL BANNER DE COOKIES PERSONALIZADO
   ========================================================================== */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-primary);
    color: var(--color-light-text);
    padding: 20px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    /* Animación de entrada */
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
}

#cookie-banner.visible {
    transform: translateY(0);
}

#cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
}

#cookie-banner a {
    color: var(--color-light-text);
    font-weight: bold;
    text-decoration: underline;
}

#cookie-banner button {
    white-space: nowrap;
    padding: 10px 20px;
}

@media (max-width: 768px) {
    #cookie-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   OPCIÓN 1: EFECTO HOVER CON RELLENO DE FONDO
   ========================================================================== */

/* Solo se aplica en pantallas de más de 768px (ordenador) */
@media (min-width: 769px) {

    /* Preparamos el enlace para la transición */
    .nav-links li a {
        padding: 8px 15px; /* Ajustamos el padding para que el fondo se vea bien */
        border-radius: 20px; /* Bordes redondeados para el fondo */
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    /* Al pasar el ratón, cambia el color de fondo y el del texto */
    .nav-links li a:hover {
        background-color: #EFEBE9; /* Un color muy suave de tu paleta */
        color: var(--color-primary); /* El marrón más oscuro para el texto */
    }
}



/* ==============================================================================
                        BOTÓN DE WHATSAPP FLOTANTE
   ============================================================================== */
   
   .whatsapp-flotante {
    position: fixed;
    bottom: 25px;
    left: 25px; /* Lo ponemos a la izquierda para no competir con el de reseñas */
    z-index: 1000;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    transition: transform 0.3s ease;
}
.whatsapp-flotante:hover {
    transform: scale(1.1);
}

/* Ajustes para móvil */
@media (max-width: 600px) {
    .whatsapp-flotante {
        bottom: 15px;
        left: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.8em;
    }
}

/*  BOTONES HERO BANNER */

.usp-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.usp-item {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: bold;
}
.usp-item i {
    color: #fff;
}