:root {
    --sj-blue: #173fa8;
    --sj-blue-dark: #112f87;
    --sj-blue-soft: #eef4ff;
    --sj-text: #0f172a;
    --sj-muted: #667085;
    --sj-border: #d8e1ec;
    --sj-border-soft: #e9eef5;
    --sj-yellow: #facc15;
    --sj-white: #ffffff;
    --sj-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
    --sj-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
    --sj-radius-lg: 26px;
    --sj-radius-md: 20px;
    --sj-radius-sm: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* =========================================
   Homepage header compact tuning
========================================= */
.skyjatra-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.skyjatra-header-inner {
    max-width: 1180px;
    padding: 10px 16px;
    gap: 12px;
}

.skyjatra-logo-fallback,
.custom-logo {
    max-height: 34px;
}

.skyjatra-brand-text {
    font-size: 17px;
}

.skyjatra-header-right {
    gap: 10px;
}

.skyjatra-header-nav {
    gap: 8px;
}

.skyjatra-header-item,
.skyjatra-currency-wrap {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
}

.skyjatra-menu-text,
.skyjatra-currency-select {
    font-size: 13px;
}

/* =========================================
   Hero
========================================= */
.sj-home-hero {
    position: relative;
    min-height: 700px;
    background: url('../images/hero-bg.jpg') center center / cover no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 42px 20px 36px;
}

.sj-home-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 100%);
}

.sj-home-search-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1080px;
}

/* =========================================
   Top Tabs
========================================= */
.sj-home-top-tabs {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto -18px;
    background: var(--sj-white);
    border-radius: 22px;
    box-shadow: var(--sj-shadow-soft);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.sj-home-tab {
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #49566b;
    cursor: pointer;
    padding: 8px 8px 12px;
    position: relative;
    line-height: 1.2;
}

.sj-home-tab.active {
    color: var(--sj-blue);
}

.sj-home-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--sj-yellow);
}

/* =========================================
   Search Card
========================================= */
.sj-home-search-card {
    background: var(--sj-white);
    border-radius: var(--sj-radius-lg);
    box-shadow: var(--sj-shadow);
    padding: 28px 24px 44px;
    overflow: visible;
}

/* =========================================
   Trip Types
========================================= */
.sj-trip-types {
    display: flex;
    gap: 18px 26px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.sj-trip-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--sj-blue);
    cursor: pointer;
    line-height: 1.2;
}

.sj-trip-type input[type="radio"] {
    accent-color: var(--sj-blue);
    cursor: pointer;
}

/* =========================================
   Main Grid
========================================= */
.sj-home-form-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) 58px minmax(180px, 1.1fr) minmax(145px, 0.95fr) minmax(145px, 0.95fr) minmax(180px, 1fr);
    border: 1px solid var(--sj-border);
    border-radius: var(--sj-radius-md);
    background: var(--sj-white);
    overflow: visible;
}

.sj-home-field {
    position: relative;
    padding: 14px 16px;
    border-right: 1px solid var(--sj-border);
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--sj-white);
    min-width: 0;
}

.sj-home-field:last-child {
    border-right: none;
}

.sj-home-field label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #344054;
    margin-bottom: 8px;
    text-transform: uppercase;
    line-height: 1.2;
}

.sj-home-field input[type="text"],
.sj-home-field input[type="date"] {
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 800;
    color: var(--sj-blue-dark);
    background: transparent;
    padding: 0;
    width: 100%;
    min-width: 0;
    line-height: 1.25;
    appearance: none;
    -webkit-appearance: none;
}

.sj-home-field input[type="text"]::placeholder,
.sj-home-field input[type="date"]::placeholder {
    color: #98a2b3;
}

.sj-home-field small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--sj-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sj-field-helper-empty {
    visibility: hidden;
}

/* =========================================
   Swap
========================================= */
.sj-home-swap-btn-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--sj-border);
    background: var(--sj-white);
}

.sj-home-swap-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--sj-border);
    background: var(--sj-white);
    color: var(--sj-blue);
    font-size: 21px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   Travelers
========================================= */
.sj-home-field-travelers {
    position: relative;
    border-right: none;
}

.sj-home-traveller-btn {
    width: 100%;
    min-height: 58px;
    border: 1px solid #c9d5ea;
    border-radius: 14px;
    background: #f8fbff;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
}

.sj-home-traveller-btn strong {
    font-size: 16px;
    line-height: 1.2;
    color: #0f2e87;
    font-weight: 800;
}

.sj-home-traveller-btn small {
    font-size: 13px;
    color: #64748b;
    margin-top: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

/* =========================================
   Traveler Popup
========================================= */
.sj-home-traveller-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 342px;
    max-width: 342px;
    min-width: 342px;
    padding: 0;
    display: none;
    flex-direction: column;
    border-radius: 14px;
    background: var(--sj-white);
    border: 1px solid #d7dfec;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    z-index: 50;
}

.sj-home-traveller-popup.active {
    display: flex;
}

.sj-popup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin: 0;
    border-bottom: 1px solid var(--sj-border-soft);
}

.sj-popup-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sj-popup-meta strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--sj-blue);
    line-height: 1.2;
}

.sj-popup-meta small {
    font-size: 12px;
    color: #64748b;
    line-height: 1.2;
    margin-top: 0;
    white-space: nowrap;
}

.sj-popup-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sj-count-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #b9c8df;
    background: var(--sj-white);
    color: #365ea8;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.sj-count-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sj-popup-counter input {
    width: 18px;
    min-width: 18px;
    padding: 0;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--sj-text);
    appearance: none;
    -webkit-appearance: none;
}

.sj-popup-class-block {
    padding: 14px 16px 0;
}

.sj-popup-class-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sj-blue);
    margin-bottom: 10px;
}

.sj-popup-class-options {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.sj-class-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--sj-text);
    cursor: pointer;
}

.sj-class-option input[type="radio"] {
    margin: 0;
    accent-color: #153f96;
}

.sj-class-option span {
    font-weight: 700;
}

.sj-popup-done-btn {
    width: auto;
    min-width: 84px;
    height: 36px;
    margin: 14px 16px 14px auto;
    display: block;
    border: none;
    border-radius: 8px;
    background: #f4c400;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* =========================================
   Search Button
========================================= */
.sj-home-search-btn-wrap {
    display: flex;
    justify-content: center;
    margin-top: -18px;
    position: relative;
    z-index: 3;
}

.sj-home-search-btn {
    min-width: 160px;
    height: 52px;
    border: none;
    border-radius: 16px;
    background: var(--sj-yellow);
    color: #111827;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(250, 204, 21, 0.32);
    padding: 0 24px;
}

.sj-disabled-field {
    opacity: 0.6;
}

/* =========================================
   Autocomplete
========================================= */
.autocomplete-list {
    position: absolute !important;
    top: calc(100% - 4px);
    left: 0;
    width: 100% !important;
    background: var(--sj-white);
    border: 1px solid var(--sj-border) !important;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    list-style: none;
    padding: 6px 0 !important;
    margin: 0 !important;
    z-index: 30 !important;
    overflow: hidden;
}

.autocomplete-list li {
    padding: 10px 14px !important;
    font-size: 13px;
    color: var(--sj-text);
    cursor: pointer;
    line-height: 1.35;
}

.autocomplete-list li:hover {
    background: #eff6ff;
}

/* =========================================
   Tablet and medium devices
========================================= */
@media (max-width: 991px) {
    .skyjatra-header-inner {
        padding: 10px 12px;
        gap: 10px;
    }

    .skyjatra-logo-fallback,
    .custom-logo {
        max-height: 31px;
    }

    .skyjatra-brand-text {
        font-size: 15px;
    }

    .skyjatra-header-right {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .skyjatra-header-item,
    .skyjatra-currency-wrap {
        min-height: 36px;
        padding: 0 10px;
    }

    .skyjatra-menu-text,
    .skyjatra-currency-select {
        font-size: 12px;
    }

    .sj-home-hero {
        padding: 28px 14px 40px;
        min-height: auto;
    }

    .sj-home-search-wrap {
        max-width: 760px;
    }

    .sj-home-top-tabs {
        gap: 10px;
        padding: 12px 16px;
        margin-bottom: -14px;
    }

    .sj-home-tab {
        font-size: 13px;
    }

    .sj-home-search-card {
        padding: 22px 14px 38px;
        border-radius: 22px;
    }

    .sj-trip-types {
        gap: 12px 18px;
        margin-bottom: 16px;
    }

    .sj-trip-type {
        font-size: 13px;
    }

    .sj-home-form-grid {
        position: relative;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "from to"
            "dep ret"
            "trav trav";
        border-radius: 18px;
        overflow: hidden;
    }

    .sj-home-field,
    .sj-home-swap-btn-wrap {
        border-right: none;
        border-bottom: 1px solid var(--sj-border);
    }

    .sj-home-field {
        min-height: 94px;
        padding: 14px 14px;
    }

    .sj-home-field-from {
        grid-area: from;
        border-right: 1px solid var(--sj-border);
    }

    .sj-home-field-to {
        grid-area: to;
    }

    .sj-home-field-date:not(#sjReturnField) {
        grid-area: dep;
        border-right: 1px solid var(--sj-border);
    }

    #sjReturnField {
        grid-area: ret;
    }

    .sj-home-field-travelers {
        grid-area: trav;
        border-bottom: none;
    }

    .sj-home-swap-btn-wrap {
        position: absolute;
        left: 50%;
        top: 47px;
        transform: translate(-50%, -50%);
        z-index: 4;
        width: auto;
        min-height: 0;
        height: auto;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0;
    }

    .sj-home-swap-btn {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .sj-home-field input[type="text"],
    .sj-home-field input[type="date"] {
        font-size: 15px;
    }

    .sj-home-field small {
        font-size: 11px;
        white-space: normal;
    }

    .sj-home-traveller-btn {
        min-height: 58px;
    }

    .sj-home-traveller-btn strong {
        font-size: 15px;
    }

    .sj-home-traveller-btn small {
        font-size: 12px;
    }

    .sj-home-traveller-popup {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        left: 0;
        right: auto;
    }

    .sj-home-search-btn-wrap {
        margin-top: -16px;
    }

    .sj-home-search-btn {
        min-width: 170px;
        height: 50px;
        font-size: 17px;
    }
}

/* =========================================
   Mobile
========================================= */
@media (max-width: 640px) {
    .skyjatra-header-inner {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .skyjatra-currency-wrap {
        display: none;
    }

    .skyjatra-header-nav {
        gap: 6px;
    }

    .skyjatra-header-item {
        min-height: 34px;
        padding: 0 10px;
    }

    .skyjatra-menu-text {
        font-size: 11px;
    }

    .sj-nav-icon {
        width: 16px;
        height: 16px;
    }

    .sj-home-hero {
        padding: 14px 10px 30px;
        min-height: auto;
        background-position: center center;
    }

    .sj-home-search-wrap {
        max-width: 100%;
    }

    .sj-home-top-tabs {
        width: 100%;
        margin: 0 0 -16px;
        padding: 10px 10px 8px;
        border-radius: 20px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        background: #ffffff;
    }

    .sj-home-tab {
        min-height: 52px;
        border-radius: 14px;
        background: #ffffff;
        border: 1px solid #eef2f7;
        color: #4b5563;
        font-size: 11px;
        font-weight: 800;
        padding: 8px 4px 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .sj-home-tab.active {
        color: var(--sj-blue);
        background: #f8fbff;
    }

    .sj-home-tab.active::after {
        left: 10px;
        right: 10px;
        bottom: 0;
        height: 3px;
    }

    .sj-home-search-card {
        padding: 18px 10px 34px;
        border-radius: 22px;
        box-shadow: 0 18px 34px rgba(15, 23, 42, 0.10);
    }

    .sj-trip-types {
        gap: 10px 14px;
        margin-bottom: 14px;
    }

    .sj-trip-type {
        font-size: 12px;
    }

    .sj-home-form-grid {
        border-radius: 18px;
    }

    .sj-home-field {
        min-height: 88px;
        padding: 12px 12px;
    }

    .sj-home-field label {
        font-size: 10px;
        margin-bottom: 7px;
    }

    .sj-home-field input[type="text"],
    .sj-home-field input[type="date"] {
        font-size: 14px;
    }

    .sj-home-field small {
        font-size: 11px;
        line-height: 1.25;
    }

    .sj-home-swap-btn-wrap {
        top: 44px;
    }

    .sj-home-swap-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .sj-home-traveller-btn {
        min-height: 56px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .sj-home-traveller-btn strong {
        font-size: 15px;
    }

    .sj-home-traveller-btn small {
        font-size: 12px;
    }

    .sj-home-traveller-popup {
        top: calc(100% + 8px);
        border-radius: 14px;
    }

    .sj-popup-row {
        padding: 12px 14px;
        gap: 10px;
    }

    .sj-popup-meta strong {
        font-size: 14px;
    }

    .sj-popup-meta small {
        font-size: 12px;
    }

    .sj-popup-class-options {
        gap: 14px;
    }

    .sj-popup-done-btn {
        min-width: 78px;
        height: 38px;
        margin: 12px 14px 14px auto;
        font-size: 14px;
    }

    .sj-home-search-btn-wrap {
        margin-top: -14px;
    }

    .sj-home-search-btn {
        min-width: 150px;
        height: 48px;
        font-size: 16px;
        border-radius: 15px;
        padding: 0 20px;
    }

    .autocomplete-list li {
        font-size: 12px;
        padding: 10px 12px !important;
    }
}

/* Fix traveler/class popup on mobile */
@media (max-width: 640px) {
    .sj-home-form-grid {
        overflow: visible !important;
    }

    .sj-home-field.sj-home-field-travelers {
        position: relative;
        z-index: 30;
    }

    .sj-home-traveller-popup {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        z-index: 999;
    }
}
