/* =================================
   VARIABLES (APLICANDO PALETA DE INDEX.HTML)
================================= */
:root {
    --primary-color: #1B3B5F;   /* Azul Noche */
    --accent-color: #C5A059;    /* Dorado */
    --secondary-color: #F4F6F8; /* Gris Perla/Fondo */
    --text-color: #2D2D2D;      /* Gris Antracita */
    --white: #ffffff;
    
    --gold-gradient: linear-gradient(135deg, #C5A059 0%, #D4B06A 50%, #C5A059 100%);
    
    /* Tipografía */
    --font-heading: 'Playfair Display', serif;
    --font-main: 'Montserrat', sans-serif;
}

/* =================================
   RESET
================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =================================
   BASE
================================= */
body {
    font-family: var(--font-main);
    background: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2 {
    font-family: var(--font-heading);
}

/* =================================
   HERO SECTIONS
================================= */
.room-hero {
    height: 35vh;
    width: 100%;
    background: url("img/doble/1A-Dormitorio.png") center/cover no-repeat; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.room-hero2 {
    height: 35vh;
    width: 100%;
    background: url("img/sofa/sofa2.png") center/cover no-repeat; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.room-hero3 {
    height: 35vh;
    width: 100%;
    background: url("img/triple/salon.png") center/cover no-repeat; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.room-hero4 {
    height: 35vh;
    width: 100%;
    background: url("img/triplepatio/patio.png") center/cover no-repeat; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.room-hero5 {
    height: 35vh;
    width: 100%;
    background: url("img/estudiodoble/salon.png") center/cover no-repeat; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.room-hero6 {
    height: 35vh;
    width: 100%;
    background: url("img/doblepatio/patio.png") center/cover no-repeat; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.25));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    z-index: 2;
}

.hero-overlay h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.3;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    margin-bottom: 0.8rem;
    color: white;
}

.hero-overlay p {
    font-size: 1.4rem;
    letter-spacing: 1px;
    line-height: 1.6;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    margin: 0;
}

/* =================================
   NAV & BUTTONS
================================= */
nav {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    background: var(--gold-gradient);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(197, 160, 89, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary-color);
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(27, 59, 95, 0.3);
}

.back-bottom {
    display: flex;
    justify-content: center;
    margin: 4rem 0 2rem;
}

/* =================================
   CONTENT & LISTS
================================= */
.room-features ul {
    margin-left: 0;
    padding-left: 40px; 
    line-height: 1.5; 
}

.room-features li {
    padding-left: 5px; 
    margin-bottom: 5px;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 2rem 1rem 4rem;
}

.container h2 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
    color: var(--primary-color);
}

.container p {
    color: var(--text-color);
    max-width: 100%; /* Antes estaba en 700px, ahora ocupará todo el ancho */
    margin-bottom: 2.5rem;
    font-weight: 400;
    text-align: justify; /* Mantiene el texto alineado por ambos lados */
}

/* =================================
   GALLERY
================================= */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}

.gallery img
 {
    width: 100%;
    height: clamp(340px, 38vw, 480px);
    object-fit: cover; /* Recorta la miniatura para que quede bonita en la cuadrícula */
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
    transition: transform .4s ease, box-shadow .4s ease;
    display: block;
    background: var(--primary-color);
    cursor: pointer;
}

.gallery img:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,.25);
}

/* =================================
   LIGHTBOX FULLSCREEN (CORREGIDO)
================================= */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95); /* Fondo oscuro */
    display: none; /* Se activa con JS */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease; /* Transición suave */
}

/* Clase que añade JS para mostrarlo */
#lightbox.active {
    display: flex; 
    opacity: 1;
    pointer-events: all;
}

/* Estilos para Imagen y Video dentro del Lightbox */
#lightbox img, 
#lightbox video {
    max-width: 90vw;  /* Ocupa máximo el 90% del ancho de pantalla */
    max-height: 90vh; /* Ocupa máximo el 90% del alto */
    width: auto;      /* Deja que el navegador calcule el ancho correcto */
    height: auto;     /* Deja que el navegador calcule el alto correcto */
    
    /* LA CLAVE: contain asegura que se vea todo el contenido sin estirarse */
    object-fit: contain; 
    
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    display: none; /* Por defecto ocultos, JS decide cuál mostrar */
}

/* Botón de cerrar (X) opcional por estética */
.close-icon {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    font-family: sans-serif;
    opacity: 0.7;
    transition: 0.3s;
}
.close-icon:hover { opacity: 1; }

/* =================================
   ESTILOS PARA EL BOTÓN DE PLAY
================================= */

/* 1. El contenedor actúa como marco para posicionar el botón encima */
.video-container {
    position: relative; /* Necesario para que el botón se posicione encima */
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden; /* Para que el video no se salga de las esquinas redondeadas */
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
    height: clamp(340px, 38vw, 480px); /* Misma altura que las imágenes */
    transition: transform .4s ease, box-shadow .4s ease;
    background: var(--primary-color);
}

/* El video ocupa todo el espacio del contenedor */
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 2. El círculo del botón */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1); /* Centrado absoluto */
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.25); /* Fondo semitransparente */
    backdrop-filter: blur(4px); /* Efecto cristal opcional */
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none; /* El clic traspasa al contenedor */
}

/* 3. El triángulo (forma de Play) hecho con CSS puro */
.play-icon-shape {
    width: 0; 
    height: 0; 
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 18px solid #fff; /* Color del triángulo */
    margin-left: 4px; /* Ajuste óptico para que se vea centrado */
}

/* =================================
   EFECTOS HOVER (ANIMACIÓN)
================================= */

/* Al pasar el ratón sobre el contenedor, el botón crece y se vuelve sólido */
.video-container:hover .play-button {
    background-color: var(--accent-color); /* Se pone dorado */
    border-color: var(--accent-color);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,.25);
}

/* Mejora del botón de cerrar para móviles */
.close-area {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;  /* Área táctil amplia */
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001; /* Por encima del video */
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3); /* Fondo sutil para que se vea sobre cualquier imagen */
    border-radius: 50%;
}

.close-icon {
    color: #ffffff;
    font-size: 45px; /* Tamaño grande para legibilidad */
    line-height: 1;
    font-family: Arial, sans-serif;
}

/* Ajuste para que el video no tape el botón en móviles pequeños */
@media (max-width: 768px) {
    #lightbox img, 
    #lightbox video {
        max-width: 95vw;
        max-height: 80vh; /* Dejamos espacio arriba y abajo */
    }
    
    .close-area {
        top: 5px;
        right: 5px;
    }
}

/* =================================
   RESPONSIVE
================================= */
@media (max-width: 768px) {
    .room-hero, .room-hero2 {
        height: 40vh;
    }

    .hero-overlay h1 {
        font-size: 2rem;
    }

    .hero-overlay p {
        font-size: 1rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
    .gallery img,
    .gallery video {
        height: 300px;
    }
}