/* Flight search results */

#flight-results {
    padding-bottom: 8px;
    position: relative;
}

.flight-results-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Card shell ── */
.flight-offer-card {
    position: relative;
    background: #fff;
    border: 1px solid #e4e9f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    overflow: hidden;
}

.flight-offer-card:hover {
    border-color: #b8c9e8;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.09);
    transform: translateY(-2px);
}

.flight-offer-card--partner {
    border-left: 3px solid #e85d04;
}

/* ── Toolbar ── */
.flight-offer-card__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px 0;
    min-height: 32px;
}

.flight-offer-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.flight-offer-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.flight-offer-badge--cheapest {
    background: #dcfce7;
    color: #15803d;
}

.flight-offer-badge--optimal {
    background: #dbeafe;
    color: #1d4ed8;
}

.flight-offer-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.flight-offer-source {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: #fff4ec;
    border: 1px solid #fddcc8;
    color: #c2410c;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
}

.flight-offer-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.flight-offer-share:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

/* ── Clickable body ── */
.flight-offer-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 10px 18px 18px;
}

.flight-offer-card__link:hover,
.flight-offer-card__link:focus {
    text-decoration: none;
    color: inherit;
}

.flight-offer-card__layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Top row: price + meta side by side ── */
.flight-offer-card__top {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.flight-offer-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    flex-shrink: 0;
}

.flight-offer-price {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.flight-offer-price-note {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.2;
}

.flight-offer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.flight-offer-meta__pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 8px;
    background: #f4f7fb;
    border: 1px solid #e8eef5;
    font-size: 12px;
    font-weight: 500;
    color: #5b6b82;
    line-height: 1.3;
    white-space: nowrap;
}

/* ── Legs (outbound + return) ── */
.flight-offer-card__legs {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.flight-offer-leg-label {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 2px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eef4ff;
    border: 1px solid #dbe7ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
}

.flight-offer-card__route--return .flight-offer-leg-label {
    background: #f0fdf4;
    border-color: #dcfce7;
    color: #15803d;
}

.flight-offer-card__route--return {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}

/* ── Full-width route section below ── */
.flight-offer-card__route {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 2fr) minmax(0, 1fr);
    gap: 8px 20px;
    align-items: center;
    width: 100%;
}

.flight-offer-point {
    min-width: 0;
}

.flight-offer-point__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.flight-offer-point__head--end {
    justify-content: flex-end;
}

.flight-offer-point__brand {
    flex-shrink: 0;
}

.flight-offer-point__airline {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e8ecf1;
    padding: 4px;
    display: block;
}

.flight-offer-point__airline-fallback {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9, #e8ecf1);
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.flight-offer-point__schedule {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.flight-offer-point__flight-name {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.flight-offer-point__time {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.flight-offer-point__city {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
}

.flight-offer-point__date {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.flight-offer-point__code {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.05em;
    margin-top: 3px;
}

.flight-offer-point--arr .flight-offer-point__city,
.flight-offer-point--arr .flight-offer-point__date,
.flight-offer-point--arr .flight-offer-point__code {
    text-align: right;
}

/* ── Timeline ── */
.flight-offer-timeline {
    text-align: center;
    padding: 0 4px;
}

.flight-offer-timeline__meta {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.35;
}

.flight-offer-timeline__track {
    display: flex;
    align-items: center;
    gap: 0;
}

.flight-offer-timeline__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #e8ecf1;
    flex-shrink: 0;
    font-size: 14px;
}

.flight-offer-timeline__icon--dep {
    color: #2563eb;
}

.flight-offer-timeline__icon--arr {
    color: #16a34a;
}

.flight-offer-timeline__line {
    flex: 1;
    position: relative;
    height: 4px;
    background: #dde3ec;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 6px;
    border-radius: 5px;
}

.flight-offer-timeline__layover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background: #fff;
    border: 1.5px solid #dde3ec;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
    margin-top: -1px;
}

/* ── Results header ── */
.search-results-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: normal;
}

#load-more-flights {
    border-radius: 999px;
    padding: 10px 28px;
    font-weight: 600;
    border-color: #e2e8f0;
    color: #475569;
}

#load-more-flights:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* ── Sidebar filters ── */
.flights-listing-filters {
    top: 0;
    z-index: 20;
    border: 1px solid #e8ecf1;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.flights-listing-filters__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.flights-listing-filters__clear {
    color: #2563eb;
    font-weight: 500;
}

.flights-listing-filters .filterbox.flights-filterbox {
    margin-bottom: 1.1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
}

.flights-listing-filters .filterbox.flights-filterbox:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.flights-listing-filters .filterbox.flights-filterbox .form-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.45rem;
}

.flights-listing-filters .form-select {
    font-size: 0.92rem;
    border-radius: 8px;
    border-color: #e2e8f0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    appearance: auto;
}

.flights-listing-filters .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.flights-listing-filters__apply {
    font-weight: 600;
    border-radius: 8px;
    padding: 0.55rem 1rem;
}

#flight-results.flight-results--filtering {
    pointer-events: none;
}

#flight-results.flight-results--filtering .flight-results-list,
#flight-results.flight-results--filtering .search-results-header {
    opacity: 0.35;
    transition: opacity 0.15s ease;
}

.flight-results-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4.5rem;
    background: rgba(255, 255, 255, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.flight-results-loader.is-visible {
    opacity: 1;
    visibility: visible;
}

.flight-results-loader__panel {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    color: #334155;
    font-size: 0.875rem;
    font-weight: 600;
}

.flight-results-loader__spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid #cbd5e1;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: flight-results-spin 0.65s linear infinite;
}

@keyframes flight-results-spin {
    to { transform: rotate(360deg); }
}

/* Layover checkboxes */
.flights-layovers-filter__heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8ecf1;
}

.flights-layovers-filter__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flights-layover-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.3;
    user-select: none;
}

.flights-layover-option span {
    flex: 1;
}

.flights-layover-option .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
}

.flights-layover-option .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.flights-layover-option .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    border-color: #93c5fd;
}

@media (max-width: 991.98px) {
    .flights-listing-filters {
        position: static !important;
        top: auto;
        margin-bottom: 1rem;
    }
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .flight-offer-card__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .flight-offer-card__route {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .flight-offer-leg-label {
        margin-bottom: 4px;
    }

    .flight-offer-point--arr .flight-offer-point__city,
    .flight-offer-point--arr .flight-offer-point__date,
    .flight-offer-point--arr .flight-offer-point__code,
    .flight-offer-point--arr .flight-offer-point__head {
        text-align: left;
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .flight-offer-card__toolbar,
    .flight-offer-card__link {
        padding-left: 14px;
        padding-right: 14px;
    }

    .flight-offer-price {
        font-size: 24px;
    }

    .flight-offer-meta {
        font-size: 12px;
    }

    .flight-offer-point__time {
        font-size: 19px;
    }

    .flight-offer-point__airline,
    .flight-offer-point__airline-fallback {
        width: 38px;
        height: 38px;
    }
}
