body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f5f7fa;
    font-weight: 600;
}

.header {
    background: linear-gradient(135deg, #0c0150, #00aaff);
    padding: 20px 0;
    position: relative;
}

.hero {
    padding: 120px 0;
    background: url('img/hero-bg.jpg') no-repeat center center/cover;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero h1, .hero p, .hero .btn {
    position: relative;
    z-index: 2;
}

.footer {
    background: #0c0150;
    padding: 40px 0;
}

.btn-cta {
    background: linear-gradient(90deg, #0c0150, #00aaff);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.btn-cta:hover::before {
    width: 200px;
    height: 200px;
}

.btn-cta:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-trip-type {
    width: 150px;
    padding: 10px 0;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid #0c0150;
    background: #e9ecef;
    color: #0c0150;
    font-weight: 500;
}

.btn-trip-type.active {
    background: linear-gradient(90deg, #0c0150, #00aaff);
    color: white;
    border: none;
    box-shadow: 0 0 10px rgba(0, 74, 173, 0.5);
}

.btn-trip-type:hover {
    filter: brightness(1.05);
    box-shadow: 0 0 10px rgba(0, 74, 173, 0.3);
}

.btn-trip-type:active {
    transform: scale(0.95);
}

.search-card {
    background: url('img/search-bg.png') no-repeat center center/cover;
    border: none;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1;
}

.search-card * {
    position: relative;
    z-index: 2;
}

.form-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0c0150;
    text-transform: uppercase;
}

.form-control {
    border: 2px solid #0c0150;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #00aaff;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.3);
    outline: none;
}

.suggestions-list {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.suggestions-list .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestions-list .list-group-item:hover {
    background-color: #e9ecef;
}

#flight-results {
    margin-top: 2rem;
    position: relative;
    z-index: 5;
}

#flights-table {
    background-color: #ffffff;
    opacity: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid #0c0150;
    z-index: 20;
}

#flights-table th {
    background: linear-gradient(90deg, #0c0150, #00aaff);
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 14px;
    text-transform: uppercase;
}

#flights-table td {
    vertical-align: middle;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 14px;
    border: 1px solid #dee2e6;
    color: #333;
}

#flights-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

#flights-table .btn-cta {
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 600;
}

.offer-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.banner-promo .badge {
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 25px;
}

#destinos-destacados img {
    max-height: 350px;
    object-fit: cover;
    width: 100%;
}

#destinos-destacados h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0c0150;
}

#destinos-destacados p {
    font-size: 0.9rem;
    color: #555;
}

/* Estilos responsive generales */
@media (max-width: 767px) {
    .hero {
        padding: 80px 0;
    }
    .btn-trip-type {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    #flight-search-form {
        flex-direction: column;
    }
    #flight-search-form .col-12 {
        margin-bottom: 1rem;
    }
    .offer-card {
        margin-bottom: 1.5rem;
    }
    #destinos-destacados img {
        max-height: 350px;
    }
    #flights-table th,
    #flights-table td {
        font-size: 0.9rem;
        padding: 10px;
    }
    #flights-table .btn-cta {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

/* Estilos para el buscador */
.search-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    position: relative;
    overflow: visible !important; /* Importante para no cortar sugerencias */
    z-index: 10;
}

.col-12.col-md-5 {
    position: relative;
}

.suggestions-list {
    position: absolute;
    z-index: 1002;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: -2px;
    border: 1px solid #ced4da;
    border-top: none;
}

.suggestion-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f1f1;
}

.suggestion-item:hover {
    background-color: #e9ecef;
}

.suggestion-item:last-child {
    border-bottom: none;
}

#flights-table {
    background-color: #ffffff;
    opacity: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    z-index: 20;
}

#flights-table th {
    background: linear-gradient(90deg, #0c0150, #00aaff);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px;
    text-transform: uppercase;
}

#flights-table td {
    vertical-align: middle;
    font-size: 1rem;
    font-weight: 500;
    padding: 14px;
    border: 1px solid #dee2e6;
    color: #333;
}

#flights-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Fix para móviles */
@media (max-width: 767px) {
    .search-card {
        padding: 15px;
        overflow: visible !important;
    }

    .suggestions-list {
        top: 100%;
        left: 0;
        right: 0;
        z-index: 9999 !important; /* siempre arriba */
        background: #fff;
        border: 1px solid #ced4da;
        border-top: none;
        border-radius: 0 0 8px 8px;
        max-height: 250px;
        overflow-y: auto;
    }

    #origin, #destination {
        position: relative;
        z-index: 10000 !important;
    }

    .suggestion-item {
        padding: 12px;
    }

    #flights-table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* Contenedor principal */
.container {
    position: relative;
    z-index: 1;
}

body {
    position: relative;
    overflow-x: hidden;
}
/* Forzar que las sugerencias se vean siempre arriba */
.col-12.col-md-5 {
    position: relative;
    z-index: auto; /* no crear stacking bajo */
}

.suggestions-list {
    position: absolute;
    top: 100%;   /* siempre debajo del input */
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 99999 !important; /* mucho más alto que inputs, tabla y botón */
}

/* Inputs arriba en jerarquía, pero debajo de las sugerencias */
#origin, #destination {
    position: relative;
    z-index: 1000;
}

/* Botón Buscar no debe tapar */
#flight-search-form button {
    position: relative;
    z-index: 1;
}
/* Asegurar que cada columna de input permita ver sugerencias */
.col-12.col-md-5 {
    position: relative;
    z-index: auto; /* evitar stacking conflict */
}

/* Estilo general para listas de sugerencias (Origen y Destino) */
#origin-suggestions,
#destination-suggestions {
    position: absolute;
    top: 100%;   /* justo debajo del input */
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 99999 !important; /* siempre arriba */
}

/* Inputs arriba en jerarquía, pero debajo de la lista */
#origin,
#destination {
    position: relative;
    z-index: 1000;
}

/* Evitar que el botón Buscar tape sugerencias */
#flight-search-form .col-12.col-md-2 {
    position: relative;
    z-index: 1;
}
