:root {
    --x-font-sans: "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --x-font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --x-bg: #f6f7fb;
    --x-surface: #ffffff;
    --x-surface-2: #f8fafc;
    --x-text: #0f172a;
    --x-muted: #64748b;
    --x-border: rgba(15, 23, 42, 0.12);
    --x-primary: #2563eb;
    --x-primary-2: #4f46e5;
    --x-radius-lg: 20px;
    --x-radius-md: 14px;
    --x-shadow-1: 0 18px 50px rgba(15, 23, 42, 0.08);
    --x-shadow-2: 0 28px 90px rgba(15, 23, 42, 0.14);
}

body {
    font-family: var(--x-font-sans);
    color: var(--x-text);
    background:
        radial-gradient(1200px 700px at 12% 6%, rgba(37, 99, 235, 0.10), transparent 60%),
        radial-gradient(900px 520px at 88% 14%, rgba(79, 70, 229, 0.08), transparent 62%),
        radial-gradient(900px 520px at 50% 96%, rgba(16, 185, 129, 0.06), transparent 58%),
        var(--x-bg);
}

main.site-main {
    padding-bottom: 0;
}

.form-control,
.form-select {
    border-color: var(--x-border);
    border-radius: var(--x-radius-md);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.14);
}

.btn {
    border-radius: 999px;
}

.card,
.modal-content {
    border-radius: var(--x-radius-lg);
}

.card {
    border-color: rgba(15, 23, 42, 0.08);
}

.login-page,
.xtrips-hero-section,
.search-results-container,
.booking-page-shell {
    font-family: var(--x-font-sans);
}

.login-page h1,
.login-page h2,
.login-page h3,
.xtrips-hero-section h1,
.xtrips-hero-section h2,
.xtrips-hero-section h3 {
    font-family: var(--x-font-display);
}

.sfield-input,
.lf-input,
.pax-display span:first-child,
.mmt-footer .option-price,
.mmt-footer .price-amount,
.mmt-airline-name,
.mmt-mobile-time {
    font-family: var(--x-font-sans) !important;
}

.mobile-filter-btn {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.92);
}

.mobile-filter-backdrop.show {
    background: rgba(2, 6, 23, 0.55);
}

.booking-page-shell {
    margin-top: clamp(1.25rem, 4vw, 3.5rem) !important;
}

@media (max-width: 991.98px) {
    .xtrips-hero-section {
        padding-top: 1.75rem;
    }

    .search-fields-row {
        flex-wrap: wrap;
        padding-left: 12px;
        padding-right: 12px;
    }

    .search-field-hero {
        flex: 1 1 50%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .swap-btn-wrapper {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
        padding: 10px 0;
    }

    .search-card-tagline {
        display: none;
    }

    .results-main-sort-wrap {
        gap: 10px;
    }

    .results-main-sort-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .results-mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border-radius: 999px;
        background: #0f172a;
        border-color: #0f172a;
        color: #fff;
        min-height: 36px;
        padding: 0.45rem 0.9rem;
        font-size: 0.78rem;
        font-weight: 700;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
    }

    .results-mobile-filter-btn:hover,
    .results-mobile-filter-btn:focus {
        background: #1e293b;
        border-color: #1e293b;
        color: #fff;
    }

    .results-main-modify-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        min-height: 36px;
        padding: 0.45rem 0.9rem;
        font-size: 0.78rem;
        font-weight: 700;
        border-radius: 999px;
        white-space: nowrap;
    }

    .search-results-row .mmt-footer {
        padding: 8px 10px !important;
    }

    .search-results-row .mmt-footer .baggage-info {
        font-size: 0.68rem;
        gap: 0.35rem;
    }

    .search-results-row .mmt-footer .flight-details-link {
        font-size: 0.7rem;
        letter-spacing: 0.2px;
    }

    .search-results-row .mmt-footer .price-amount {
        font-size: 1rem !important;
    }

    .search-results-row .mmt-footer .book-now-btn {
        padding: 0.45rem 0.8rem !important;
        font-size: 0.72rem !important;
    }

    .filter-sidebar-col {
        z-index: 1204 !important;
        background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
        box-shadow: 0 -18px 60px rgba(15, 23, 42, 0.18) !important;
    }

    .mobile-filter-backdrop {
        z-index: 1203 !important;
        background: rgba(15, 23, 42, 0.58) !important;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .filter-sidebar-content {
        padding: 14px 12px 96px !important;
        max-height: calc(100dvh - 116px) !important;
        overscroll-behavior: contain;
    }

    .filter-sidebar-content .accordion-body.px-3 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .filter-sidebar-content .d-flex.flex-wrap.gap-2 {
        gap: 0.65rem !important;
    }

    .stop-filter-box,
    .time-filter-box {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: 0;
    }

    .price-dropdown .option-price,
    .price-dropdown .category-badge,
    .results-main-modify-btn {
        font-family: var(--x-font-sans) !important;
    }
}

@media (max-width: 575.98px) {
    .search-results-row .result-card,
    .search-results-row .filterable-flight,
    .search-results-row .split-view-card {
        overflow: visible !important;
    }

    .search-results-row .result-card .card-body > .p-4,
    .search-results-row .result-card .rt-card-shell {
        padding-right: 3rem !important;
    }

    .search-results-row .tripcart-picker-icon {
        top: 12px !important;
        right: 10px !important;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid rgba(148, 163, 184, 0.55);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    }

    .search-results-row .tripcart-picker-icon .fs-4 {
        font-size: 1.2rem !important;
    }

    .search-field-hero {
        flex: 1 1 100%;
        padding: 14px 14px 12px;
    }

    .booking-page-shell {
        margin-top: 1rem !important;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .search-results-row .mmt-flight-header {
        gap: 8px;
        min-width: 0;
    }

    .search-results-row .mmt-airline-name {
        font-size: 0.85rem;
    }

    .search-results-row .mmt-flight-num {
        display: none;
    }

    .search-results-row .mmt-footer {
        padding: 7px 10px 6px !important;
    }

    .search-results-row .mmt-footer .baggage-info {
        display: none;
    }

    .search-results-row .mmt-footer.oneway-footer {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "status action"
            "disclosure disclosure";
        align-items: start;
        column-gap: 10px;
        row-gap: 6px;
    }

    .search-results-row .mmt-footer.oneway-footer .left-group {
        display: contents;
    }

    .search-results-row .mmt-footer.oneway-footer .cancellation-policy {
        grid-area: status;
        min-width: 0;
        display: flex;
        align-items: center;
        align-self: center;
    }

    .search-results-row .mmt-footer.oneway-footer .refund-status-badge {
        font-size: 0.66rem !important;
        letter-spacing: 0.3px;
        padding: 0.32rem 0.55rem !important;
        min-height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .search-results-row .mmt-footer.oneway-footer .flight-details {
        grid-area: disclosure;
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .search-results-row .mmt-footer.oneway-footer .right-group {
        grid-area: action;
        justify-self: end;
        min-width: 0;
        max-width: 46vw;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: flex-end;
        column-gap: 8px;
        row-gap: 2px !important;
    }

    .search-results-row .mmt-footer.oneway-footer .price-container {
        min-width: 0 !important;
        width: auto;
        align-items: flex-end !important;
        display: flex;
        flex-direction: column;
    }

    .search-results-row .mmt-footer.oneway-footer .more-prices-inline {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        max-width: none;
        border-radius: 999px;
        padding: 0.08rem 0;
        font-size: 0.54rem;
        font-weight: 700;
        color: #475569;
        background: transparent;
        width: 100%;
        line-height: 1;
    }

    .search-results-row .mmt-footer.oneway-footer .price-category-split-group {
        align-self: flex-end;
        max-width: 100%;
    }

    .search-results-row .mmt-footer.oneway-footer .price-display.split-price-display {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
        justify-content: flex-end;
        gap: 3px 6px;
        width: auto;
    }

    .search-results-row .mmt-footer.oneway-footer .price-category-btn,
    .search-results-row .mmt-footer.oneway-footer .price-category-toggle {
        min-height: 25px !important;
        padding-top: 2px !important;
        padding-bottom: 2px !important;
    }

    .search-results-row .mmt-footer.oneway-footer .price-category-label {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.64rem;
    }

    .search-results-row .mmt-footer.oneway-footer .book-now-btn {
        min-width: 82px;
        padding: 0.4rem 0.72rem !important;
        align-self: center;
        font-size: 0.67rem !important;
    }

    .search-results-row .mmt-footer.oneway-footer .price-amount {
        font-size: 0.98rem !important;
        line-height: 1;
    }

    .search-results-row .mmt-footer.oneway-footer .flight-details-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        color: #2563eb;
        text-decoration: none;
        font-size: 0;
        line-height: 1;
        padding-top: 2px;
    }

    .search-results-row .mmt-footer.oneway-footer .flight-details-link i {
        margin: 0 !important;
        font-size: 1rem;
        transition: transform 0.18s ease;
    }

    .search-results-row .mmt-footer.oneway-footer .flight-details-link[aria-expanded="true"] i {
        transform: rotate(180deg);
    }

    .search-results-row .result-card .p-4 {
        padding: 8px !important;
    }

    .search-results-row .mmt-mobile-timeline {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 2px;
    }

    .search-results-row .mmt-mobile-top {
        display: inline-flex;
        align-items: baseline;
        gap: 4px;
        font-weight: 800;
        font-size: 0.9rem;
        line-height: 1.05;
        color: #0f172a;
        letter-spacing: -0.2px;
        white-space: nowrap;
    }

    .search-results-row .mmt-mobile-code {
        font-size: 0.68rem;
        font-weight: 800;
        color: rgba(15, 23, 42, 0.62);
        letter-spacing: 0.6px;
    }

    .search-results-row .mmt-mobile-arrow {
        color: rgba(15, 23, 42, 0.35);
        font-size: 0.85rem;
        margin: 0 2px;
    }

    .search-results-row .mmt-mobile-sub {
        font-size: 0.67rem;
        font-weight: 600;
        color: rgba(100, 116, 139, 0.95);
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .results-main-sort-wrap {
        margin-bottom: 0.55rem !important;
    }

    .results-main-sort-controls {
        width: 100%;
        display: grid;
        grid-template-columns: auto auto;
        grid-template-areas:
            "filter modify"
            "label sort";
        align-items: center;
        justify-content: stretch;
        gap: 8px 10px;
    }

    .results-mobile-filter-btn {
        grid-area: filter;
        justify-content: center;
        width: 100%;
        min-height: 34px;
        border-radius: 11px;
        font-size: 0.72rem;
        padding: 0.3rem 0.6rem;
    }

    .results-main-modify-btn {
        grid-area: modify;
        justify-content: center;
        display: inline-flex !important;
        width: 100%;
        min-height: 34px;
        border-radius: 11px;
        font-size: 0.72rem;
        font-weight: 800;
        padding: 0.3rem 0.6rem;
    }

    .results-main-modify-btn span {
        display: inline !important;
    }

    .results-main-sort-controls > .text-muted {
        grid-area: label;
        justify-self: start;
        margin-left: 2px;
    }

    .results-compact-select {
        grid-area: sort;
        min-width: 0;
        width: 100%;
    }

    .filter-sidebar-content {
        padding: 12px 10px 92px !important;
    }

    .filter-sidebar-content .accordion-button {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    .filter-sidebar-content .accordion-body.px-3 {
        padding-left: 0.55rem !important;
        padding-right: 0.55rem !important;
    }

    .filter-sidebar-content .stop-filter-box,
    .filter-sidebar-content .time-filter-box {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid rgba(148, 163, 184, 0.26);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
        transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }

    .filter-sidebar-content .stop-filter-box:hover,
    .filter-sidebar-content .time-filter-box:hover {
        border-color: rgba(37, 99, 235, 0.32);
        box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
    }

    .filter-sidebar-content .stop-filter-box input[type="checkbox"],
    .filter-sidebar-content .time-filter-box input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        margin: 0;
        flex: 0 0 20px;
        border-radius: 6px;
        border: 1.5px solid rgba(148, 163, 184, 0.9);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
        position: relative;
        cursor: pointer;
    }

    .filter-sidebar-content .stop-filter-box input[type="checkbox"]::after,
    .filter-sidebar-content .time-filter-box input[type="checkbox"]::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M6.3 11.2 2.9 7.8l1.1-1.1 2.3 2.3 5.5-5.5 1.1 1.1z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 12px 12px;
        opacity: 0;
    }

    .filter-sidebar-content .stop-filter-box input[type="checkbox"]:checked,
    .filter-sidebar-content .time-filter-box input[type="checkbox"]:checked {
        border-color: #2563eb;
        background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
        box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
    }

    .filter-sidebar-content .stop-filter-box input[type="checkbox"]:checked::after,
    .filter-sidebar-content .time-filter-box input[type="checkbox"]:checked::after {
        opacity: 1;
    }

    .filter-sidebar-content .stop-filter-box .box-content,
    .filter-sidebar-content .time-filter-box .box-content {
        min-width: 0;
        flex: 1 1 auto;
    }

    .filter-sidebar-content .stop-filter-box .lab,
    .filter-sidebar-content .time-filter-box .lab {
        font-size: 0.84rem;
        font-weight: 700;
        color: #0f172a;
    }

    .filter-sidebar-content .stop-filter-box small,
    .filter-sidebar-content .time-filter-box small {
        font-size: 0.72rem;
        font-weight: 700;
        color: #64748b;
    }

    .price-dropdown {
        left: 12px !important;
        right: auto !important;
        width: min(320px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        position: fixed !important;
        top: auto !important;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 18px !important;
        max-height: calc(100dvh - 160px) !important;
        overflow: auto !important;
        overscroll-behavior: contain;
        box-sizing: border-box;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .price-dropdown .dropdown-header {
        padding: 12px 14px !important;
        font-size: 0.76rem !important;
        letter-spacing: 0.2px;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .price-dropdown .price-option,
    .mmt-footer .price-option {
        display: grid !important;
        grid-template-columns: 18px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 10px 12px !important;
        white-space: normal !important;
    }

    .price-dropdown .price-option-quote-cb {
        margin-right: 0 !important;
        margin-top: 2px;
    }

    .price-dropdown .price-option-details,
    .mmt-footer .price-option-details {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: center !important;
        gap: 4px;
        min-width: 0;
    }

    .price-dropdown .option-price,
    .mmt-footer .option-price {
        font-size: 0.96rem !important;
        line-height: 1;
    }

    .price-dropdown .option-category,
    .mmt-footer .option-category {
        width: 100%;
        justify-content: flex-start !important;
    }

    .price-dropdown .option-category .category-badge,
    .mmt-footer .option-category .category-badge {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .result-card.has-dropdown-open,
    .split-view-card.has-dropdown-open {
        transform: none !important;
    }

    .search-results-row .mmt-mobile-top {
        gap: 4px;
        font-size: 0.93rem;
    }

    .search-results-row .mmt-footer.oneway-footer .price-amount {
        white-space: nowrap;
        letter-spacing: -0.4px;
    }

    .search-results-row .mmt-footer.oneway-footer .price-category-split-group {
        max-width: 92px;
    }

    .search-results-row .mmt-footer.oneway-footer .price-container {
        justify-self: end;
    }

    .search-results-row .mmt-footer.oneway-footer .price-display.split-price-display {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end;
        gap: 3px 6px;
    }

    .search-results-row .mmt-footer.oneway-footer .more-prices-inline {
        order: 3;
        flex-basis: 100%;
        text-align: right;
    }

    .search-results-row .mmt-footer.oneway-footer .price-category-split-group {
        order: 1;
    }

    .search-results-row .mmt-footer.oneway-footer .price-amount {
        order: 2;
    }

    .search-results-row .mmt-footer.oneway-footer .flight-details-link {
        opacity: 0.9;
    }

    .search-results-row .mmt-footer.oneway-footer .flight-details-link:active {
        opacity: 0.75;
    }
}

@media (max-width: 412px) {
    .search-results-row .mmt-footer.oneway-footer .refund-status-badge {
        font-size: 0 !important;
        letter-spacing: 0;
        min-width: 30px;
        min-height: 26px;
        padding: 0 !important;
        border-radius: 999px !important;
    }

    .search-results-row .mmt-footer.oneway-footer .refund-status-badge::before {
        font-size: 0.72rem;
        font-weight: 900;
        line-height: 1;
    }

    .search-results-row .mmt-footer.oneway-footer .refund-status-badge[data-refund-type="1"]::before,
    .search-results-row .mmt-footer.oneway-footer .refund-status-badge[data-refund-type="2"]::before,
    .search-results-row .mmt-footer.oneway-footer .refund-status-badge.badge-cheapest::before,
    .search-results-row .mmt-footer.oneway-footer .refund-status-badge.bg-warning::before {
        content: "₹✓";
    }

    .search-results-row .mmt-footer.oneway-footer .refund-status-badge[data-refund-type="0"]::before,
    .search-results-row .mmt-footer.oneway-footer .refund-status-badge.bg-secondary::before {
        content: "₹✕";
    }

    .search-results-row .mmt-footer.oneway-footer .right-group {
        max-width: 50vw;
    }

    .search-results-row .mmt-footer.oneway-footer .price-display.split-price-display {
        display: grid !important;
        grid-template-columns: auto auto;
        grid-template-areas:
            "fare amount"
            "more more";
        align-items: center !important;
        justify-content: end;
        column-gap: 6px;
        row-gap: 2px;
        flex-wrap: unset !important;
    }

    .search-results-row .mmt-footer.oneway-footer .price-category-split-group {
        grid-area: fare;
        max-width: 84px;
    }

    .search-results-row .mmt-footer.oneway-footer .price-amount {
        grid-area: amount;
        font-size: 0.94rem !important;
    }

    .search-results-row .mmt-footer.oneway-footer .more-prices-inline {
        grid-area: more;
        justify-self: end;
        text-align: right;
        padding-top: 1px;
    }

    .search-results-row .mmt-footer.oneway-footer .price-category-label {
        max-width: 52px;
    }
}

@media (max-width: 420px) {
    .search-results-row .result-card .card-body > .p-4,
    .search-results-row .result-card .rt-card-shell {
        padding-right: 2.85rem !important;
    }

    .search-results-row .mmt-footer.oneway-footer .more-prices-inline {
        display: inline-flex !important;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .stop-filter-box,
    .time-filter-box {
        flex-basis: 100% !important;
    }

    .results-main-sort-controls {
        grid-template-columns: 1fr 1fr;
    }

    .search-results-row .mmt-footer.oneway-footer .right-group {
        max-width: 48vw;
    }

    .price-dropdown {
        width: min(300px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;
        left: 10px !important;
    }

    .search-results-row .mmt-mobile-top {
        font-size: 0.9rem;
    }
}

@media (min-width: 1200px) {
    .results-mobile-filter-btn,
    #mobileFilterBtn {
        display: none !important;
    }
}
