/* Search Studio: classic-style route pill (airports, dates, passengers, submit). */

.sp-search {
    margin-top: clamp(28px, 3.6vw, 44px);
}

.sp-search__row {
    display: block;
}

/* Route bar: fields + inset submit share one rounded shell. */

.sp-bar {
    /* Light: white shell on cool canvas. Dark: sunk control fill. */
    --sp-bar-fill: var(--sp-surface);
    --sp-bar-separator: var(--color-border-subtle);
    --sp-bar-label: var(--color-text-muted);
    --sp-bar-radius: var(--sp-radius-sm);
    --sp-bar-shadow: 0 4px 16px rgba(13, 21, 32, 0.07), 0 1px 2px rgba(13, 21, 32, 0.04);

    position: relative;
    display: grid;

    /* Airports slightly tighter so a full date range fits without ellipsis */
    grid-template-columns:
        minmax(0, 1.2fr) auto minmax(0, 1.2fr) minmax(12.5rem, 1fr) minmax(6.25rem, 0.38fr) auto;
    min-width: 0;
    padding: 0.375rem;
    background: var(--sp-bar-fill);
    border: 1px solid var(--sp-line-strong);
    border-radius: var(--sp-bar-radius);
    box-shadow: var(--sp-bar-shadow);
    transition: background 0.2s ease, border-color 0.2s ease;
}

:root[data-theme="dark"] .sp-bar {
    --sp-bar-fill: var(--color-control);
    --sp-bar-shadow: none;

    border-color: var(--sp-line);
}

.sp-bar:focus-within {
    border-color: var(--sp-accent);
    z-index: 1;
}

.sp-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    padding: 0.375rem 0.75rem;
}

.sp-cell--to::before,
.sp-cell--to::after,
.sp-cell--dates::after,
.sp-cell--pax::after {
    content: "";
    position: absolute;
    top: 18%;
    bottom: 14%;
    width: 1px;
    background: var(--sp-bar-separator);
    pointer-events: none;
}

.sp-cell--to::before {
    left: 0;
}

.sp-cell--to::after,
.sp-cell--dates::after,
.sp-cell--pax::after {
    right: 0;
}

.sp-cell--dates {
    padding-inline: 0.55rem 0.45rem;
}

.sp-pax {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sp-pax__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--sp-ink-soft);
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sp-pax__btn:hover:not(:disabled) {
    background: var(--sp-accent-wash);
    color: var(--sp-accent-deep);
}

.sp-pax__btn:disabled {
    opacity: 0.35;
}

.sp-cell--pax {
    align-items: flex-start;
    justify-content: center;
    padding-inline: 0.35rem 0.4rem;
}

.sp-cell--pax .sp-pax {
    margin-top: 0.05rem;
    margin-left: -0.15rem;
    min-height: 28px;
}

.sp-cell--pax .sp-pax__btn {
    width: 28px;
    height: 28px;
}

.sp-cell--pax .sp-pax__value {
    min-width: 1.5rem;
    font-size: 16px;
    font-family: var(--sp-font-body);
    font-weight: 500;
    letter-spacing: -0.022em;
    line-height: 1.235;
}

.sp-cell__label {
    margin: 0 0 0 0.125rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--sp-bar-label);
}

.sp-cell__input {
    width: 100%;
    min-height: 28px;
    padding: 0.125rem 0.125rem 0.375rem;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--sp-ink);
    font-family: var(--sp-font-body);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.022em;
    line-height: 1.235;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-font-smoothing: antialiased;
}

.sp-cell__input::placeholder {
    color: rgba(60, 60, 67, 0.45);
}

:root[data-theme="dark"] .sp-cell__input::placeholder {
    color: var(--color-text-faint);
}

.sp-cell__input:focus {
    outline: none;
}

.sp-cell__input.is-set {
    color: var(--sp-ink);
}

/* Date field shares classic `.date-range-input` class for picker JS; Search Studio
   owns the field look so classic-search input chrome never leaks in. */
.sp-page .sp-cell__input.date-range-input {
    width: 100%;
    min-height: 28px;
    padding: 0.125rem 0.125rem 0.375rem;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--sp-ink);
    font-family: var(--sp-font-body);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.022em;
    line-height: 1.235;
    cursor: pointer;
}

.sp-page .sp-cell__input.date-range-input:hover,
.sp-page .sp-cell__input.date-range-input:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

.sp-cell--dates .date-range-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
}

.sp-search,
.sp-search__row,
.sp-bar,
.sp-cell--dates {
    overflow: visible;
}

/* Lift the whole search block above results while overlays are open.
   .sp-hero uses isolation:isolate, so the hero itself must rise. */
.sp-page:has(.date-range-picker-open) .sp-hero,
.sp-page:has(.airport-dropdown.active) .sp-hero {
    position: relative;
    z-index: 10050;
}

.sp-search:has(.date-range-picker-open),
.sp-search:has(.airport-dropdown.active) {
    position: relative;
    z-index: 10050;
}

.sp-cell--airport .airport-search-wrapper {
    width: 100%;
    min-width: 0;
}

/* Keep airport values on the same type scale as the date field. */
.sp-cell--airport .sp-cell__input,
.sp-cell--airport .sp-cell__input[data-selected="true"] {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.022em;
    line-height: 1.235;
}

/* Swap sits between From and To without breaking the pill */

.sp-swap {
    z-index: 1;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-inline: -10px -2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--sp-ink-soft);
    box-shadow: none;
    transition: color 0.2s ease, transform 0.3s var(--sp-ease);
}

.sp-swap:hover {
    color: var(--sp-accent-deep);
    transform: rotate(180deg);
}

/* Submit — inset, same corner as the bar so the form reads as one piece. */

.sp-search__submit {
    position: relative;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 9.25rem;
    margin: 3px 2px 3px 6px;
    padding: 0 18px;
    border: none;
    border-radius: var(--sp-bar-radius);
    background: linear-gradient(135deg, var(--sp-accent), #5e7eff);
    color: var(--sp-accent-ink);
    font-family: var(--sp-font-display);
    font-size: 0.875rem;
    font-weight: 650;
    font-stretch: 105%;
    letter-spacing: -0.005em;
    white-space: nowrap;
    box-shadow: none;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.sp-search__submit:focus-visible {
    outline: 2px solid var(--sp-accent-deep);
    outline-offset: 2px;
}

.sp-search__submit:hover:not(:disabled) {
    filter: brightness(1.03);
}

.sp-search__submit:disabled {
    opacity: 0.6;
}

.sp-search__submit.is-loading .sp-search__submit-label {
    visibility: hidden;
}

.sp-search__submit.is-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(4, 36, 31, 0.25);
    border-top-color: var(--sp-accent-ink);
    border-radius: 50%;
    animation: sp-spin 0.7s linear infinite;
}

@keyframes sp-spin {
    to {
        transform: rotate(360deg);
    }
}

.sp-search__hint {
    min-height: 1.2em;
    margin: 10px 4px 0;
    font-size: 0.8125rem;
    color: var(--sp-ink-faint);
}

.sp-hero:has(+ .sp-results:not([hidden])) .sp-search__hint:empty {
    min-height: 0;
    margin-top: 0;
}

.sp-search__hint.is-error {
    color: var(--danger);
}
