/* public/css/reserva.css - ESTILOS COMPLETOS: RESERVA, CALENDARIO Y SELECTORES PREMIUM */

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
:root {
    /* Asegurar que las variables estén disponibles aquí si no usa layout.css */
    --gold: #e3b505;
    --gold-light: #f8d76e;
    --gold-dark: #d4a017;
    --navy: #00172d;
    --text: #f5f7fa;
    --text-muted: #b8c7e0;
    --glass-border: rgba(255, 255, 255, 0.2);
    --error: #e63946;
    --bg-deep: #0f1a2e;
}

.form-reserva {
    padding-top: 120px;
    padding-bottom: 50px;
    background: var(--bg-deep);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.form-reserva .container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.form-reserva h1 {
    color: var(--text);
    font-size: clamp(2rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 40px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* ========================================
   ESTRUCTURA Y BASE INPUTS
   ======================================== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.form-group {
    flex: 1;
    min-width: 280px;
    margin-bottom: 0;
    position: relative;
}

.form-group.full-width {
    flex: 0 0 100%;
}

/* --- ESTILO BASE DE ETIQUETA (NORMAL) --- */
.form-group label {
    display: block; 
    color: var(--gold); 
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
    
    background: transparent;
    border: none;
    padding: 0;
    margin-left: 0;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--navy); 
    color: var(--text);
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(227, 181, 5, 0.15);
    outline: none;
    background: rgba(10, 15, 25, 0.8);
}

.error-message {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    animation: fadeIn 0.3s ease;
}

.form-group.invalid .error-message,
#form-error[style*="block"] {
    display: block !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   SELECTOR DE HORA (Contenedor Normal)
   ======================================== */
.time-selects {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    
    padding: 14px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--navy);
    color: var(--text);
    
    transition: all 0.3s ease;
}

.time-selects:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(227, 181, 5, 0.15);
    outline: none;
    background: rgba(10, 15, 25, 0.8);
}

.time-selects select {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    appearance: none; 
    cursor: pointer;
    flex: 1;
    text-align: center;
}

.time-selects span {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.2rem;
}

.time-selects select option {
    background-color: #0a0f1a !important; 
    color: var(--gold) !important;
    padding: 12px;
}

/* ========================================
   CUSTOM SELECT (JS REQUERIDO) - ESTILO CRISTAL
   (FLOTANTE DE HORA/MINUTO)
   ======================================== */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    flex: 1;
    display: inline-block;
    width: 100%;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: var(--navy);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}

.custom-select-trigger:after {
    content: '▼';
    font-size: 0.7em;
    margin-left: 10px;
    color: var(--gold);
    transition: transform 0.3s ease;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(227, 181, 5, 0.2);
    background: rgba(10, 15, 25, 0.8);
}

.custom-select-wrapper.open .custom-select-trigger:after {
    transform: rotate(180deg);
}


/* EL DESPLIEGUE (DROPDOWN) - MAGIA CRISTAL LÍQUIDO */
.custom-options {
    position: absolute;
    display: block;
    left: 0;
    right: 0;
    top: 110%; /* Posición por defecto: abajo */
    
    /* ESTILOS DE CRISTAL LÍQUIDO */
    background: rgba(10, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(227, 181, 5, 0.2); 
    border-radius: 16px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(227, 181, 5, 0.05) inset;
    
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    
    transform: scaleY(0);
    transform-origin: top; 
    transition: transform 0.3s ease-out, opacity 0.3s ease;
    
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

/* ESTADO ABIERTO (Tanto para arriba como para abajo) */
.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: scaleY(1);
}

/* --- LÓGICA DE APERTURA HACIA ARRIBA --- */
.custom-select-wrapper.open-up .custom-options {
    top: auto;          
    bottom: 125%;       
    transform-origin: bottom; 
    
    box-shadow: 
        0 -15px 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(227, 181, 5, 0.05) inset;
}

/* ========================================
   SCROLLBAR (FIX DE CRISTAL LÍQUIDO SUAVE)
   ======================================== */
.custom-options::-webkit-scrollbar { 
    width: 8px; /* Pequeño */
}
.custom-options::-webkit-scrollbar-track { 
    background: transparent; /* Pista totalmente transparente */
}
.custom-options::-webkit-scrollbar-thumb { 
    background: rgba(227, 181, 5, 0.3); /* Dorado muy sutil y transparente */
    border-radius: 4px;
    border: 1px solid rgba(227, 181, 5, 0.1); /* Borde sutil para simular el cristal */
}

.custom-options::-webkit-scrollbar-thumb:hover { 
    background: rgba(227, 181, 5, 0.6); /* Un poco más visible al pasar el mouse */
}
/* Fin del FIX del Scrollbar */


.custom-option {
    position: relative;
    display: block;
    padding: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: center;
    border: 1px solid transparent;
}

.custom-option:hover {
    background: rgba(227, 181, 5, 0.15);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(227, 181, 5, 0.2);
}

.custom-option.selected {
    background: var(--navy); 
    color: var(--gold-light); 
    font-weight: 800;
    border: 2px solid var(--gold); 
    box-shadow: 0 0 15px rgba(227, 181, 5, 0.5); 
    transform: scale(1.02);
}

/* ========================================
   FLATPICKR (CALENDARIO) - CRISTAL LÍQUIDO DORADO
   ======================================== */
.flatpickr-calendar {
    background: rgba(10, 15, 25, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(227, 181, 5, 0.3) !important;
    border-radius: 20px !important;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(227, 181, 5, 0.1) inset !important;
    font-family: 'Montserrat', sans-serif !important;
    overflow: hidden; 
}

.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after { display: none !important; }
.flatpickr-months {
    background: linear-gradient(to bottom, rgba(227, 181, 5, 0.1), transparent);
    border-bottom: 1px solid rgba(227, 181, 5, 0.1);
    padding: 15px 0 5px;
}
.flatpickr-current-month, .flatpickr-current-month input.cur-year {
    color: var(--gold) !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}
.flatpickr-monthDropdown-months { background: transparent !important; color: var(--gold) !important; font-weight: 700; }
.flatpickr-weekdays { background: transparent !important; margin-top: 5px; }
span.flatpickr-weekday { color: var(--text-muted) !important; font-weight: 600 !important; font-size: 0.85rem !important; }

.flatpickr-day {
    color: var(--text) !important;
    border-radius: 12px !important; 
    border: 1px solid transparent !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 500 !important;
}
.flatpickr-day:hover {
    background: rgba(227, 181, 5, 0.15) !important;
    border-color: var(--gold) !important;
    color: var(--gold-light) !important;
    box-shadow: 0 0 15px rgba(227, 181, 5, 0.2) !important;
    transform: scale(1.1);
    z-index: 2;
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
    color: #000 !important; 
    font-weight: 800 !important;
    border: none !important;
    box-shadow: 
        0 4px 15px rgba(227, 181, 5, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.4) !important; 
    transform: scale(1.05);
}
.flatpickr-day.today { border: 1px solid var(--gold) !important; box-shadow: inset 0 0 10px rgba(227, 181, 5, 0.2) !important; }
.flatpickr-prev-month svg, .flatpickr-next-month svg { fill: var(--gold) !important; filter: drop-shadow(0 0 5px rgba(227, 181, 5, 0.5)); }
.flatpickr-prev-month:hover svg, .flatpickr-next-month:hover svg { fill: var(--gold-light) !important; }

/* ========================================
   BOTONES
   ======================================== */
.form-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.btn-submit { background: var(--gold); color: #000; padding: 16px 40px; font-size: 1.05rem; font-weight: 700; border: none; border-radius: 50px; cursor: pointer; text-transform: uppercase; transition: all 0.3s ease; box-shadow: 0 6px 20px rgba(227, 181, 5, 0.4); min-width: 200px; display: inline-flex; justify-content: center; align-items: center; text-decoration: none; }
.btn-submit:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-4px); box-shadow: 0 8px 25px rgba(227, 181, 5, 0.5); }
.btn-submit:disabled { background: #555; color: #888; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-submit.loading { color: transparent !important; position: relative; }
.btn-submit.loading::after { content: ''; position: absolute; width: 20px; height: 20px; border: 3px solid #000; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-back { background: transparent; border: 2px solid var(--gold); color: var(--gold); padding: 14px 40px; font-size: 1rem; font-weight: 700; border-radius: 50px; text-decoration: none; text-transform: uppercase; text-align: center; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center; }
.btn-back:hover { background: var(--gold); color: #000; transform: translateY(-4px); }
.btn-whatsapp { background: #25D366; color: white; box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4); }
.btn-whatsapp:hover { background: #20b857; box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 770px) {
    .form-reserva { padding-top: 100px; }
    .form-reserva h1 { font-size: 1.8rem; margin-bottom: 30px; }
    .form-row { flex-direction: column; gap: 20px; }
    .form-group { min-width: 100%; }
    .btn-submit, .btn-back { width: 100%; max-width: 350px; }
    .flatpickr-calendar { width: 300px !important; }
}