/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    z-index: 100;
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background:
        linear-gradient(145deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    flex-shrink: 0;
}

.brand-name {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.7px;
    white-space: nowrap;
}

.brand-name .blue {
    color: var(--brand-blue);
}

.brand-name .orange {
    color: var(--brand-orange);
}

.brand-tagline {
    display: block;
    color: var(--brand-charcoal);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 1px;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-action {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.header-action:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.header-login {
    border: 1px solid var(--brand-blue);
    color: var(--brand-blue);
    background: #fff;
}

.header-login:hover {
    background: var(--brand-blue-light);
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
    position: relative;
    overflow: visible;
    background:
        radial-gradient(circle at 82% 20%, rgba(251, 97, 3, 0.16), transparent 25%),
        radial-gradient(circle at 12% 0%, rgba(6, 72, 170, 0.30), transparent 35%),
        linear-gradient(135deg, #04377F 0%, #0648AA 55%, #1766C4 100%);
    color: #fff;
    min-height: 410px;
    padding: 72px 0 118px;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px;
    height: 80px;
    background: var(--background);
    clip-path: ellipse(65% 70% at 50% 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.10);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -2px;
    font-weight: 800;
}

.hero h1 span {
    color: #FF9B62;
}

.hero-subtitle {
    max-width: 650px;
    margin: 18px auto 0;
    color: rgba(255,255,255,.86);
    font-size: 17px;
}


/* ============================================================
   SEARCH PANEL
   ============================================================ */

.search-wrapper {
    position: relative;
    z-index: 20;
    margin-top: -84px;
}

.search-panel {
    background: var(--surface);
    border: 1px solid rgba(6, 72, 170, .08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 20px;
}

.search-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1.35fr auto;
    gap: 10px;
    align-items: stretch;
}

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

.search-field-label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 0 0 6px 4px;
}

.search-input {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text);
    padding: 10px 14px 10px 43px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.search-input:hover {
    border-color: #B9C5D5;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(6,72,170,.10);
}

.search-icon {
    position: absolute;
    left: 15px;
    bottom: 18px;
    color: var(--primary);
    font-size: 18px;
    pointer-events: none;
}

.search-field input[type="date"] {
    padding-left: 14px;
}

.search-guests {
    display: flex;
    align-items: center;
    min-height: 58px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    background: #fff;
    cursor: pointer;
}

.search-guests:hover {
    border-color: #B9C5D5;
}

.guest-summary {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.guest-summary strong {
    font-size: 14px;
}

.guest-summary span {
    color: var(--text-muted);
    font-size: 12px;
}

.search-button {
    align-self: end;
    min-height: 58px;
    border: 0;
    border-radius: var(--radius-md);
    padding: 0 27px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 7px 18px rgba(251,97,3,.25);
    transition: transform .15s, background .15s, box-shadow .15s;
    white-space: nowrap;
}

.search-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(251,97,3,.30);
}

.search-button:active {
    transform: translateY(0);
}

.search-button:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}


/* ============================================================
   DESTINATION AUTOCOMPLETE
   ============================================================ */

.destination-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 7px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 100;
}

.destination-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 0;
    background: #fff;
    text-align: left;
}

.destination-option:hover,
.destination-option.active {
    background: var(--brand-blue-light);
}

.destination-pin {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--brand-blue-light);
    display: grid;
    place-items: center;
    color: var(--brand-blue);
}

.destination-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.destination-city {
    font-size: 14px;
    font-weight: 750;
    color: var(--text);
}

.destination-country {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}


/* ============================================================
   GUEST POPOVER
   ============================================================ */

.guest-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    width: 320px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 14px;
    z-index: 100;
}

.guest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 3px;
}

.guest-row + .guest-row {
    border-top: 1px solid var(--border-light);
}

.guest-row-label strong {
    display: block;
    font-size: 14px;
}

.guest-row-label span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 1px;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stepper button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    font-size: 17px;
    line-height: 1;
}

.stepper button:hover {
    border-color: var(--primary);
    background: var(--brand-blue-light);
}

.stepper-value {
    width: 18px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}


/* ============================================================
   TRUST / BENEFITS
   ============================================================ */

.benefits {
    padding: 42px 0 60px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.benefit-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 23px;
}

.benefit-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-blue-light);
    color: var(--brand-blue);
    font-size: 19px;
    margin-bottom: 14px;
}

.benefit-card:nth-child(2) .benefit-icon {
    background: var(--brand-orange-light);
    color: var(--brand-orange);
}

.benefit-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.benefit-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background: #0D1B2A;
    color: #fff;
    padding: 42px 0 28px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: flex-start;
}

.footer-brand {
    font-size: 19px;
    font-weight: 800;
}

.footer-brand .blue {
    color: #65A2FF;
}

.footer-brand .orange {
    color: #FF8B4A;
}

.footer-note {
    margin-top: 7px;
    color: rgba(255,255,255,.55);
    font-size: 12px;
}

.footer-links {
    display: flex;
    gap: 22px;
    color: rgba(255,255,255,.65);
    font-size: 13px;
}

.footer-links a:hover {
    color: #fff;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1050px) {
    .search-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .search-field.destination {
        grid-column: span 3;
    }

    .search-guests {
        grid-column: span 2;
    }

    .search-button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(calc(100% - 24px), var(--container));
    }

    .header-inner {
        min-height: 68px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .brand-name {
        font-size: 19px;
    }

    .brand-tagline {
        font-size: 6px;
        letter-spacing: 1.5px;
    }

    .header-action:not(.header-login) {
        display: none;
    }

    .hero {
        min-height: 380px;
        padding: 55px 0 105px;
    }

    .hero h1 {
        font-size: 38px;
        letter-spacing: -1.3px;
    }

    .hero-subtitle {
        font-size: 14px;
        padding-inline: 10px;
    }

    .search-wrapper {
        margin-top: -70px;
    }

    .search-panel {
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .search-field.destination,
    .search-guests {
        grid-column: auto;
    }

    .destination-dropdown,
    .guest-popover {
        position: fixed;
        left: 12px;
        right: 12px;
        width: auto;
        top: auto;
    }

    .benefits {
        padding-top: 28px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}

/* Multi-room guest selector */
.rooms-container {
    max-height: 430px;
    overflow-y: auto;
    padding-right: 2px;
}

.room-card {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.room-card + .room-card {
    margin-top: 4px;
}

.room-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.room-card-title {
    font-weight: 600;
    color: #111827;
}

.remove-room-button {
    border: 0;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 0;
}

.remove-room-button:hover {
    color: #dc2626;
}

.child-ages {
    margin-top: 10px;
}

.child-age-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 14px;
}

.child-age-select {
    min-width: 90px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.add-room-button {
    width: 100%;
    margin-top: 12px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-weight: 600;
    cursor: pointer;
}

.add-room-button:hover {
    background: #f9fafb;
}

@media (max-width: 700px) {
    .rooms-container {
        max-height: 55vh;
    }
}


/* ============================================================
   GUEST SELECTOR UX REFINEMENT
   ============================================================ */

.search-field.guests {
    min-width: 0;
}

.search-guests {
    width: 100%;
    min-height: 58px;
    justify-content: flex-start;
    text-align: left;
    box-sizing: border-box;
    padding: 10px 14px;
}

.search-guests:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(6,72,170,.10);
    outline: none;
}

.guest-summary {
    width: 100%;
    align-items: flex-start;
}

.guest-popover {
    width: 340px;
    max-height: min(70vh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.rooms-container {
    max-height: none;
    overflow: visible;
}

.room-card {
    padding: 11px 0;
}

.room-card-header {
    margin-bottom: 6px;
}

.guest-row {
    padding: 8px 3px;
}

.child-ages {
    margin-top: 6px;
}

.child-age-row {
    margin-top: 6px;
}

.add-room-button {
    margin-top: 10px;
}

.guest-done-button {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.guest-done-button:hover {
    background: var(--brand-blue-dark);
}

@media (max-width: 1050px) {
    .search-field.guests {
        grid-column: span 2;
    }

    .search-guests {
        grid-column: auto;
    }
}

@media (max-width: 700px) {
    .search-field.guests {
        grid-column: auto;
    }

    .guest-popover {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* ============================================================
   GUEST SELECTOR SCROLLING
   ============================================================ */

.guest-popover {
    display: flex;
    flex-direction: column;

    width: 350px;
    max-height: min(72vh, 620px);

    padding: 0;

    overflow: hidden;
}

.rooms-container {
    flex: 1 1 auto;

    max-height: min(56vh, 490px);

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 12px 14px 6px;

    scrollbar-width: thin;
}

.guest-popover-actions {
    flex: 0 0 auto;

    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;

    padding: 10px 14px 14px;

    border-top: 1px solid var(--border-light);

    background: #fff;

    box-shadow:
        0 -5px 12px rgba(15, 23, 42, .04);
}

.guest-popover-actions .add-room-button,
.guest-popover-actions .guest-done-button {
    margin: 0;
}

.guest-popover-actions .guest-done-button {
    width: auto;
    min-width: 90px;
    padding-left: 18px;
    padding-right: 18px;
}

@media (max-width: 700px) {

    .guest-popover {
        max-height: 72vh;
    }

    .rooms-container {
        max-height: calc(72vh - 72px);
    }

}

/* ============================================================
   COMPACT MULTI-ROOM SELECTOR
   ============================================================ */

.guest-popover {
    width: 360px;
    max-height: min(68vh, 560px);
}

.rooms-container {
    max-height: min(52vh, 430px);
    padding: 8px 14px 4px;
}

.room-card {
    padding: 9px 0;
}

.room-card + .room-card {
    margin-top: 0;
}

.room-card-header {
    margin-bottom: 3px;
}

.room-card-header strong {
    font-size: 14px;
}

.remove-room-button {
    font-size: 11px;
}

.guest-row {
    padding: 6px 2px;
}

.guest-row-label strong {
    font-size: 13px;
}

.guest-row-label span {
    display: none;
}

.stepper {
    gap: 8px;
}

.stepper button {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.stepper-value {
    width: 16px;
    font-size: 13px;
}

.child-ages {
    margin-top: 2px;
}

.child-age-row {
    margin-top: 5px;
    font-size: 12px;
}

.child-age-select {
    min-width: 84px;
    padding: 5px 7px;
}

.guest-popover-actions {
    padding: 9px 14px 11px;
}

.guest-popover-actions .add-room-button {
    padding: 8px 10px;
    font-size: 12px;
}

.guest-popover-actions .guest-done-button {
    min-width: 80px;
    padding: 8px 15px;
    font-size: 12px;
}

/*
 * Guests & rooms must fill its complete search-grid cell,
 * just like the check-in/check-out controls.
 */
.search-field.guests {
    width: 100%;
}

.search-guests {
    width: 100%;
    min-width: 0;
    min-height: 58px;
}

/* ============================================================
   TABBED ROOM SELECTOR — FINAL ROOM EDITOR
   ============================================================ */

.guest-popover {
    width: 390px;
    max-height: none;
    overflow: hidden;
}

.rooms-container {
    display: block;
    max-height: none;
    overflow: visible;
    padding: 0;
}


/* Room tabs */

.room-tabs-shell {
    padding: 11px 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.room-tabs {
    display: flex;
    align-items: center;
    gap: 5px;

    overflow-x: auto;
    overflow-y: hidden;

    padding-bottom: 9px;

    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.room-tab {
    flex: 0 0 auto;

    border: 1px solid var(--border);
    border-radius: 8px;

    padding: 7px 11px;

    background: #fff;
    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
    cursor: pointer;
}

.room-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.room-tab.active {
    border-color: var(--primary);
    background: var(--brand-blue-light);
    color: var(--primary);
}


/* One room editor only */

.active-room-editor {
    padding: 13px 15px 14px;
}

.active-room-editor .room-card-header {
    margin: 0 0 7px;
}

.active-room-editor .room-card-header strong {
    font-size: 15px;
}

.active-room-editor .guest-row {
    padding: 9px 1px;
}

.active-room-editor .guest-row +
.active-room-editor .guest-row {
    border-top: 1px solid var(--border-light);
}

.active-room-editor .guest-row-label strong {
    font-size: 13px;
}

.active-room-editor .guest-row-label span {
    display: block;
    margin-top: 1px;
    font-size: 10px;
}

.active-room-editor .child-ages {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--border-light);
}

.active-room-editor .child-age-row {
    margin: 0;
    padding: 5px 1px;
    font-size: 12px;
}

.active-room-editor .child-age-row +
.active-room-editor .child-age-row {
    border-top: 1px solid var(--border-light);
}

.active-room-editor .child-age-select {
    min-width: 92px;
}


/* Fixed action footer */

.guest-popover-actions {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        90px;

    gap: 8px;

    padding: 10px 12px 12px;

    border-top: 1px solid var(--border-light);

    background: #fff;
    box-shadow:
        0 -4px 12px rgba(15, 23, 42, .035);
}

.guest-popover-actions .add-room-button,
.guest-popover-actions .guest-done-button {
    width: 100%;
    margin: 0;
    min-width: 0;
    min-height: 38px;
}

.guest-popover-actions .add-room-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}


/* Homepage Guests & Rooms field */

.search-field.guests {
    width: 100%;
    min-width: 0;
}

.search-guests {
    width: 100%;
    min-height: 58px;
}


/* Mobile */

@media (max-width: 700px) {

    .guest-popover {
        width: auto;
        left: 12px;
        right: 12px;
    }

    .room-tabs-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .active-room-editor {
        padding-left: 13px;
        padding-right: 13px;
    }
}

/* ============================================================
   SEARCH PANEL VERTICAL POSITION
   ============================================================ */

.search-wrapper {
    margin-top: -120px;
}

@media (max-width: 1050px) {
    .search-wrapper {
        margin-top: -105px;
    }
}

@media (max-width: 700px) {
    .search-wrapper {
        margin-top: -82px;
    }
}

/* ============================================================
   GUEST POPOVER AUTO POSITION
   ============================================================ */

.search-field.guests {
    position: relative;
}

.guest-popover {
    top: calc(100% + 7px);
    bottom: auto;
}

.guest-popover.open-up {
    top: auto;
    bottom: calc(100% + 7px);
}

/*
 * Keep the panel inside the visible viewport.
 */
.guest-popover {
    max-height: min(430px, calc(100vh - 24px));
}

.active-room-editor {
    overflow-y: auto;
    max-height: 280px;
}

/* ============================================================
   FINAL GUEST POPOVER VIEWPORT SAFETY
   ============================================================ */

.guest-popover {
    max-height: min(460px, calc(100vh - 24px));
}

.active-room-editor {
    max-height: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.guest-popover.open-up {
    top: auto;
    bottom: calc(100% + 7px);
}

/* ============================================================
   CENTERED GUEST & ROOM MODAL
   ============================================================ */

.guest-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 980;

    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(2px);
}

.guest-popover {
    position: fixed;

    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;

    z-index: 990;

    width: min(430px, calc(100vw - 28px));
    max-height: min(560px, calc(100vh - 40px));

    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;

    box-shadow:
        0 24px 70px rgba(15, 23, 42, .28);
}

.guest-popover.open-up {
    top: 50%;
    bottom: auto;
}

.guest-modal-open {
    overflow: hidden;
}

.room-tabs-shell {
    flex: 0 0 auto;
}

.active-room-editor {
    flex: 1 1 auto;

    max-height: none;
    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;
}

.guest-popover-actions {
    flex: 0 0 auto;
}

@media (max-width: 700px) {

    .guest-popover {
        left: 50%;
        right: auto;

        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);

        border-radius: 12px;
    }
}
