/* styles.css - VERSIÓN FINAL DEFINITIVA */

:root {
    --tiffany: #59D9D9;
    --sand: #FAFAF5;
    --charcoal: #2D3436;
    --white: #FFFFFF;
    --gray-light: #F3F4F6;
    --text-dim: #6B7280;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Outfit', sans-serif; background-color: var(--sand); color: var(--charcoal); line-height: 1.6; overflow-x: hidden; }

/* UTILIDADES */
.hidden { display: none !important; }
.serif { font-family: 'Playfair Display', serif; }
.cursive { font-family: 'Great Vibes', cursive; }
.bold { font-weight: 700; }
.text-tiffany { color: var(--tiffany); }
.text-white { color: var(--white); }
.text-dim { color: var(--text-dim); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.center-text { text-align: center; }
.py-xl { padding: 80px 0; }
.py-lg { padding: 60px 0; }
.label { display: block; text-transform: uppercase; letter-spacing: 0.3em; font-size: 10px; font-weight: 700; color: var(--tiffany); margin-bottom: 10px; }
.reveal { opacity: 0; transform: translateY(20px); transition: 0.8s; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* HEADER */
#main-header { position: fixed; top: 0; width: 100%; z-index: 1000; transition: all 0.3s ease; padding: 20px 0; }
#main-header.scrolled { background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); padding: 10px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo-area { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-circle { width: 50px; height: 50px; border-radius: 50%; border: 2px solid white; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; transition: 0.3s; }
.name-main { font-weight: 700; font-size: 18px; color: white; }
.name-sub { font-size: 9px; letter-spacing: 0.3em; color: rgba(255,255,255,0.8); display: block; }

#main-header.scrolled .logo-circle { border-color: var(--tiffany); color: var(--tiffany); }
#main-header.scrolled .name-main { color: var(--charcoal); }
#main-header.scrolled .name-sub { color: var(--text-dim); }
#main-header.scrolled .desktop-nav a { color: var(--charcoal); }

.desktop-nav { display: flex; gap: 30px; }
.desktop-nav a { text-decoration: none; color: white; font-size: 11px; letter-spacing: 0.2em; font-weight: 600; transition: 0.3s; }
.desktop-nav a:hover { color: var(--tiffany) !important; }

/* HERO */
#hero { height: 100vh; position: relative; display: flex; align-items: center; justify-content: center; color: white; text-align: center; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.3); z-index: 0; }
.hero-content { position: relative; z-index: 10; }
.hero-content h1 { font-size: clamp(3rem, 8vw, 6rem); line-height: 1; margin: 20px 0; }
.hero-content .cursive { font-size: 1.2em; color: var(--tiffany); display: block; }
.hero-content button { padding: 15px 40px; border-radius: 50px; border: none; font-weight: 700; letter-spacing: 0.2em; cursor: pointer; transition: 0.3s; margin-top: 20px; }
.hero-content button:hover { background: var(--tiffany); color: white; transform: translateY(-3px); }

/* WAVES */
.wave-container { position: absolute; bottom: 0; width: 100%; height: 80px; z-index: 20; }
.waves { width: 100%; height: 100%; }
.parallax > use { animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite; }
@keyframes move-forever { 0% { transform: translate3d(-90px,0,0); } 100% { transform: translate3d(85px,0,0); } }

/* CARDS */
.mission-grid, .location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.suite-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: 0.4s; margin-bottom: 30px; cursor: pointer; }
.suite-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.card-media { height: 300px; position: relative; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); }
.card-body { padding: 25px; }
.btn-main { background: var(--tiffany); color: white; border: none; padding: 12px 25px; border-radius: 30px; cursor: pointer; font-weight: 700; font-size: 11px; letter-spacing: 0.1em; }
.full-width { width: 100%; display: block; }
.map-wrapper iframe { width: 100%; height: 400px; border-radius: 20px; border: none; }

/* FOOTER */
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding-bottom: 40px; text-align: left; }
.footer-title { font-size: 14px; margin-bottom: 20px; color: white; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-nav a { display: block; color: rgba(255,255,255,0.7); text-decoration: none; margin-bottom: 10px; font-size: 14px; }
.bg-tiffany { background: var(--tiffany); color: white; }
.social-links a { color: white; margin-right: 15px; font-weight: bold; text-decoration: none; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 3000; display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: white; width: 100%; max-width: 900px; max-height: 90vh; border-radius: 20px; overflow-y: auto; display: flex; flex-direction: column; }
.modal-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; position: sticky; top: 0; background: white; z-index: 10; }
.modal-body { padding: 30px; }
.modal-layout { display: grid; grid-template-columns: 1fr; gap: 30px; } 
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 20px; }
.modal-img { width: 100%; height: 200px; object-fit: cover; border-radius: 10px; }
.amenity-tag { display: inline-block; background: #f0f0f0; padding: 5px 12px; border-radius: 20px; font-size: 12px; margin: 0 5px 5px 0; color: #555; }
.amenity-row { font-size: 13px; color: #555; margin-bottom: 5px; }
.btn-block { display: block; background: var(--tiffany); color: white; text-align: center; padding: 15px; border-radius: 10px; text-decoration: none; font-weight: bold; margin-top: 10px; }

/* MEDIA QUERIES GENERALES */
@media (min-width: 768px) { .modal-layout { grid-template-columns: 2fr 1fr; } }
@media (max-width: 768px) { .mission-grid, .location-grid, .footer-grid { grid-template-columns: 1fr; text-align: center; } .desktop-nav { display: none; } }


/* ==========================================================================
   SECCIÓN CHATBOT (SOLUCIÓN DEFINITIVA PARA IPHONE/WEB)
   ========================================================================== */

/* 1. CONTENEDOR PRINCIPAL - Estructura Flex Invertida */
/* IMPORTANTE: pointer-events: auto para que sea clicable */
#chatbot-ui {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2147483647; /* Máxima prioridad */
    
    display: flex;
    flex-direction: column-reverse; /* El botón queda abajo, ventana arriba */
    align-items: flex-end;
    gap: 15px;
    
    width: auto;
    height: auto;
    pointer-events: auto !important; 
}

/* 2. VENTANA DEL CHAT - Posicionamiento Relativo Sólido */
#chat-window {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    
    width: 360px;
    height: 550px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.15);
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    
    /* Animación */
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: scale(1);
    transform-origin: bottom right;
}

#chat-window.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.9);
}

/* 3. COMPONENTES INTERNOS */
.chat-header { background: var(--tiffany); padding: 20px 24px; color: white; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.header-left { display: flex; align-items: center; gap: 12px; }
.chat-avatar { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.header-info { display: flex; flex-direction: column; }
.chat-name { font-weight: 700; font-size: 14px; }
.chat-status { font-size: 10px; opacity: 0.8; font-weight: 600; }
#chat-close { background: none; border: none; color: white; font-size: 28px; cursor: pointer; padding: 0; }

#chat-messages { flex: 1; padding: 24px; overflow-y: auto; background: #FAFAFA; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 85%; padding: 14px 18px; font-size: 14px; line-height: 1.5; border-radius: 20px; word-wrap: break-word; white-space: pre-wrap; }
.msg.bot { background: white; color: #374151; border: 1px solid #f3f4f6; border-top-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--tiffany); color: white; border-top-right-radius: 4px; align-self: flex-end; }

/* 4. INPUT ÁREA Y BOTÓN ENVIAR */
.chat-input-wrapper { 
    padding: 20px; 
    background: white; 
    border-top: 1px solid #f9fafb; 
    display: flex; 
    gap: 12px; 
    align-items: center; 
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    background: #F9FAFB;
    border: 1px solid #e5e7eb;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 16px !important; /* Vital para iOS */
    color: #1F2937;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto !important;
}

#chat-send {
    background: none;
    border: none;
    color: var(--tiffany);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 5. BOTÓN FLOTANTE (PILL DESIGN) */
#chat-toggle.chat-trigger {
    width: auto;
    height: auto;
    padding: 10px 22px 10px 14px;
    border-radius: 50px;
    background-color: var(--tiffany);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(89, 217, 217, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.3s ease;
}

#chat-toggle.chat-trigger:hover { transform: scale(1.05); }

.chat-pill-icon { height: 38px; width: auto; object-fit: contain; }
.chat-pill-text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.1; color: var(--white); }
.chat-pill-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 15px; }
.chat-pill-subtitle { font-family: 'Outfit', sans-serif; font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255, 255, 255, 0.85); margin-top: 2px; }

/* 6. RESPONSIVE */
@media (max-width: 600px) {
    #chatbot-ui {
        bottom: 15px !important;
        right: 15px !important;
    }
    #chat-window {
        width: 300px;
        height: 70vh;
        max-height: 550px;
    }
}

@media (max-width: 380px) {
    #chat-toggle.chat-trigger { padding: 10px 16px 10px 12px; }
    .chat-pill-title { font-size: 14px; }
    .chat-pill-subtitle { font-size: 10px; }
    #chat-window { width: 280px; }
}