/* Estilos Generales (ligeramente ajustados) */
.buscador-viajes-container {
    position: relative;
    max-width: 900px;
    margin: 40px auto;
}
.buscador-viajes-form {
    display: flex;
    gap: 10px;
    align-items: stretch; /* Alinear elementos a la misma altura */
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    /* CAMBIO CLAVE: El z-index se manejará con JS para evitar conflictos */
    z-index: 100; 
}

.form-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Permite que los campos crezcan y ocupen el espacio */
}

.form-group label {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: center;
}

.form-group input[type="text"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #fff;
    width: 100%;
    text-align: center;
    box-sizing: border-box; /* Asegura que el padding no afecte el ancho */
}

.form-group-submit {
    flex-grow: 0;
    justify-content: flex-end; /* Alinear el botón al final */
    align-items: flex-end; /* Alinear el botón abajo */
    margin-bottom: 2px;
}

.search-submit {
    background-color: #e98e4c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    height: 48px; /* Altura consistente con los inputs */
    align-self: flex-end; /* Se alinea a sí mismo abajo */
}
.search-submit:hover {
    background-color: #d97d3b !important;
    color: white;
}
/* --- ESTILOS POPUP GENERAL (ESCRITORIO) --- */
.buscador-popup {
    display: none;
    position: absolute;
    top: 100%; /* Se posiciona justo debajo del formulario */
    left: 0;
    right: 0;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 99; /* Por debajo del formulario */
    padding: 20px;
    box-sizing: border-box;
    margin-top: 10px;
}
.buscador-popup.active { display: block; }

/* CAMBIO CLAVE: Ocultar el header del popup en escritorio por defecto */
.popup-header {
    display: none;
}
.popup-title { font-size: 18px; font-weight: bold; color: #333; margin: 0 0 20px 0; text-align: center; width: 100%;}

/* --- ESTILOS PESTAÑAS Y CONTENIDO (Aplican a ambas vistas) --- */
.popup-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.tab-button { background: #f1f1f1; border: 1px solid #ddd;color: #c5a48d; border-radius: 20px; padding: 8px 20px; cursor: pointer; font-size: 14px; transition: all 0.3s; }
.tab-button:hover { border-color: #e98e4c; background-color: #fef4f6; color: #e98e4c; }
.tab-button.active { background-color: #fff; border-color: #f7a164; color: #aa5212; font-weight: 500;}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Estilos Pestaña Actividades */
.actividades-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.actividades-col { flex: 1; }
.actividad-item { border: 1px solid #ddd; border-radius: 8px    ; padding: 15px; text-align: center; cursor: pointer; transition: all 0.3s; font-weight: 500; }
.actividad-item:hover { border-color: #e98e4c;; background-color: #fef4f6; color: #e98e4c; }
.actividad-item.selected { border-color: #e98e4c; background-color: #fdf6f7; }



/* Estilos Pestaña Destinos */
.destinos-col { flex: 1; }
.destinos-col .destino-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; } */
.destinos-col .destino-item { border: 1px solid #ddd; border-radius  : 8px; padding: 15px; text-align: center; cursor: pointer; transition: all 0.3s; font-weight: 500; }
.destinos-col .destino-item:hover { border-color: #e98e4c; background-color: #fef4f6; color: #e98e4c; }
.destinos-col .destino-item.selected { border-color: #e98e4c; background-color: #fdf6f7; }
/* Estilos Pestaña Meses */
.meses-puentes-container { display: flex; gap: 30px; }
.puentes-col, .meses-col { flex: 1; }
.col-title { font-weight: bold; margin: 0 0 15px 0; font-size: 16px; text-align: center;}
.puente-item { border: 1px solid #e98e4c; color: #6d4a9b; border-radius: 8px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: all 0.3s; font-weight: 500; text-align: center;}
.puente-item:hover { background: #fef4f6; }
.meses-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.destino-item, .mes-item { border: 1px solid #eee; border-radius: 8px; padding: 15px; text-align: center; cursor: pointer; transition: all 0.3s; font-weight: 500; }
.destino-item:hover, .mes-item:hover { border-color: #e98e4c; background-color: #fef4f6; color: #e98e4c; }

/* Estilos Pestaña Fechas (Calendario) */
.calendar-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendar-nav button { background: none; border: 1px solid #ccc; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 18px; }
.calendar-title-container { display: flex; justify-content: space-around; flex-grow: 1; font-size: 16px; font-weight: bold; }
#calendar-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-header { text-align: center; font-weight: bold; color: #999; padding-bottom: 10px; font-size: 14px; text-transform: capitalize; }
.calendar-day { display: flex; justify-content: center; align-items: center; height: 38px; cursor: pointer; border-radius: 50%; transition: all 0.2s; }
.calendar-day.not-in-month { color: #ccc; cursor: default; }
.calendar-day:not(.not-in-month):hover { background-color: #fef4f6; }
.calendar-day.selected { background-color: #6d4a9b; color: white; }

/* Estilo para botones seleccionados */
.pfs-exact-button.selected,
.pfs-exact-date-btn.selected,
.pfs-exact-month-btn.selected {
    background: #e98e4c;
    color: white;
    border-color: #e98e4c;
}

/* Rejillas */
.destino-grid, .meses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.actividades-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }


/* Cada item de la rejilla */
.destino-item {
    display: flex;
    flex-direction: column; /* Icono arriba, texto abajo */
    align-items: center;
    justify-content: center;
    border: 2px solid #eee; /* Borde más grueso y claro por defecto */
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    height: 140px; /* Altura fija */
}

/* Icono dentro del item */
.destino-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px; /* Espacio entre icono y texto */
    transition: fill 0.3s;
}
.destino-icon path {
    fill: #888; /* Color gris para el icono */
}



/* Items seleccionables */
.destino-item, .mes-item, .actividad-item, .puente-item { border: 1px solid #eee; border-radius: 8px; padding: 15px; text-align: center; cursor: pointer; transition: all 0.3s; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.destino-item:hover, .mes-item:hover, .actividad-item:hover, .puente-item:hover { border-color: #e98e4c; background-color: #fef4f6; color: #e98e4c; }
.destino-item.selected, .mes-item.selected, .actividad-item.selected, .puente-item.selected { border-color: #e98e4c; background-color: #fdf6f7; color: #e98e4c; }
.destino-item svg { width: 40px; height: 40px; margin-bottom: 10px; }

/* =================================================================== */
/* ---               ESTILOS RESPONSIVOS (VISTA MÓVIL)             --- */
/* =================================================================== */

@media (max-width: 768px) {

    /* 1. Formulario principal se apila verticalmente */
    .buscador-viajes-form {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    .search-submit {
        width: 100%;
        height: 50px;
        font-size: 1.1rem;
    }
    .form-group-submit {
        width: 100%;
    }
    .form-group label {
        font-size: 0.9rem;
    }

    /* 2. Popup se convierte en modal de pantalla completa */
    .buscador-popup.active {
        position: fixed; /* CAMBIO CLAVE: Fija el popup a la ventana */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1001; /* CAMBIO CLAVE: Ahora el popup activo está sobre TODO */
        border-radius: 0;
        margin-top: 0;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    /* 3. CAMBIO CLAVE: Mostrar y dar estilo al encabezado del popup en móvil */
    .buscador-popup.active .popup-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        flex-shrink: 0;
    }

    .popup-header .popup-title {
        font-size: 1.1rem;
        font-weight: 600;
        margin: 0;
        text-align: center;
    }

    .close-popup-button {
        font-size: 2.5rem;
        font-weight: 300;
        line-height: 1;
        cursor: pointer;
        color: #888;
    }
    
    /* 4. Ajustar contenido del popup para scroll y padding */
    .tab-content.active {
        flex-grow: 1;
        padding: 15px;
    }

    /* 5. Ajustar rejillas para móvil */
    .destino-grid, .meses-grid, .actividades-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

