/*
 * Search
 * The search panel (home, airport pages, results) and its fields.
 */

/* ---------- Search panel ---------- */
.search-panel { width: 100%; max-width: 760px; padding: 1.75rem; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--color-on-dark); }
.search-tablist { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.search-tab { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--gray-300); font-weight: 600; font-size: .9rem; }
.search-tab:hover { color: var(--color-on-dark); }
.search-tab.is-active { background: var(--green); color: var(--color-on-dark); }
.search-pane { display: none; }
.search-pane.is-active { display: block; }

.search-form { display: grid; gap: .75rem; }
.search-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.search-row-actions { align-items: center; }
.search-row-places { position: relative; }
.swap-places { position: absolute; left: 50%; top: 50%; z-index: 4; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; margin: -17px 0 0 -17px; border: 3px solid var(--panel); border-radius: var(--radius-round); background: var(--green); color: var(--color-on-dark); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); transition: transform .25s ease, background-color .15s ease; }
.swap-places:hover { background: var(--green-dark); transform: rotate(180deg); }
.swap-places:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 1px; }
.search-submit { justify-self: end; min-width: 190px; }

.field { position: relative; display: flex; align-items: center; background: var(--color-surface); border-radius: var(--radius); border: 2px solid transparent; min-height: 54px; color: var(--color-text); }
.field-icon { margin-left: 1rem; color: var(--color-text); }
.field-input { flex: 1; min-width: 0; height: 100%; min-height: 50px; padding: .5rem .85rem; border: 0; background: transparent; color: var(--color-text); font: inherit; font-size: .95rem; }
.field-input:focus { outline: none; }
.field:focus-within { border-color: var(--blue); }
.field.has-error { border-color: var(--red); }
.field-datetime .field-date { flex: 1.5; padding-right: .25rem; }
.field-datetime .field-time { flex: 1; padding-left: .25rem; }
.field-icon-time { margin-left: .25rem; }
/* The theme draws its own calendar/clock icons, so the native picker button is stretched
   invisibly over the input: clicking anywhere in the field still opens the picker. */
.field-date, .field-time { position: relative; }
.field-date::-webkit-calendar-picker-indicator, .field-time::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; color: transparent; opacity: 0; cursor: pointer; }
.field-date::-webkit-inner-spin-button, .field-time::-webkit-inner-spin-button { display: none; }
.field-place.is-loading::after { content: ""; position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 2px solid var(--gray-300); border-top-color: var(--green); border-radius: var(--radius-round); animation: spin .7s linear infinite; }
.field-note { position: absolute; left: 0; right: 0; top: calc(100% + 4px); display: flex; align-items: center; gap: .35rem; margin: 0; font-size: .8rem; color: var(--color-danger-soft); z-index: 2; }
.field-note[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.place-suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 30; padding: .3rem; }
.place-suggestions[hidden] { display: none; }
.place-suggestion { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; padding: .6rem .75rem; border-radius: var(--radius-sm); cursor: pointer; }
.place-suggestion:hover, .place-suggestion.is-active { background: var(--color-surface-alt); }
.place-suggestion-text { font-weight: 600; }
.place-suggestion-secondary { color: var(--color-text-muted); font-size: .85rem; }

.return-add { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 54px; border: 0; border-radius: var(--radius); background: var(--gray-100); color: var(--color-text); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: .85rem; }
.return-add:hover { background: var(--gray-200); }
.return-add[hidden], .return-fields[hidden] { display: none; }
.return-fields { display: flex; align-items: center; gap: .5rem; }
.return-fields .field { flex: 1; }
.return-remove { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-round); background: rgba(255, 255, 255, .12); color: var(--color-on-dark); }
.return-remove:hover { background: rgba(255, 255, 255, .25); }

.search-stops { display: grid; gap: .5rem; }
.stops-list { display: grid; gap: .5rem; }
.stops-list:empty { display: none; }
.stop-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
.stop-row .field-place { grid-column: 1 / -1; }
.stop-row .stop-wait { grid-column: 1; }
.stop-wait .field-input { appearance: none; cursor: pointer; }
.stop-add { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 54px; border: 0; border-radius: var(--radius); background: var(--gray-100); color: var(--color-text); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: .85rem; }
.stop-add:hover { background: var(--gray-200); }
.stop-add[hidden] { display: none; }
.stop-remove { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-round); background: rgba(255, 255, 255, .12); color: var(--color-on-dark); }
.stop-remove:hover { background: rgba(255, 255, 255, .25); }
@media (min-width: 640px) {
    .stop-row { grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto; }
    .stop-row .field-place { grid-column: auto; }
}

.passengers { position: relative; }
.passengers-trigger { display: inline-flex; align-items: center; gap: .6rem; min-height: 54px; padding: 0 1rem; border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--radius); background: transparent; color: var(--color-on-dark); font-weight: 600; }
.passengers-trigger:hover { background: rgba(255, 255, 255, .08); }
.passengers-popover { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: min(380px, 86vw); padding: 1rem 1.1rem 1.1rem; background: var(--color-surface); color: var(--color-text); border-radius: var(--radius); box-shadow: var(--shadow); }
.passengers-popover[hidden] { display: none; }
.passengers-title { margin: 0 0 .4rem; padding-bottom: .5rem; border-bottom: 1px solid var(--color-border); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.passengers-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; }
.passengers-row small { color: var(--color-text-muted); }
.counter { display: inline-flex; align-items: center; gap: .4rem; }
.counter-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: var(--radius-round); border: 1px solid var(--black); background: var(--color-surface); color: var(--black); }
.counter-btn:hover { background: var(--black); color: var(--color-on-dark); }
.counter-input { width: 42px; height: 30px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); text-align: center; font: inherit; -moz-appearance: textfield; }
.counter-input::-webkit-outer-spin-button, .counter-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.passengers-ok { width: 100%; margin-top: .6rem; }

/* ---------- Search panel: small screens ---------- */
@media (max-width: 767px) {
    .search-panel { padding: 1.1rem; }
    .search-row { grid-template-columns: 1fr; }
    .swap-places { left: auto; right: 1.25rem; }
    .search-submit { width: 100%; justify-self: stretch; }
    .field-datetime { flex-wrap: nowrap; }
}

/* Chauffeur search: duration field and result extras */
.field-duration .field-select { appearance: none; cursor: pointer; }
.field-duration .field-select + .field-select { border-left: 1px solid var(--color-border); }
.quote-km { color: var(--color-text-muted); font-size: .85rem; }
.quote-breakdown { display: grid; margin: 0; padding: 0; list-style: none; font-size: .88rem; }
.quote-breakdown li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--color-border); color: var(--gray-700); }
.quote-breakdown li strong { color: var(--black); white-space: nowrap; }
.quote-breakdown li.is-total { border-bottom: 0; padding-top: .6rem; font-weight: 700; color: var(--black); }
.quote-breakdown li.is-total strong { font-size: 1.05rem; }
.results-notice { display: flex; align-items: flex-start; gap: .6rem; margin: 0 0 1rem; padding: .85rem 1rem; border-radius: var(--radius-md); background: var(--color-notice-bg); color: var(--color-notice-text); font-size: .92rem; }
.results-grid-single { grid-template-columns: minmax(0, 1fr); }
