:root {
    --c-black: #000000;
    --c-navy: #14213D;
    --c-orange: #FCA311;
    --c-gray: #E5E5E5;
    --c-white: #FFFFFF;

    --fs-h1: clamp(2rem, 5vw, 4.75rem);
    --fs-h2: clamp(1.5rem, 2.8vw, 2.5rem);
    --fs-body: clamp(0.95rem, 1.1vw, 1.05rem);
    --fs-small: clamp(0.8rem, 0.9vw, 0.9rem);

    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;

    --radius-pill: 999px;
    --radius-card: 18px;
    --shadow-soft: 0 18px 42px rgb(0 0 0 / 14%);

    --container-max: 1240px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Trebuchet MS", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: var(--fs-body);
    line-height: 1.4;
    color: var(--c-black);
    background: var(--c-white);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
    display: block;
}

.container,
.container-fluid {
    width: min(var(--container-max), calc(100% - (var(--sp-5) * 2)));
    margin-inline: auto;
}

main {
    position: relative;
}

.text-center {
    text-align: center;
}

.btn {
    border: 0;
    border-radius: var(--radius-pill);
    padding: 0.7rem 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.btn-orange {
    background: var(--c-orange);
    color: var(--c-black);
}

.btn-sm {
    padding: 0.56rem 1rem;
    font-size: var(--fs-small);
}

.btn-light-pill {
    background: var(--c-white);
    color: var(--c-black);
    border: 1px solid var(--c-gray);
}

.w-100 {
    width: 100%;
}

.muted {
    color: rgb(0 0 0 / 66%);
}

.tb-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--c-navy);
    color: var(--c-white);
    box-shadow: 0 10px 24px rgb(0 0 0 / 12%);
}

.tb-header-inner {
    min-height: 62px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--sp-4);
    padding: 0.42rem 0;
}

.tb-logo {
    font-size: clamp(1.28rem, 2vw, 1.62rem);
    line-height: 1.06;
    font-weight: 900;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.tb-logo-trips {
    color: var(--c-white);
}

.tb-logo-back {
    color: var(--c-orange);
}

.tb-header-search-wrap {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 120;
}

.tb-top-search {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(170px, 1.2fr) auto minmax(170px, 1.2fr) auto;
    align-items: center;
    gap: var(--sp-2);
    width: min(760px, 100%);
    background: var(--c-white);
    color: var(--c-black);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.4rem 0.35rem 0.85rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--c-gray);
}

.tb-search-segment {
    position: relative;
    min-width: 0;
}

.tb-search-label {
    display: block;
    font-size: 0.7rem;
    line-height: 1.1;
    color: rgb(0 0 0 / 58%);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
    margin-bottom: 0.18rem;
}

.tb-text-input,
.tb-field-button {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    color: var(--c-black);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    outline: none;
}

.tb-field-button {
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-top-search .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-gray);
}

.tb-search-icon {
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--c-orange);
    color: var(--c-black);
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.47rem 0.82rem;
    cursor: pointer;
}

.tb-who-dropdown,
.tb-date-fallback {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: 1200;
    background: var(--c-white);
    border: 1px solid #dfe6ef;
    border-radius: 16px;
    box-shadow: 0 16px 34px rgb(20 33 61 / 18%);
    width: min(320px, 90vw);
}

.tb-date-fallback {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 0.85rem;
    display: grid;
    gap: 0.7rem;
}

.tb-date-fallback label {
    display: grid;
    gap: 0.32rem;
    font-size: 0.78rem;
    color: rgb(0 0 0 / 70%);
    font-weight: 700;
}

.tb-date-fallback input[type="date"] {
    border: 1px solid var(--c-gray);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
}

.tb-who-dropdown {
    padding: 0.75rem;
    color: var(--c-black);
}

.tb-who-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 0.45rem 0.2rem;
}

.tb-who-title {
    color: var(--c-navy);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.tb-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.tb-stepper-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #c3d0e2;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, #f7fafe 100%);
    color: var(--c-navy);
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.05;
    cursor: pointer;
    box-shadow: 0 4px 10px rgb(20 33 61 / 10%);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tb-stepper-btn:hover:not(:disabled) {
    border-color: #9fb2cf;
    box-shadow: 0 7px 14px rgb(20 33 61 / 13%);
    transform: translateY(-1px);
}

.tb-stepper-btn:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

.tb-who-row .js-count-value {
    min-width: 28px;
    text-align: center;
    color: var(--c-black);
    font-weight: 800;
    font-size: 0.95rem;
}

.tb-who-done {
    margin-top: 0.35rem;
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: var(--c-navy);
    color: #fff;
    font-weight: 700;
    padding: 0.54rem 0.9rem;
    cursor: pointer;
}

.tb-flatpickr-anchor {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.flatpickr-calendar {
    z-index: 1300;
}

.select2-container {
    width: 100% !important;
}

.tb-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
}

.tb-mini-link {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.tb-header .btn-sm {
    padding: 0.48rem 0.9rem;
    font-size: 0.78rem;
    line-height: 1.1;
}

.tb-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 12px;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.tb-menu-toggle span {
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--c-white);
    display: block;
}

.tb-footer {
    background: var(--c-gray);
    padding: var(--sp-6) 0;
    margin-top: var(--sp-8);
}

.tb-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3) var(--sp-5);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--sp-3);
}

.tb-copy {
    margin: 0;
    font-size: 0.84rem;
    color: rgb(0 0 0 / 68%);
}

.tb-loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(20 33 61 / 52%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 999;
}

.tb-loader.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tb-loader-box {
    background: var(--c-white);
    border-radius: 14px;
    border: 1px solid var(--c-gray);
    padding: 0.95rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    color: var(--c-navy);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--c-gray);
    border-top-color: var(--c-orange);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

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

@media (max-width: 1024px) {
    .tb-header-inner {
        grid-template-columns: auto 1fr auto;
        gap: var(--sp-3);
        min-height: 58px;
        padding: 0.4rem 0;
    }

    .tb-top-search {
        width: min(640px, 100%);
        padding: 0.33rem 0.38rem 0.33rem 0.75rem;
        grid-template-columns: minmax(100px, 1fr) auto minmax(135px, 1fr) auto minmax(135px, 1fr) auto;
    }

    .tb-header-actions {
        gap: var(--sp-2);
    }
}

@media (max-width: 768px) {
    .container,
    .container-fluid {
        width: calc(100% - (var(--sp-4) * 2));
    }

    .tb-header-inner {
        grid-template-columns: auto auto;
        grid-template-areas:
            "logo menu"
            "search search"
            "actions actions";
        justify-content: space-between;
        align-items: center;
        gap: var(--sp-3);
    }

    .tb-logo {
        grid-area: logo;
    }

    .tb-menu-toggle {
        grid-area: menu;
        display: inline-block;
    }

    .tb-header-search-wrap {
        grid-area: search;
    }

    .tb-header-actions {
        grid-area: actions;
        display: none;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-top: 0.35rem;
        border-top: 1px solid rgb(255 255 255 / 22%);
    }

    .tb-header.is-open .tb-header-actions {
        display: flex;
    }

    .tb-top-search {
        grid-template-columns: 1fr;
        border-radius: 22px;
        padding: 0.6rem 0.7rem;
        gap: 0.55rem;
    }

    .tb-top-search .dot {
        display: none;
    }

    .tb-search-segment {
        border-bottom: 1px solid var(--c-gray);
        padding-bottom: var(--sp-2);
    }

    .tb-search-segment:last-of-type {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .tb-search-icon {
        width: 100%;
    }

    .tb-who-dropdown,
    .tb-date-fallback {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        top: auto;
        transform: translateX(-50%);
        width: min(420px, calc(100vw - 1.2rem));
        border-radius: 18px;
    }
}

@media (max-width: 414px) {
    .tb-header-inner {
        min-height: 56px;
    }

    .tb-footer {
        margin-top: var(--sp-7);
    }

    .tb-footer-links {
        gap: var(--sp-2) var(--sp-4);
    }
}

@media (max-width: 375px) {
    .tb-logo {
        font-size: 1.4rem;
    }
}

@media (max-width: 320px) {
    .tb-mini-link {
        font-size: 0.8rem;
    }
}
