/* ==========================================================================
   ESTILOS GENERALES DEL PANEL DE RESERVAS
   ========================================================================== */
#bookingPanel {
    /* Permitimos que los elementos hijos (como el checklist) floten fuera del panel sin cortarse */
    overflow: visible;
}

.booking-field {
    position: relative;
    /* Un z-index base bajo para todos los campos normales */
    z-index: 1;
    transition: z-index 0.2s ease;
}

/* Elevamos temporalmente el contenedor de las casitas cuando su menú o su error estén activos */
.booking-field:has(.casitas-options-dropdown.show),
.booking-field:has(.error-mensaje.visible) {
    z-index: 50;
}

.casitas-select-custom {
    position: relative;
    width: 100%;
    margin-top: 5px;
}

/* ==========================================================================
   BOTÓN DEL ACORDEÓN DE CASITAS (INTERACTIVO)
   ========================================================================== */
.casitas-select-trigger {
    width: 100%;
    padding: 12px 15px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    color: #333;
    transition: all 0.25s ease;
}

/* Enfoque Azul al pasar el cursor o dar click */
.casitas-select-trigger:hover,
.casitas-select-trigger:focus {
    outline: none;
    border-color: #0199ff;
    box-shadow: 0 0 0 2px rgba(1, 153, 255, 0.15);
}

/* Abierto: Cambia a naranja de marca */
.casitas-select-trigger.open {
    border-color: #ff4800 !important;
    box-shadow: 0 0 0 2px rgba(255, 72, 0, 0.15) !important;
    color: #000;
}

/* Borde rojo de error */
.casitas-select-trigger.invalid-choice {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
}

.casitas-select-trigger i {
    color: #666;
    transition: transform 0.25s ease;
}

.casitas-select-trigger.open i {
    transform: rotate(180deg);
    color: #ff4800;
}

/* ==========================================================================
   MENÚ DESPLEGABLE (FLOTA ABSOLUTAMENTE SOBRE LAS OTRAS CASILLAS)
   ========================================================================== */
.casitas-options-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 8px;
    /* Un z-index masivo garantiza que pase por encima de Flatpickr, inputs y botones */
    z-index: 99999 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 6px 0;
    animation: slideDownFade 0.2s ease-out;
}

.casitas-options-dropdown.show {
    display: block;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #444;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.option-checkbox:hover {
    background-color: #f7f7f7;
    color: #000;
}

.master-option {
    background-color: #fcfcfc;
    color: #111;
}

.option-checkbox input[type="checkbox"] {
    width: 19px;
    height: 19px;
    cursor: pointer;
    accent-color: #ff4800;
}

/* ==========================================================================
   BURBUJA DE ADVERTENCIA (MENSAJE DE ERROR EMERGENTE)
   ========================================================================== */
.error-mensaje {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ff4800;
    color: white;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 8px 25px rgba(255, 72, 0, 0.4);
    z-index: 9999;
    box-sizing: border-box;
    overflow: hidden;

    max-height: 0;
    opacity: 0;
    padding: 0 14px;
    margin-top: 0;
    visibility: hidden;

    transition:
        max-height 0.3s ease-in-out,
        opacity 0.25s ease-in-out,
        padding 0.3s ease-in-out,
        margin-top 0.3s ease-in-out,
        visibility 0.3s;
}

.error-mensaje::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px;
    border-style: solid;
    border-color: transparent transparent #ff4800 transparent;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.error-mensaje.visible {
    max-height: 100px;
    opacity: 1;
    padding: 10px 14px;
    margin-top: 8px;
    visibility: visible;
}

.error-mensaje.visible::before {
    opacity: 1;
}

/* ==========================================================================
   1. CORRECCIÓN: CAMBIO DE AZUL A DEGRADADO NARANJA ACTIVO EN EL BOTÓN FLOTANTE
   ========================================================================== */
.booking-toggle-btn.active {
    background: linear-gradient(135deg, #ff4800 0%, #ff9e00 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 6px 20px rgba(255, 72, 0, 0.4) !important;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}