/* api-rez-compact.css — wyszukiwarka promowa (TomSelect + Flatpickr) */

.api-rez {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    box-sizing: border-box;
}

.api-rez *, .api-rez *::before, .api-rez *::after {
    box-sizing: inherit;
}

/* ═══════════════════════════════════════════
   ZAKŁADKI (tabs) — styl jak na promy-retravel
   ═══════════════════════════════════════════ */
.api-rez-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.api-rez-tabs-group {
    display: flex;
    gap: 0;
}

.api-rez-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin: 0;
    user-select: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.api-rez-tab:first-child {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.api-rez-tab:last-child {
    border-radius: 0 8px 8px 0;
}

.api-rez-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.api-rez-tab span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.api-rez-tab.is-active {
    background: linear-gradient(135deg, #4a7ae8, #1a56db);
    border-color: #3264d6;
    color: #fff;
    font-weight: 600;
}

.api-rez-tab:hover:not(.is-active) {
    background: #eef2f7;
    color: #334155;
}

/* ═══════════════════════════════════════════
   IKONY
   ═══════════════════════════════════════════ */
.api-rez-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    vertical-align: middle;
}

.api-rez-icon-oneway {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3'/%3E%3C/svg%3E");
}

.api-rez-icon-return {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5'/%3E%3C/svg%3E");
}

.api-rez-icon-car {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm10 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z'/%3E%3Cpath d='M5 15V11a1 1 0 0 1 1-1h1.5l1.2-2.4A1.5 1.5 0 0 1 10.04 7h3.92a1.5 1.5 0 0 1 1.34.6L17.5 10H19a1 1 0 0 1 1 1v4'/%3E%3Cpath d='M9 15h6M5 15h-.5a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5H5m14 2h.5a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5H19'/%3E%3C/svg%3E");
}

.api-rez-icon-walk {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════
   POLA — 1 wiersz (jedna strona) / 2 wiersze (obie strony)
   Obie strony: siatka — kierunek = wyjazd+godzina, trasa = reszta wiersza
   ═══════════════════════════════════════════ */
.api-rez-compact,
.api-rez-compact .api-rez-fields,
.api-rez-compact .api-rez-fields-row,
.api-rez-compact .api-rez-field-country,
.api-rez-compact .api-rez-field-route {
    overflow: visible;
}

.api-rez-compact .ts-wrapper {
    position: relative;
    overflow: visible;
}

.api-rez-compact .ts-dropdown {
    width: 100%;
    min-width: 0;
    left: 0;
    right: auto;
}

.api-rez-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.api-rez-fields.is-roundtrip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 10px;
    align-items: end;
}

.api-rez-fields.is-roundtrip .api-rez-fields-row {
    display: contents;
}

.api-rez-fields.is-roundtrip .api-rez-field-country {
    grid-column: 1;
    grid-row: 1;
}

.api-rez-fields.is-roundtrip .api-rez-field-route {
    grid-column: 2 / -1;
    grid-row: 1;
}

.api-rez-fields.is-roundtrip .api-rez-outbound-fields {
    grid-column: 1;
    grid-row: 2;
}

.api-rez-fields.is-roundtrip .api-rez-return-fields {
    grid-column: 2;
    grid-row: 2;
}

.api-rez-fields.is-roundtrip:not(.is-search-ready) .api-rez-fields-row--actions {
    display: contents;
}

.api-rez-fields.is-roundtrip:not(.is-search-ready) .api-rez-field-btn {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
    margin-top: 1rem;
}

/* Gotowe do szukania — wszystkie pola w jednym wierszu, przycisk osobno pod spodem */
.api-rez-fields.is-search-ready {
    row-gap: 1.5rem;
    column-gap: 10px;
}

.api-rez-fields.is-search-ready .api-rez-fields-row--actions {
    flex: 1 1 100%;
    width: 100%;
    display: flex;
    padding-top: 0;
    margin-top: 0;
}

.api-rez-fields.is-roundtrip.is-search-ready {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 10px;
    row-gap: 1.5rem;
    align-items: end;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-fields-row {
    display: contents;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-field-country {
    grid-column: 1;
    grid-row: 1;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-field-route {
    grid-column: 2 / -1;
    grid-row: 1;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-outbound-fields {
    grid-column: 1;
    grid-row: 2;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-return-fields {
    grid-column: 2;
    grid-row: 2;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-field-pax {
    grid-column: 1;
    grid-row: 3;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: none;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-pax-qty {
    width: 100%;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-pax-input {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-fields-row--actions {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    width: 100%;
    min-width: 0;
}

.api-rez-fields.is-roundtrip.is-search-ready .api-rez-field-btn {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
}

.api-rez-fields.is-roundtrip .api-rez-field-country,
.api-rez-fields.is-roundtrip .api-rez-field-route {
    overflow: visible;
    min-width: 0;
}

.api-rez-fields.is-roundtrip .api-rez-field-country .ts-wrapper,
.api-rez-fields.is-roundtrip .api-rez-field-route .ts-wrapper {
    width: 100%;
    max-width: 100%;
}

.api-rez-fields-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
}

.api-rez-fields-row--bottom {
    justify-content: flex-start;
}

.api-rez-fields-row--actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
}

.api-rez-fields:not(.is-roundtrip):not(.is-search-ready) .api-rez-fields-row--actions {
    display: contents;
}

.api-rez-fields:not(.is-roundtrip).is-search-ready .api-rez-field-btn {
    flex: 1 1 auto;
    width: 100%;
}

.api-rez-outbound-fields,
.api-rez-return-fields {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    min-width: 0;
}

.api-rez-fields.is-roundtrip .api-rez-outbound-fields .api-rez-field,
.api-rez-fields.is-roundtrip .api-rez-return-fields .api-rez-field {
    flex: 1 1 0;
    min-width: 0;
}

.api-rez-fields.is-roundtrip .api-rez-outbound-fields .api-rez-field-hour,
.api-rez-fields.is-roundtrip .api-rez-return-fields .api-rez-field-hour {
    min-width: 0;
}

/* Roundtrip + wybór trasy powrotu — układ pionowy (bez ściskania w jednej kolumnie) */
.api-rez-fields.is-roundtrip.has-return-route-choice {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row {
    display: flex;
    width: 100%;
    min-width: 0;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--top {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--top .api-rez-field-country {
    flex: 1 1 140px;
    min-width: 0;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--top .api-rez-field-route {
    flex: 2 1 220px;
    min-width: 0;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--bottom {
    flex-direction: column;
    gap: 12px;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-outbound-fields,
.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-return-fields {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-return-route {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-outbound-fields .api-rez-field,
.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-return-fields .api-rez-field {
    flex: 1 1 0;
    min-width: 0;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--actions {
    display: flex;
    width: 100%;
    justify-content: stretch;
    align-items: stretch;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-btn {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    margin-top: 1rem;
}

.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-btn .api-rez-compact-cta,
.api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-btn .rs-cta {
    width: 100%;
}

.api-rez-fields.is-roundtrip.has-return-route-choice.is-search-ready {
    display: flex;
    flex-direction: column;
    gap: 12px;
    row-gap: 1.25rem;
}

.api-rez-fields.is-roundtrip.has-return-route-choice.is-search-ready .api-rez-fields-row--actions {
    display: flex;
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    justify-content: stretch;
    align-items: stretch;
}

.api-rez-fields.is-roundtrip.has-return-route-choice.is-search-ready .api-rez-field-pax {
    width: 100%;
    max-width: none;
}

.api-rez-fields.is-roundtrip.has-return-route-choice.is-search-ready .api-rez-field-btn {
    width: 100%;
    max-width: none;
    margin-top: 0;
}

.api-rez-field-return-route {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

.api-rez-fields:not(.is-roundtrip) .api-rez-outbound-fields {
    display: contents;
}

.api-rez-return-fields {
    flex: 0 1 auto;
}

/* W jedną stronę — wszystko w jednym rzędzie (do momentu pokazania pasażerów) */
.api-rez-fields:not(.is-roundtrip) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}

.api-rez-fields:not(.is-roundtrip).is-search-ready {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    row-gap: 1.5rem;
    column-gap: 10px;
}

.api-rez-fields:not(.is-roundtrip).is-search-ready .api-rez-fields-row--top,
.api-rez-fields:not(.is-roundtrip).is-search-ready .api-rez-fields-row--bottom {
    display: contents;
}

.api-rez-fields:not(.is-roundtrip) .api-rez-fields-row {
    display: contents;
}

.api-rez-field {
    min-width: 0;
}

.api-rez-field-route {
    flex: 2 1 0;
}

.api-rez-field-country {
    flex: 0.9 1 0;
}

.api-rez-field-date {
    flex: 1 1 0;
}

.api-rez-field-hour {
    flex: 0.85 1 0;
    min-width: 108px;
}

.api-rez-field-return-hour {
    min-width: 118px;
}

.api-rez-field-pax {
    flex: 0.7 1 0;
    min-width: 110px;
}

.api-rez-fields:not(.is-roundtrip):not(.is-search-ready) .api-rez-field-btn {
    flex: 0 0 auto;
}

.api-rez-field-btn {
    flex: 0 0 auto;
}

/* ── Etykiety ── */
.api-rez-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.api-rez-field label:has(.api-rez-label-ico) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.api-rez-label-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.65;
}

.api-rez-label-ico--ferry {
    width: 0.92rem;
    height: 0.92rem;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url('ico-ferry-p-4.svg') center / contain no-repeat;
    mask: url('ico-ferry-p-4.svg') center / contain no-repeat;
    transform: scaleX(-1);
}

/* ── Inputs ── */
.api-rez-input,
.api-rez-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 46px;
    appearance: none;
    -webkit-appearance: none;
}

.api-rez-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b9b9b9;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 42px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 32px;
    cursor: pointer;
}

.api-rez-select:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, 0.2);
}

.api-rez-input:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, 0.2);
}

.api-rez-input-date {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 34px;
}

.api-rez-input-date::placeholder,
.api-rez .flatpickr-input + input::placeholder {
    color: #303030 !important;
    opacity: 1;
}

/* ═══════════════════════════════════════════
   PASAŻEROWIE — +/- counter
   ═══════════════════════════════════════════ */
.api-rez-pax-qty {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    height: 46px;
    overflow: hidden;
    background: #fff;
    width: 130px;
    box-sizing: border-box;
}

.api-rez-pax-qty .api-rez-pax-btn {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    height: 46px;
    border: none !important;
    border-radius: 0 !important;
    background: #f8fafc;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #475569;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
    outline: none;
}

.api-rez-pax-qty .api-rez-pax-btn:hover:not(:disabled) {
    background: #e2e8f0;
}

.api-rez-pax-qty .api-rez-pax-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.api-rez-pax-input {
    flex: 1 1 auto;
    width: 54px;
    min-width: 40px;
    max-width: 54px;
    text-align: center;
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    height: 46px !important;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    background: #fff !important;
    -moz-appearance: textfield;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
    outline: none;
}

.api-rez-pax-input::-webkit-inner-spin-button,
.api-rez-pax-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ═══════════════════════════════════════════
   PRZYCISK SZUKAJ — pomarańczowy jak /rezerwuj (rs-cta)
   Wariant turkusowy: .api-rez-btn-primary--teal
   ═══════════════════════════════════════════ */
.api-rez-compact {
    --bf-cta: #ed8800;
    --bf-cta-mid: #f09418;
    --bf-cta-dark: #d97a00;
}

.api-rez-compact .rs-cta,
.api-rez-compact .api-rez-compact-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 0 28px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(180deg, var(--bf-cta-mid) 0%, var(--bf-cta) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(237, 136, 0, 0.25);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
}

.api-rez-compact .rs-cta:hover,
.api-rez-compact .api-rez-compact-cta:hover {
    background: linear-gradient(180deg, var(--bf-cta) 0%, var(--bf-cta-dark) 100%);
    box-shadow: 0 2px 6px rgba(237, 136, 0, 0.3);
    transform: translateY(-1px);
}

.api-rez-compact .rs-cta:active,
.api-rez-compact .api-rez-compact-cta:active {
    transform: scale(0.98);
}

.api-rez-compact .rs-cta.is-loading,
.api-rez-compact .api-rez-compact-cta.is-loading {
    pointer-events: none;
    opacity: 0.92;
}

.api-rez-compact .rs-cta-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: api-rez-cta-spin 0.7s linear infinite;
}

@keyframes api-rez-cta-spin {
    to { transform: rotate(360deg); }
}

.api-rez-btn {
    padding: 0 28px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s, box-shadow 0.3s ease;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.api-rez-btn-primary--teal {
    background: linear-gradient(135deg, #06c9e0, #0891b2);
    color: #fff;
    box-shadow: 0 4px 14px rgba(4, 176, 199, 0.35);
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.api-rez-btn-primary--teal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.api-rez-btn-primary--teal:hover::before {
    opacity: 1;
}

.api-rez-btn-primary--teal:hover {
    box-shadow: 0 6px 20px rgba(4, 176, 199, 0.45);
    transform: translateY(-1px);
}

.api-rez-btn-primary--teal:active {
    transform: scale(0.98);
}

/* Legacy alias — turkusowy wariant */
.api-rez-btn-primary {
    background: linear-gradient(135deg, #06c9e0, #0891b2);
    color: #fff;
    box-shadow: 0 4px 14px rgba(4, 176, 199, 0.35);
}

/* ═══════════════════════════════════════════
   TOM SELECT — styl jak na promy-retravel
   ═══════════════════════════════════════════ */
.api-rez .ts-wrapper {
    min-height: 42px;
}

.api-rez .ts-wrapper .ts-control {
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    padding: 9px 12px;
    min-height: 46px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: none;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.api-rez .ts-wrapper.focus .ts-control,
.api-rez .ts-wrapper.single.input-active .ts-control {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, 0.2);
    outline: 0;
}

.api-rez .ts-wrapper .ts-control > input {
    font-size: 14px;
}

.api-rez .ts-wrapper .ts-control > .item[data-value=""] ,
.api-rez .ts-wrapper .ts-control > input::placeholder {
    color: #303030 !important;
    opacity: 1;
}

.api-rez .ts-wrapper.single .ts-control > input[placeholder] {
    color: #303030 !important;
}

.api-rez .ts-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    margin-top: 4px;
    z-index: 9999;
}

.api-rez .ts-dropdown .option {
    padding: 10px 14px;
    font-size: 13px;
    color: #303030;
}

.api-rez .ts-dropdown .option.active {
    background: #eff6ff;
    color: #1e40af;
}

.api-rez .ts-dropdown .dropdown-input-wrap {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.api-rez .plugin-dropdown_input.focus .ts-dropdown .dropdown-input {
    border: 2px solid #86b7fe;
    border-radius: 4px;
    padding: 10px 36px 10px 10px;
    font-size: 14px;
    height: 44px;
    width: 100%;
    box-shadow: none;
    outline: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
}

/* ═══════════════════════════════════════════
   KRAJ — opcje z flagami i separatorem
   ═══════════════════════════════════════════ */
.api-rez-kraj-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}

.api-rez-kraj-flag {
    flex-shrink: 0;
    font-size: 1em;
    width: 20px;
    text-align: center;
}

.api-rez-kraj-flag.fi {
    border-radius: 2px;
}

.api-rez-kraj-opt-all .api-rez-kraj-flag {
    font-size: 1.1em;
}

.api-rez-kraj-sep {
    padding: 0 !important;
    margin: 0;
}

.api-rez-kraj-sep hr {
    border: none !important;
    height: 1px;
    background: #888;
    background-image: repeating-linear-gradient(90deg, #888 0, #888 4px, transparent 4px, transparent 8px);
    margin: 8px 0;
}

.api-rez .ts-dropdown .option[data-disabled] {
    padding: 2px 14px !important;
    min-height: 0 !important;
    margin: 0;
    cursor: default;
    background: none !important;
}

.api-rez .ts-dropdown [data-selectable] + [data-selectable] {
    border-top: 1px dashed #eee;
}

/* ── Opcje tras — układ jak na promy-retravel ── */
.api-rez-route-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.api-rez-route-cities {
    font-weight: 500;
    color: #1e293b;
}

.api-rez-route-armator {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: auto;
    padding-left: 12px;
    white-space: nowrap;
}

.api-rez .ts-dropdown .option.active .api-rez-route-cities {
    color: #1e40af;
}

.api-rez .ts-dropdown .option.active .api-rez-route-armator {
    color: #94a3b8;
}

/* ═══════════════════════════════════════════
   FLATPICKR — styl jak na promy-retravel
   ═══════════════════════════════════════════ */
.api-rez .flatpickr-input {
    cursor: pointer;
    color: #1d1d1d !important;
    -webkit-text-fill-color: #1d1d1d !important;
    opacity: 1 !important;
}

.api-rez-field.is-disabled {
    pointer-events: none;
}

.api-rez-field.is-disabled label {
    color: #94a3b8;
}

.api-rez-field.is-disabled .api-rez-input,
.api-rez-field.is-disabled .api-rez-select,
.api-rez-field.is-disabled .flatpickr-input,
.api-rez-field.is-disabled .api-rez-pax-qty {
    background-color: #e9ecef !important;
    border-color: #d1d5db !important;
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

.api-rez-field.is-disabled .api-rez-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
}

.api-rez-field.is-disabled .api-rez-input::placeholder,
.api-rez-field.is-disabled .flatpickr-input::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

.api-rez-field.is-disabled .api-rez-input-date,
.api-rez-field.is-disabled .flatpickr-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5'/%3E%3C/svg%3E");
}


.api-rez input.flatpickr-input[readonly] + .form-control.input,
.api-rez .flatpickr-alt-input,
.api-rez input[type="text"].flatpickr-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    height: 46px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 34px;
}

.flatpickr-calendar {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    width: 400px;
    padding: 0 0 10px;
}

.flatpickr-calendar.open {
    z-index: 9999;
}

.flatpickr-months {
    padding: 10px 0 6px;
}

.flatpickr-current-month {
    font-size: 1.1rem;
    font-weight: 600;
    padding-top: 4px;
    pointer-events: none;
}

.flatpickr-current-month .numInputWrapper .arrowUp,
.flatpickr-current-month .numInputWrapper .arrowDown {
    display: none;
}

.flatpickr-current-month input.cur-year {
    -moz-appearance: textfield;
}

.flatpickr-current-month input.cur-year::-webkit-inner-spin-button,
.flatpickr-current-month input.cur-year::-webkit-outer-spin-button {
    display: none;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    padding: 10px 14px;
    background: transparent !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: transparent !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    width: 20px;
    height: 20px;
    fill: #333;
    transition: fill 0.15s ease;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: #dc3545;
}

.flatpickr-innerContainer {
    padding: 4px 12px 8px;
}

span.flatpickr-weekday {
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    padding-bottom: 6px;
}

.flatpickr-rContainer,
.flatpickr-days {
    width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    gap: 6px 10px;
    padding: 0 2px;
    justify-content: center;
}

.flatpickr-day {
    height: 42px;
    line-height: 42px;
    flex: 0 0 calc((100% - 60px) / 7);
    max-width: calc((100% - 60px) / 7);
    font-size: 0.95rem;
    border-radius: 6px;
}

.flatpickr-day:not(.flatpickr-disabled):not(.prevMonthDay):not(.nextMonthDay) {
    background: #f0f6fd;
}

.flatpickr-day:not(.flatpickr-disabled):not(.prevMonthDay):not(.nextMonthDay):hover {
    background: #0e5ca7;
    border-color: #0e5ca7;
    color: #fff;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: #0e5ca7 !important;
    border-color: #0e5ca7 !important;
    color: #fff !important;
}

.flatpickr-day.today {
    border-color: #0e5ca7;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #d0d0d0;
    text-decoration: line-through;
}

.fp-cal-wyjazd .flatpickr-day.selected,
.fp-cal-powrot .flatpickr-day.selected,
.fp-cal-powrot .flatpickr-day.fp-day-wyjazd {
    position: relative;
    overflow: visible;
    display: inline-flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 6px !important;
    line-height: 1 !important;
}

.fp-cal-wyjazd .flatpickr-day.selected::after,
.fp-cal-powrot .flatpickr-day.selected::after,
.fp-cal-powrot .flatpickr-day.fp-day-wyjazd::after {
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.fp-cal-wyjazd .flatpickr-day.selected::after {
    content: 'wyjazd';
}

.fp-cal-powrot .flatpickr-day.selected::after {
    content: 'powr\00f3t';
}

.fp-cal-powrot .flatpickr-day.fp-day-wyjazd {
    background: #094a85 !important;
    border-color: #094a85 !important;
    color: #fff !important;
    text-decoration: none !important;
    opacity: 1 !important;
}

.fp-cal-powrot .flatpickr-day.fp-day-wyjazd::after {
    content: 'wyjazd';
}

/* Mobile — wyskakujący kalendarz jak na promowej */
@media (max-width: 768px) {
    .flatpickr-calendar {
        width: calc(100vw - 24px) !important;
        max-width: 400px;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        z-index: 10050 !important;
    }

    .flatpickr-calendar.arrowTop::before,
    .flatpickr-calendar.arrowTop::after,
    .flatpickr-calendar.arrowBottom::before,
    .flatpickr-calendar.arrowBottom::after {
        display: none;
    }

    body.flatpickr-mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 10040;
    }

    .flatpickr-day {
        height: 44px;
        line-height: 44px;
        max-height: 44px;
    }
}

/* ═══════════════════════════════════════════
   ALERT
   ═══════════════════════════════════════════ */
.api-rez-alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.api-rez-alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1100px) {
    .api-rez-fields:not(.is-roundtrip) {
        flex-wrap: wrap;
    }

    .api-rez-fields:not(.is-roundtrip) .api-rez-field-country {
        flex: 1 1 calc(35% - 8px);
    }

    .api-rez-fields:not(.is-roundtrip) .api-rez-field-route {
        flex: 1 1 calc(65% - 8px);
    }

    .api-rez-fields:not(.is-roundtrip) .api-rez-field-date,
    .api-rez-fields:not(.is-roundtrip) .api-rez-field-hour,
    .api-rez-fields:not(.is-roundtrip) .api-rez-field-return-hour {
        flex: 1 1 calc(25% - 8px);
    }

    .api-rez-fields:not(.is-roundtrip) .api-rez-field-pax {
        flex: 0 0 120px;
    }

    .api-rez-fields:not(.is-roundtrip) .api-rez-field-btn {
        flex: 1 1 auto;
    }

    .api-rez-field-btn .api-rez-compact-cta,
    .api-rez-field-btn .rs-cta {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .api-rez-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .api-rez-tabs-group {
        width: 100%;
    }

    .api-rez-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }

    /* Kierunek i trasa — osobne wiersze */
    .api-rez-fields .api-rez-fields-row--top,
    .api-rez-fields:not(.is-roundtrip) .api-rez-fields-row--top,
    .api-rez-fields.is-roundtrip .api-rez-fields-row--top,
    .api-rez-fields.is-roundtrip.is-search-ready .api-rez-fields-row--top,
    .api-rez-fields:not(.is-roundtrip).is-search-ready .api-rez-fields-row--top,
    .api-rez-fields.is-search-ready .api-rez-fields-row--top {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
        flex: 1 1 100%;
    }

    .api-rez-fields:not(.is-roundtrip) .api-rez-fields-row--bottom,
    .api-rez-fields.is-roundtrip .api-rez-fields-row--bottom,
    .api-rez-fields.is-roundtrip.is-search-ready .api-rez-fields-row--bottom,
    .api-rez-fields:not(.is-roundtrip).is-search-ready .api-rez-fields-row--bottom,
    .api-rez-fields.is-search-ready .api-rez-fields-row--bottom {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
        flex: 1 1 100%;
    }

    .api-rez-fields .api-rez-field-country,
    .api-rez-fields .api-rez-field-route,
    .api-rez-fields.is-search-ready .api-rez-field-country,
    .api-rez-fields.is-search-ready .api-rez-field-route {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }

    /* Pasażerowie na całą szerokość */
    .api-rez-fields .api-rez-field-pax,
    .api-rez-fields.is-search-ready .api-rez-field-pax {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--top {
        flex-direction: column;
    }

    .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-outbound-fields,
    .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-return-fields {
        flex-direction: column;
    }

    .api-rez-fields.is-roundtrip {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .api-rez-fields.is-roundtrip.is-search-ready {
        grid-template-rows: auto auto auto auto;
    }

    .api-rez-fields.is-roundtrip .api-rez-field-country,
    .api-rez-fields.is-roundtrip .api-rez-field-route,
    .api-rez-fields.is-roundtrip .api-rez-outbound-fields,
    .api-rez-fields.is-roundtrip .api-rez-return-fields,
    .api-rez-fields.is-roundtrip:not(.is-search-ready) .api-rez-field-btn {
        grid-column: 1;
        grid-row: auto;
    }

    .api-rez-fields.is-roundtrip.is-search-ready .api-rez-field-pax {
        grid-column: 1;
        grid-row: 3;
    }

    .api-rez-fields.is-roundtrip.is-search-ready .api-rez-fields-row--actions {
        grid-column: 1;
        grid-row: 4;
        display: flex;
    }

    .api-rez-outbound-fields,
    .api-rez-return-fields {
        flex: 1 1 100%;
        width: 100%;
    }

    .api-rez-fields:not(.is-roundtrip).is-search-ready .api-rez-fields-row--actions {
        flex-direction: column;
        align-items: stretch;
    }

    .api-rez-fields-row,
    .api-rez-outbound-fields,
    .api-rez-return-fields,
    .api-rez-field-country,
    .api-rez-field-route,
    .api-rez-field-date,
    .api-rez-field-hour,
    .api-rez-field-return-hour,
    .api-rez-field-pax,
    .api-rez-field-btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .api-rez-field-btn .api-rez-compact-cta,
    .api-rez-field-btn .rs-cta {
        width: 100%;
    }

    .api-rez-field-btn {
        margin-top: 8px;
    }

    .api-rez-pax-qty {
        width: 100% !important;
    }

    .api-rez-pax-qty .api-rez-pax-input {
        max-width: none !important;
        flex: 1 1 auto !important;
    }
}
