.search-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: 1200px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 15px;
    animation: searchFadeIn 1.5s forwards;
    opacity: 0;
    transition-timing-function: cubic-bezier(0.785, 0.135, 0.15, 0.86);
    animation-delay: 2.5s;
    transform: translateY(20px);
    position: relative;
    /* Mobile-friendly touch improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.search-field {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    /* Touch-friendly improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.search-field:hover {
    background-color: #f8f9fa;
}

.search-field.location {
    flex: 1.5;
    position: relative;
}

.search-field.has-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 280px;
    overflow-y: auto;
}

.dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.check-icon {
    width: 16px;
    height: 16px;
    color: #22c55e;
}

.dropdown-item {
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
    color: #666;
    font-size: 14px;
    /* Mobile-friendly touch improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    /* Minimum touch target size */
    min-height: 44px;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.selected {
    background-color: #f0f9ff;
    color: #1d4ed8;
}

.location-count {
    color: #9ca3af;
    font-size: 12px;
    margin-left: auto;
    font-weight: 500;
}

.dropdown-item:hover .location-count {
    color: #6b7280;
}

.dropdown-item.selected .location-count {
    color: #1d4ed8;
    opacity: 0.8;
}

/* ── Date Range Panel ───────────────────────────────────────────── */
.date-range-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 640px;
    overflow: hidden;
}

.date-range-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Header with check-in / check-out tabs */
.drp-header {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.drp-tab {
    flex: 1;
    padding: 16px 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.drp-tab:first-child {
    border-right: 1px solid #e5e7eb;
}

.drp-tab.active {
    border-bottom-color: #4338ca;
    background: #f8f7ff;
}

.drp-tab-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.drp-tab.active .drp-tab-label {
    color: #4338ca;
}

.drp-tab-date {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.drp-tab.active .drp-tab-date {
    color: #4338ca;
}

/* Side-by-side month grids */
.drp-months {
    display: flex;
    align-items: flex-start;
    padding: 20px 12px;
    gap: 0;
    position: relative;
}

.drp-month {
    flex: 1;
    padding: 0 8px;
}

.drp-month-title {
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    margin-bottom: 12px;
}

/* Prev / Next nav arrows */
.drp-nav {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    color: #374151;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-top: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.drp-nav:hover {
    background-color: #f3f4f6;
    color: #4338ca;
}

.drp-nav:active {
    transform: scale(0.92);
}

.drp-nav.disabled {
    opacity: 0.25;
    pointer-events: none;
}

/* Calendar grid */
.drp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.drp-day-header {
    padding: 6px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
}

.drp-cell {
    position: relative;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    z-index: 1;
}

.drp-cell.drp-empty {
    cursor: default;
}

.drp-cell:not(.drp-disabled):not(.drp-empty):hover {
    z-index: 2;
}

/* The visible circle / pill on each cell */
.drp-cell::after {
    content: '';
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    right: 3px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    transition: background-color 0.15s ease;
}

.drp-cell:not(.drp-disabled):not(.drp-empty):hover::after {
    background-color: #f0f0f0;
}

/* ── Range background strip (behind circles) ────────────────────── */
/* The ::before pseudo creates the continuous horizontal band between start and end */
.drp-cell::before {
    content: '';
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    right: 0;
    z-index: -2;
    pointer-events: none;
}

/* ── Selected start (check-in) ──────────────────────────────────── */
.drp-cell.drp-range-start::after {
    background-color: #4338ca;
}
.drp-cell.drp-range-start {
    color: white;
    font-weight: 600;
}
/* Half strip on the right side of start date when range exists */
.drp-cell.drp-range-start.drp-has-end::before {
    left: 50%;
    background-color: #ede9fe;
}

/* ── Selected end (check-out) ───────────────────────────────────── */
.drp-cell.drp-range-end::after {
    background-color: #4338ca;
}
.drp-cell.drp-range-end {
    color: white;
    font-weight: 600;
}
/* Half strip on the left side of end date */
.drp-cell.drp-range-end::before {
    right: 50%;
    background-color: #ede9fe;
}

/* ── In-range dates ─────────────────────────────────────────────── */
.drp-cell.drp-in-range::before {
    background-color: #ede9fe;
}
.drp-cell.drp-in-range {
    color: #4338ca;
}

/* ── Hover preview range ────────────────────────────────────────── */
.drp-cell.drp-hover-range::before {
    background-color: #f5f3ff;
}
.drp-cell.drp-hover-range {
    color: #6d63d5;
}

/* Hover end shows a light circle */
.drp-cell.drp-hover-end::after {
    background-color: #e0ddf7;
}
.drp-cell.drp-hover-end {
    color: #4338ca;
    font-weight: 600;
}
/* Hover end also gets a half strip on its left */
.drp-cell.drp-hover-end::before {
    right: 50%;
    background-color: #f5f3ff;
}
/* If start date has hover active after it, show right strip */
.drp-cell.drp-range-start:not(.drp-has-end) {
    /* Check via sibling — handled by JS with hover-range on subsequent cells */
}

/* ── Today marker ───────────────────────────────────────────────── */
.drp-cell.drp-today:not(.drp-range-start):not(.drp-range-end)::after {
    border: 2px solid #f59e0b;
    background-color: #fef3c7;
}
.drp-cell.drp-today:not(.drp-range-start):not(.drp-range-end) {
    color: #92400e;
    font-weight: 600;
}

/* ── Disabled dates ─────────────────────────────────────────────── */
.drp-cell.drp-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Guest dropdown ─────────────────────────────────────────────── */
.guest-dropdown {
    min-width: 280px;
    padding: 8px 0;
}

.guest-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.guest-counter:last-child {
    border-bottom: none;
}

.guest-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guest-type {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.2;
}

.guest-desc {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.guest-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.guest-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid #d1d5db;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
    color: #6b7280;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.guest-btn svg {
    flex-shrink: 0;
}

.guest-btn:hover {
    border-color: #1f2937;
    color: #1f2937;
    background-color: #f9fafb;
}

.guest-btn:active {
    transform: scale(0.92);
}

.guest-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #e5e7eb;
    color: #d1d5db;
}

.guest-btn:disabled:hover {
    border-color: #e5e7eb;
    color: #d1d5db;
    background-color: white;
}

.guest-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    font-size: 16px;
    color: #1f2937;
}

.field-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    opacity: 0.6;
    flex-shrink: 0;
}

.field-content {
    flex: 1;
    min-width: 0;
}

.field-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field-dropdown {
    width: 12px;
    height: 12px;
    margin-left: 8px;
    opacity: 0.6;
    flex-shrink: 0;
}

.search-button {
    background: #4338ca;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    /* Mobile-friendly touch improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    /* Minimum touch target size */
    min-height: 44px;
}

.search-button:hover {
    background: #3730a3;
    transform: translateY(-1px);
}

.search-icon {
    width: 20px;
    height: 20px;
}

.divider {
    width: 1px;
    height: 40px;
    background: #e5e7eb;
    margin: 0 4px;
}

/* Inline Pickers for Mobile */
.inline-location-picker,
.inline-date-range-picker,
.inline-guest-picker {
    display: none;
    position: relative;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(-5px) scale(0.98);
    will-change: transform, opacity, max-height;
}

.inline-location-picker.active,
.inline-date-range-picker.active,
.inline-guest-picker.active {
    display: block;
    max-height: 500px;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.inline-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.inline-picker-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.close-button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1);
    will-change: transform, background-color;
}

.close-button svg {
    width: 18px;
    height: 18px;
    color: #666;
    transition: color 0.25s ease;
}

.close-button:hover {
    background-color: #e9ecef;
    transform: scale(1.05);
}

.close-button:active {
    transform: scale(0.95);
}

.inline-picker-content {
    max-height: 420px;
    overflow-y: auto;
    background: white;
    border-radius: 0 0 12px 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    position: relative;
    touch-action: pan-y;
}

.location-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-bottom: 1px solid #f8f9fa;
    min-height: 38px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transform: translateX(0);
    will-change: transform, background-color;
}

.location-option:hover,
.location-option:active {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.location-option:last-child {
    border-bottom: none;
}

.location-option.selected {
    background-color: #f0f9ff;
    color: #1d4ed8;
    transform: translateX(4px);
}

.location-option .check-icon {
    width: 14px;
    height: 14px;
    color: #22c55e;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.8);
}

.location-option.selected .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Inline location item styles (generated by JavaScript) */
.inline-location-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-bottom: 1px solid #f8f9fa;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transform: translateX(0);
    will-change: transform, background-color;
}

.inline-location-item:hover,
.inline-location-item:active {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.inline-location-item:last-child {
    border-bottom: none;
}

.inline-location-item.selected {
    background-color: #f0f9ff;
    color: #1d4ed8;
    transform: translateX(4px);
}

.inline-location-item .location-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.inline-location-item .check-icon {
    width: 14px;
    height: 14px;
    color: #22c55e;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.8);
}

.inline-location-item.selected .check-icon {
    opacity: 1;
    transform: scale(1);
}

.inline-location-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 4px 0;
}

/* ── Mobile date range picker header ────────────────────────────── */
.drp-header-mobile {
    flex: 1;
    border-bottom: none;
}

.drp-header-mobile .drp-tab {
    padding: 10px 12px;
}

.drp-header-mobile .drp-tab:first-child {
    border-right: 1px solid #e5e7eb;
}

.drp-header-mobile .drp-tab-label {
    font-size: 10px;
}

.drp-header-mobile .drp-tab-date {
    font-size: 13px;
}

/* Mobile months stacked */
.drp-months-mobile {
    flex-direction: column;
    padding: 12px 8px;
    gap: 8px;
}

.drp-months-mobile .drp-nav {
    position: absolute;
    top: 12px;
    z-index: 5;
}

.drp-months-mobile .drp-prev {
    left: 8px;
}

.drp-months-mobile .drp-next {
    right: 8px;
}

.drp-months-mobile .drp-month {
    padding: 0 4px;
}

.drp-months-mobile .drp-month-title {
    font-size: 14px;
    margin-bottom: 8px;
}

.drp-months-mobile .drp-grid {
    gap: 0;
}

.drp-months-mobile .drp-day-header {
    padding: 4px 0;
    font-size: 10px;
}

.drp-months-mobile .drp-cell {
    height: 32px;
    font-size: 12px;
}

.drp-months-mobile .drp-cell::after {
    top: 2px;
    bottom: 2px;
    left: 2px;
    right: 2px;
}

.drp-months-mobile .drp-cell::before {
    top: 2px;
    bottom: 2px;
}

/* Inline Guest Picker Specific Styles */
.inline-guest-picker .guest-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f8f9fa;
}

.inline-guest-picker .guest-counter:last-child {
    border-bottom: none;
}

.inline-guest-picker .guest-type {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.inline-guest-picker .guest-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 90px;
}

.inline-guest-picker .guest-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.inline-guest-picker .guest-btn:hover {
    border-color: #4338ca;
    color: #4338ca;
    background-color: #f0f9ff;
}

.inline-guest-picker .guest-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #e5e7eb;
    color: #9ca3af;
}

.inline-guest-picker .guest-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    font-size: 15px;
    color: #333;
}

/* Hide inline pickers on desktop */
@media (min-width: 769px) {
    .inline-location-picker,
    .inline-date-range-picker,
    .inline-guest-picker {
        display: none !important;
    }
}

/* Mobile-specific show rules */
@media (max-width: 768px) {
    /* Hide desktop dropdowns on mobile */
    #locationDropdown,
    #dateRangePanel,
    #guestDropdown {
        display: none !important;
    }

    /* Show inline pickers on mobile */
    .inline-location-picker,
    .inline-date-range-picker,
    .inline-guest-picker {
        display: block;
    }

    /* Prevent page scroll when inline pickers are active */
    body.mobile-picker-active {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* Fix scrolling issues specifically for inline pickers */
    .inline-location-picker.active,
    .inline-date-range-picker.active,
    .inline-guest-picker.active {
        position: relative;
        z-index: 1001;
        overscroll-behavior: none;
        -webkit-overflow-scrolling: touch;
    }

    /* Staggered animation for location options */
    .inline-location-picker.active .location-option {
        animation: slideInFromLeft 0.3s ease-out forwards;
        animation-delay: calc(var(--option-index, 0) * 0.05s);
        opacity: 0;
        transform: translateX(-20px);
    }

    .inline-location-picker.active .location-option:nth-child(1) { --option-index: 1; }
    .inline-location-picker.active .location-option:nth-child(2) { --option-index: 2; }
    .inline-location-picker.active .location-option:nth-child(3) { --option-index: 3; }
    .inline-location-picker.active .location-option:nth-child(4) { --option-index: 4; }
    .inline-location-picker.active .location-option:nth-child(5) { --option-index: 5; }
    .inline-location-picker.active .location-option:nth-child(6) { --option-index: 6; }
    .inline-location-picker.active .location-option:nth-child(7) { --option-index: 7; }
}

@keyframes slideInFromLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tablet styles */
@media (max-width: 1024px) {
    .search-container {
        width: 95%;
        padding: 8px;
        gap: 4px;
    }

    .search-field {
        padding: 14px 16px;
        font-size: 14px;
    }

    .search-button {
        padding: 14px 24px;
        font-size: 14px;
    }

    .date-range-panel {
        width: 580px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        padding: 6px;
        gap: 6px;
        width: 95%;
        margin-top: 12px;
        border-radius: 12px;
        min-height: auto;
        overflow: visible;
        max-width: calc(100vw - 30px);
        margin-bottom: 12px;
        position: relative;
        z-index: 2;
    }

    .search-field {
        width: 100%;
        justify-content: space-between;
        padding: 10px 14px;
        border-radius: 10px;
        background-color: #f8f9fa;
        border: 1px solid #e9ecef;
        min-height: 42px;
        position: relative;
        font-size: 14px;
    }

    .search-field:hover,
    .search-field:focus-within {
        background-color: #e9ecef;
        border-color: #dee2e6;
        transform: none;
    }

    .search-field:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .divider {
        display: none;
    }

    .search-button {
        width: 100%;
        justify-content: center;
        padding: 12px 28px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 10px;
        margin-top: 4px;
        min-height: 42px;
    }

    .dropdown {
        left: 20px;
        right: 20px;
        max-height: 60vh;
        margin-top: 12px;
        border-radius: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    .guest-counter {
        padding: 16px 20px;
        gap: 12px;
    }

    .guest-info {
        gap: 2px;
    }

    .guest-desc {
        font-size: 13px;
    }

    .guest-controls {
        gap: 20px;
        min-width: 130px;
    }

    .guest-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }

    .guest-count {
        font-size: 18px;
        min-width: 32px;
        font-weight: 600;
    }

    .guest-type {
        font-size: 16px;
        font-weight: 500;
    }

    /* Enhanced touch targets for mobile */
    .dropdown-item {
        padding: 20px;
        font-size: 16px;
        border-bottom: 1px solid #f0f0f0;
    }

    .dropdown-header {
        padding: 20px;
        font-size: 16px;
    }

    .field-label {
        font-size: 16px;
        font-weight: 600;
    }

    .field-value {
        font-size: 15px;
        color: #666;
    }
}

/* Simple Search Button Feedback */
@media (max-width: 768px) {
    .search-button:active {
        transform: scale(0.98);
        background: #3730a3;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .search-container {
        padding: 6px;
        width: 98%;
        gap: 6px;
        margin-top: 6px;
        margin-bottom: 6px;
    }

    .search-field {
        padding: 12px 14px;
        font-size: 14px;
        min-height: 44px;
    }

    .search-button {
        padding: 14px 20px;
        font-size: 15px;
        font-weight: 600;
        min-height: 44px;
        box-shadow: 0 3px 10px rgba(67, 56, 202, 0.25);
    }

    .search-button:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(67, 56, 202, 0.4);
    }

    .dropdown {
        left: 10px;
        right: 10px;
        max-height: 50vh;
        border-radius: 12px;
    }

    .guest-counter {
        padding: 16px 18px;
        gap: 14px;
    }

    .guest-controls {
        gap: 20px;
        min-width: 120px;
    }

    .guest-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border-radius: 10px;
    }

    .guest-count {
        font-size: 16px;
        min-width: 28px;
    }

    .guest-type {
        font-size: 15px;
    }

    .dropdown-item {
        padding: 18px;
        font-size: 15px;
    }

    .dropdown-header {
        padding: 18px;
        font-size: 15px;
    }

    .field-label {
        font-size: 15px;
    }

    .field-icon {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .field-dropdown {
        width: 10px;
        height: 10px;
        margin-left: 6px;
    }
}

/* Mobile viewport height fix */
:root {
    --vh: 1vh;
}

/* Enhanced mobile-specific utility classes */
.mobile-device .search-container {
    max-height: calc(var(--vh, 1vh) * 90);
}

.mobile-device .dropdown {
    max-height: calc(var(--vh, 1vh) * 50);
}

/* Compact mode for small screens */
@media (max-width: 375px) {
    .search-container {
        gap: 8px;
        padding: 6px;
    }

    .search-field {
        padding: 12px 14px;
        border-radius: 12px;
        min-height: 52px;
    }

    .search-field .field-content {
        min-width: 0;
        flex: 1;
    }

    .field-label {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-button {
        margin-top: 4px;
        padding: 14px 16px;
        font-size: 14px;
        min-height: 52px;
        border-radius: 12px;
    }

    .dropdown {
        left: 3px;
        right: 3px;
        margin-top: 8px;
        border-radius: 12px;
    }
}

/* Prevent horizontal scroll on very small screens */
@media (max-width: 320px) {
    .search-container {
        width: 100%;
        margin-left: 5px;
        margin-right: 5px;
        padding: 8px;
    }

    .search-field {
        padding: 14px 12px;
        font-size: 14px;
        min-height: 56px;
    }

    .field-dropdown {
        display: none;
    }

    .field-label {
        font-size: 14px;
        font-weight: 600;
    }

    .search-button {
        padding: 16px 20px;
        font-size: 15px;
        font-weight: 700;
        border-radius: 12px;
        width: 100%;
        min-height: 56px;
    }

    .dropdown {
        left: 5px;
        right: 5px;
        max-height: 40vh;
    }

    .field-icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }

    .dropdown-item {
        padding: 14px 12px;
        font-size: 14px;
        min-height: 48px;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 896px) and (orientation: landscape) and (max-height: 500px) {
    .search-container {
        margin-top: 10px;
        padding: 6px;
        gap: 6px;
    }

    .search-field {
        padding: 12px 16px;
    }

    .dropdown {
        max-height: 40vh;
    }

    .search-button {
        padding: 12px 24px;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes searchFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    50% {
        opacity: 0.8;
        transform: translateY(10px) scale(1.02);
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.search-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Enhanced accessibility and visual feedback for mobile */
.search-field:focus-within {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
}

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

.search-button:active {
    transform: scale(0.95);
}

.dropdown-item:active,
.guest-btn:active {
    transform: scale(0.95);
    background-color: #e0e7ff;
}

/* Enhanced loading states for mobile */
/* Skeleton loading placeholders for location dropdown */
.dropdown-item.skeleton-item {
    pointer-events: none;
    padding: 10px 15px;
}

.dropdown-item.skeleton-item .skeleton-text {
    display: block;
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-item .skeleton-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.mobile-location-item.skeleton-item {
    pointer-events: none;
}

.mobile-location-item.skeleton-item .skeleton-text {
    display: inline-block;
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.search-container.loading {
    pointer-events: none;
    opacity: 0.7;
}

.search-container.loading .search-button {
    background: #6b7280;
    cursor: not-allowed;
}

/* Mobile-specific loading overlay */
@media (max-width: 768px) {
    .search-button:disabled {
        background: linear-gradient(-45deg, #6b7280, #9ca3af, #6b7280, #9ca3af);
        background-size: 400% 400%;
        animation: shimmer 1.5s ease-in-out infinite;
    }
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Smooth animations for mobile interactions */
@media (prefers-reduced-motion: no-preference) {

    .search-field,
    .dropdown-item,
    .guest-btn,
    .search-button {
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .dropdown,
    .date-range-panel {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

    .search-field,
    .dropdown-item,
    .guest-btn,
    .search-button,
    .dropdown,
    .date-range-panel {
        transition: none;
    }

    .search-container {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Mobile interaction improvements */
@media (max-width: 480px) {
    .search-field {
        margin-bottom: 2px;
        border: 2px solid transparent;
        transition: border-color 0.2s ease;
    }

    .search-field:focus-within {
        border-color: #4338ca;
        background-color: #f0f9ff;
    }
}

/* Hide the hint on very small screens to save space */
@media (max-width: 360px) {
    .search-container::after {
        display: none;
    }

    .search-field {
        padding: 12px 16px;
        margin-bottom: 1px;
    }

    .field-label {
        font-size: 13px;
        font-weight: 600;
    }
}

/* iPhone SE and similar small screens optimization */
@media (max-width: 375px) and (max-height: 667px) {
    .search-container {
        margin-top: 10px;
        border-radius: 16px;
    }

    .search-field {
        min-height: 48px;
        padding: 10px 14px;
    }

    .search-button {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Mobile scrolling enhancements */
@media (max-width: 768px) {

    .dropdown {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        max-height: 50vh;
        transform: translateZ(0);
        will-change: scroll-position;
    }

    .dropdown-item {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Specific mobile enhancements for very small screens */
@media (max-width: 480px) {

    .dropdown {
        max-height: 60vh;
    }
}

/* Additional scrolling optimization for location dropdown with many items */
@media (max-width: 768px) {
    #locationDropdown {
        max-height: 40vh;
        min-height: 200px;
    }

    #locationDropdown .dropdown-item {
        will-change: transform;
        contain: layout;
    }
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE SEARCH PILL & FULL-SCREEN MODAL
   ══════════════════════════════════════════════════════════════════ */

/* -- Pill button (mobile only) ------------------------------------ */
.mobile-search-pill {
    display: none;
}

@media (max-width: 768px) {
    .mobile-search-pill {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #f2f2f2;
        border-radius: 50px;
        padding: 14px 14px 14px 24px;
        margin: 15px auto 12px;
        width: 90%;
        max-width: 400px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.10);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        animation: searchFadeIn 1.5s forwards;
        opacity: 0;
        transform: translateY(20px);
        position: relative;
        z-index: 2;
    }

    .mobile-search-pill:active {
        transform: scale(0.97);
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }

    .mobile-search-pill-text {
        font-size: 18px;
        font-weight: 600;
        color: #222;
        letter-spacing: -0.2px;
    }

    .mobile-search-pill-icon {
        width: 44px;
        height: 44px;
        background: #4338ca;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mobile-search-pill-icon svg {
        width: 20px;
        height: 20px;
        color: white;
    }

    /* Hide the desktop search container on mobile */
    .search-container {
        display: none !important;
    }
}

/* -- Full-screen modal -------------------------------------------- */
.mobile-search-modal {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 998;
    flex-direction: column;
    overflow: hidden;
    display: flex;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.25s ease;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-search-modal.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: white;
    position: relative;
    z-index: 2;
}

.mobile-search-modal-back {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-modal-back svg {
    width: 24px;
    height: 24px;
    color: #333;
}

.mobile-search-modal-back:active {
    background: #f3f4f6;
}

.mobile-search-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.2;
}

/* -- Steps ------------------------------------------------------- */
.mobile-search-step {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.mobile-search-step.active {
    display: flex;
    position: relative;
}

/* -- Step 1: Location -------------------------------------------- */
.mobile-search-input-wrap {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 8px;
}

.mobile-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #333;
    background: transparent;
    padding: 8px 0;
    font-family: inherit;
}

.mobile-search-input::placeholder {
    color: #9ca3af;
}

.mobile-search-input-clear {
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.mobile-search-input-clear.visible {
    opacity: 1;
}

.mobile-search-input-clear svg {
    width: 14px;
    height: 14px;
    color: #666;
}

.mobile-search-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0 20px;
}

.mobile-search-section-label {
    padding: 16px 20px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-location-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
}

.mobile-location-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s;
}

.mobile-location-item:active {
    background: #f3f4f6;
}

.mobile-location-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-location-item-icon svg {
    width: 22px;
    height: 22px;
    color: #4338ca;
}

.mobile-location-item-name {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
}

.mobile-location-item.selected .mobile-location-item-name {
    color: #4338ca;
    font-weight: 600;
}

/* -- Step 2: Dates ----------------------------------------------- */
.mobile-dates-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-dates-field {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-dates-field.active {
    border-color: #1f2937;
    color: #1f2937;
}

.mobile-dates-field.has-date {
    color: #1f2937;
    font-weight: 600;
}

.mobile-dates-arrow {
    flex-shrink: 0;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.mobile-dates-arrow svg {
    width: 16px;
    height: 16px;
}

.mobile-dates-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px 16px;
    border-bottom: 2px solid #1f2937;
    flex-shrink: 0;
}

.mobile-dates-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    padding: 4px 0;
}

.mobile-dates-calendar {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 80px;
}

.mobile-cal-month-label {
    padding: 20px 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.mobile-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.mobile-cal-cell {
    position: relative;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
}

.mobile-cal-cell.empty {
    cursor: default;
}

.mobile-cal-cell.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    pointer-events: none;
}

.mobile-cal-cell.today:not(.range-start):not(.range-end) {
    font-weight: 700;
    color: #1f2937;
}

/* Selected start/end circles */
.mobile-cal-cell::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.mobile-cal-cell::before {
    content: '';
    position: absolute;
    top: 4px; bottom: 4px; left: 0; right: 0;
    z-index: -2;
    pointer-events: none;
}

.mobile-cal-cell.range-start::after {
    background: #4338ca;
}
.mobile-cal-cell.range-start {
    color: white;
    font-weight: 700;
}
.mobile-cal-cell.range-start.has-end::before {
    left: 50%;
    background: #ede9fe;
}

.mobile-cal-cell.range-end::after {
    background: #4338ca;
}
.mobile-cal-cell.range-end {
    color: white;
    font-weight: 700;
}
.mobile-cal-cell.range-end::before {
    right: 50%;
    background: #ede9fe;
}

.mobile-cal-cell.in-range::before {
    background: #ede9fe;
}
.mobile-cal-cell.in-range {
    color: #4338ca;
}

/* Search button at bottom of dates/guests steps */
.mobile-dates-search-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: white;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    z-index: 5;
}

.mobile-search-action-btn {
    width: 100%;
    padding: 16px;
    background: #4338ca;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-action-btn:active {
    background: #3730a3;
    transform: scale(0.98);
}

.mobile-search-action-btn svg {
    width: 20px;
    height: 20px;
}

/* -- Step 3: Guests ---------------------------------------------- */
.mobile-guests-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-guests-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-guests-type {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.mobile-guests-desc {
    font-size: 13px;
    color: #9ca3af;
}

.mobile-guests-controls {
    display: flex;
    align-items: center;
    gap: 18px;
}

.mobile-guests-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #d1d5db;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
}

.mobile-guests-btn:active {
    border-color: #4338ca;
    color: #4338ca;
    transform: scale(0.92);
}

.mobile-guests-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mobile-guests-count {
    font-size: 18px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    color: #1f2937;
}
