/* Smooth scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F5F8FF;
}

::-webkit-scrollbar-thumb {
    background: #0073a4;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #26a69a;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hero carousel animations */
.hero-slide {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide.active {
    opacity: 1;
}

/* Parallax effect */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Custom Form Elements - Standardized */
.input-container {
    transition: all 0.2s ease;
    min-width: 0;
}

.input-container:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 115, 164, 0.12);
    border-color: #0073a4 !important;
}

/* Standardized input styling */
.search-input {
    width: 100%;
    background: transparent;
    outline: none;
    color: #1A1A1A;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.search-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555555;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Unified input box base */
.search-input-box {
    background-color: white;
    height: 3rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.search-input-box:hover {
    background-color: #F9FAFB;
}

.search-input-box:focus-within {
    border-color: #0073a4;
    box-shadow: 0 0 0 3px rgba(0, 115, 164, 0.1);
}

.search-input-box .input-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #9CA3AF;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.search-input-box:focus-within .input-icon {
    color: #0073a4;
}

/* Search form grid standardization */
.search-form-grid {
    display: grid;
    gap: 0.75rem;
    align-items: stretch;
}

/* Responsive search button */
.search-btn-primary {
    background-color: #0073a4;
    color: white;
    height: 3rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 20px -5px rgba(0, 115, 164, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.search-btn-primary:hover {
    background-color: #26a69a;
    box-shadow: 0 10px 30px -5px rgba(0, 115, 164, 0.2);
}

.search-btn-primary:active {
    transform: scale(0.98);
}

.search-btn-primary i,
.search-btn-primary svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.search-btn-primary:hover i,
.search-btn-primary:hover svg {
    transform: translateX(2px);
}

/* Sticky Search Fixes */
#search-panel.is-sticky .search-input-box,
#search-panel.is-sticky .input-container {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
}

#search-panel.is-sticky .search-input-box:hover,
#search-panel.is-sticky .input-container:hover {
    background-color: #F1F5F9;
}

#search-panel.is-sticky .search-label,
#search-panel.is-sticky label {
    color: #64748B;
}

#search-panel.is-sticky .search-input,
#search-panel.is-sticky input {
    color: #1E293B;
}

#search-panel.is-sticky .search-input::placeholder,
#search-panel.is-sticky input::placeholder {
    color: #94A3B8;
}

/* Improved Sticky Tabs Readability */
#search-panel.is-sticky {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.12);
}

#search-panel.is-sticky #search-tabs-container {
    background-color: #F1F5F9;
    box-shadow: none;
    padding: 0.375rem;
    margin-bottom: 1rem;
}

#search-panel.is-sticky.is-collapsed #search-tabs-container {
    margin-bottom: 0;
}

#search-panel.is-sticky .search-tab:not(.active) {
    color: #64748B;
}

#search-panel.is-sticky .search-tab:not(.active):hover {
    color: #0073a4;
    background-color: rgba(0, 115, 164, 0.06);
}

/* Button Enhancements */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
}

/* Accent Line */
.accent-line {
    position: relative;
}

.accent-line::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 60px;
    height: 4px;
    background: #0073a4;
    border-radius: 2px;
}

/* Mobile-first responsive improvements */
@media (max-width: 639px) {
    .search-form-grid {
        gap: 0.625rem;
    }

    .search-input-box {
        height: 3rem;
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    .search-btn-primary {
        width: 100%;
        height: 3.25rem;
        font-size: 0.9375rem;
    }

    .search-label {
        font-size: 9px;
    }

    .search-input {
        font-size: 0.8125rem;
    }

    #search-tabs-container {
        justify-content: center;
        gap: 0.25rem;
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    .search-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-btn-primary {
        grid-column: span 2;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .search-btn-primary {
        min-width: 160px;
    }
}

/* Radio button styling for glass panels */
.search-form input[type="radio"] {
    accent-color: #0073a4;
}

#search-panel.is-sticky .search-form input[type="radio"]+span {
    color: #374151;
}

#search-panel.is-sticky .search-form label:hover input[type="radio"]+span {
    color: #0073a4;
}

/* Custom checkbox styling */
.custom-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #D1D5DB;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: transparent;
}

.custom-checkbox:hover {
    border-color: #0073a4;
}

.custom-checkbox:checked {
    background-color: #0073a4;
    border-color: #0073a4;
}

.custom-checkbox:focus {
    box-shadow: 0 0 0 3px rgba(0, 115, 164, 0.2);
    outline: none;
}

.custom-checkbox:checked+.check-icon {
    opacity: 1;
}

/* Popover improvements */
.traveler-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 20rem;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px -5px rgba(0, 115, 164, 0.25);
    padding: 1.25rem;
    z-index: 60;
    border: 1px solid #F3F4F6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

.traveler-popover.is-open,
.traveler-popover:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Counter button styling */
.counter-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555555;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 1.125rem;
    line-height: 1;
    background: white;
    cursor: pointer;
}

.counter-btn:hover {
    border-color: #0073a4;
    color: #0073a4;
    background-color: #F5F8FF;
}

.counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.counter-btn:disabled:hover {
    border-color: #E5E7EB;
    color: #555555;
    background-color: white;
}

.counter-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Custom select dropdown styling */
.custom-select .custom-options {
    animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select .option-item {
    transition: background-color 0.15s ease;
}

.custom-select .option-item:hover {
    background-color: #F5F8FF;
}

.custom-select .option-item:active {
    background-color: #E8EDFC;
}

/* Time picker specific styling */
#tr-time-opts .option-item {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Sticky state adjustments for checkbox */
#search-panel.is-sticky .custom-checkbox {
    border-color: #D1D5DB;
}

#search-panel.is-sticky label span {
    color: #374151;
}

#search-panel.is-sticky label:hover span {
    color: #0073a4;
}

/* Focus visible for accessibility */
.search-input:focus-visible,
.search-btn-primary:focus-visible,
.search-tab:focus-visible {
    outline: 2px solid #0073a4;
    outline-offset: 2px;
}

/* Package checkbox label - always dark for readability */
.pkg-checkbox-label {
    color: #374151 !important;
}

label:hover .pkg-checkbox-label {
    color: #0073a4 !important;
}

/* Sticky state - collapsed to tab bar only */
#search-panel.is-sticky.is-collapsed #search-inputs-container {
    display: none !important;
}

#search-panel.is-sticky #search-inputs-container {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

#search-panel.is-sticky #search-tabs-container {
    margin-bottom: 0;
}

#search-panel.is-sticky:not(.is-collapsed) #search-tabs-container {
    margin-bottom: 1rem;
}

/* Ensure sticky wrapper works */
#search-container-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Collapsed sticky tab bar styling */
#search-panel.is-sticky.is-collapsed {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

#search-panel.is-sticky.is-collapsed #search-tabs-container {
    margin: 0 auto;
    width: fit-content;
}

/* Smooth scrolling for autocomplete containers */
.traveler-popover,
.custom-options {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.traveler-popover::-webkit-scrollbar,
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.traveler-popover::-webkit-scrollbar-thumb,
.custom-options::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

/* Remove border/outline from search inputs */
.search-input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Autocomplete dropdown styling - wider and properly positioned */
.autocomplete-results {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    min-width: 340px !important;
    width: max-content !important;
    max-width: min(500px, 90vw) !important;
    background: white !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 20px 40px -5px rgba(0, 115, 164, 0.25) !important;
    max-height: 320px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.autocomplete-results::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

/* Legacy fallback for any remaining .p-2 items */
.autocomplete-results .p-2 {
    padding: 0.75rem 1rem !important;
    transition: background-color 0.15s ease;
}

.autocomplete-results .p-2:hover {
    background-color: #F5F8FF !important;
}

/* Loading state in autocomplete */
.autocomplete-results .p-3 {
    padding: 1rem !important;
    text-align: center;
}

/* ── Grouped Autocomplete Items ────────────────────────────────── */

/* Section header (e.g., "Destinations", "Hotels", "Other Locations") */
.ac-section-header {
    padding: 0.3rem 0.75rem 0.2rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
    background: #F8FAFC;
    border-bottom: 1px solid #F1F5F9;
    position: sticky;
    top: 0;
    z-index: 1;
    user-select: none;
}

/* Divider between groups (when no label) */
.ac-section-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 0;
}

/* Base autocomplete item */
.ac-item {
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: #334155;
    border-bottom: 1px solid rgba(241, 245, 249, 0.4);
    transition: background-color 0.15s ease;
    line-height: 1.35;
}

.ac-item:last-child {
    border-bottom: 0;
}

.ac-item:hover {
    background-color: #F5F8FF;
}

/* Items under a section header get slight indent */
.ac-section-header + .ac-item,
.ac-section-header + .ac-item ~ .ac-item {
    padding-left: 1.25rem;
}

/* Reset indent for items after a new section header or divider */
.ac-section-divider + .ac-item {
    padding-left: 0.75rem;
}

/* Indented sub-items (individual airports under city group) */
.ac-item-indented {
    padding-left: 2.25rem;
    background-color: rgba(248, 250, 254, 0.5);
    font-size: 0.72rem;
}

.ac-item-indented:hover {
    background-color: #EEF2FF;
}

/* City "All Airports" entry */
.ac-item-city {
    background-color: #F8FAFC;
    border-left: 3px solid var(--color-brand-primary, #0073a4);
    padding-left: calc(0.75rem - 3px);
}

.ac-item-city:hover {
    background-color: #EEF2FF;
}

/* Icon in result items */
.ac-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    line-height: 1;
}

/* IATA code badge */
.ac-code {
    display: inline-flex;
    align-items: center;
    padding: 0.0625rem 0.4rem;
    border-radius: 0.25rem;
    background: var(--color-brand-surface, #F5F8FF);
    color: var(--color-brand-primary, #0073a4);
    font-size: 0.675rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Star rating */
.ac-stars {
    color: #EAB308;
    font-size: 0.7rem;
    letter-spacing: -0.02em;
}

/* Location subtitle */
.ac-location {
    font-size: 0.65rem;
    color: #94A3B8;
    margin-top: 0.05rem;
    line-height: 1.25;
}

/* Ensure input box has relative positioning for dropdown */
.search-input-box {
    position: relative !important;
}

/* Mobile responsiveness for autocomplete */
@media (max-width: 639px) {
    .autocomplete-results {
        min-width: 280px !important;
        max-width: calc(100vw - 2rem) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        max-height: 60vh !important;
    }

    .ac-item-indented {
        padding-left: 1.75rem;
    }

    .ac-section-header {
        font-size: 0.55rem;
        padding: 0.25rem 0.625rem 0.15rem;
    }

    .ac-item {
        padding: 0.3rem 0.625rem;
        font-size: 0.7rem;
    }
}

/* Ensure search forms don't clip dropdowns */
.search-form {
    overflow: visible !important;
}

.search-form-grid {
    overflow: visible !important;
}

#search-inputs-container {
    overflow: visible !important;
}

#search-panel {
    overflow: visible !important;
}

/* Higher z-index for traveler popovers to appear above content */
.traveler-popover {
    z-index: 200 !important;
}

/* Ensure custom-options appear above content */
.custom-options {
    z-index: 200 !important;
}

/* ============================================================
   MOBILE TOUCH & UX POLISH
   ============================================================ */

/* 1. Remove the blue flash on tap (iOS/Android) */
a,
button,
[role="button"],
.cursor-pointer,
input,
select,
label {
    -webkit-tap-highlight-color: transparent;
}

/* 2. Eliminate the 300 ms tap delay on interactive controls */
a,
button,
[role="button"],
.search-tab,
.search-btn-primary,
.counter-btn,
.carousel-dot,
.currency-item,
.currency-item-mobile,
.lang-item,
.lang-item-mobile {
    touch-action: manipulation;
}

/* 3. Mobile-menu touch targets – min 48 px tall */
#currency-trigger-mobile,
#lang-trigger-mobile {
    min-height: 48px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* 4. Transfers mobile swap button */
#btn-swap-transfer-mobile {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* 5. On very small screens (≤ 380 px) shrink tab padding so all 5 tabs fit */
@media (max-width: 380px) {
    .search-tab {
        padding-left: 0.625rem;
        padding-right: 0.625rem;
    }
}

/* 6. Traveler popovers: clamp width & height so they never overflow on narrow viewports */
@media (max-width: 639px) {
    .traveler-popover {
        width: min(20rem, calc(100vw - 2rem)) !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
    }

    /* Right-anchored popovers (flights / tours pax) — keep within viewport */
    #fl-pax-menu,
    #tour-pax-menu {
        right: 0;
        left: auto !important;
        max-width: calc(100vw - 2rem);
    }
}

/* 7. Hero on mobile: tighter vertical padding so the CTA stays visible */
@media (max-width: 639px) {
    .hero-slide .relative.z-10 {
        padding-bottom: 5rem;
    }
}

/* 8. Deal cards on mobile: let image breathe a little more */
@media (max-width: 639px) {
    #exclusive-deals .relative.h-48 {
        height: 11rem;
    }
}

/* 9. Newsletter subscribe button – always full width on mobile */
@media (max-width: 639px) {
    #newsletter-form-btn,
    form .bg-brand-primary[type="button"] {
        width: 100%;
    }
}

/* 10. Sticky search bar: when collapsed on mobile hide the remaining margin */
@media (max-width: 639px) {
    #search-panel.is-sticky.is-collapsed {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* 11. Smooth momentum scroll inside popovers & dropdowns on iOS */
.traveler-popover,
.autocomplete-results,
.custom-options,
#rooms-container,
#pkg-rooms-container,
#modal-rooms-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 12. Body scroll lock when modal is open — no position:fixed, no visual jump */
html.modal-open,
html.modal-open body {
    overflow: hidden !important;
    height: 100% !important;
}

#deal-modal {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}