/*
 * mobile-listings.css
 * Shared mobile enhancements for all category listing pages
 * Covers: bottom-sheet filter, iOS date fix, touch states, responsive hero
 */

/* ═══════════════════════════════════════════════
   1. MOBILE BOTTOM SHEET (filter sidebar)
   ═══════════════════════════════════════════════ */

/* Desktop: sidebar is normal flow */
#filter-sidebar {
    transition: visibility 0s linear 0.38s;
}

@media (max-width: 1023px) {
    /* Backdrop + sheet container */
    #filter-sidebar {
        position: fixed !important;
        inset: 0 !important;
        z-index: 200 !important;
        width: 100% !important;
        max-width: 100vw !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        pointer-events: none;
        visibility: hidden;
        background: rgba(0, 0, 0, 0);
        transition:
            background 0.32s ease,
            visibility 0s linear 0.38s;
    }

    #filter-sidebar.sheet-open {
        pointer-events: all;
        visibility: visible;
        background: rgba(0, 0, 0, 0.52);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        transition:
            background 0.32s ease,
            visibility 0s linear 0s;
    }

    /* The inner panel slides up */
    #filter-sidebar > .filter-sheet-panel {
        position: relative;
        z-index: 1;
        background: #ffffff;
        border-radius: 22px 22px 0 0;
        max-height: 88svh;
        max-height: 88vh; /* fallback */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transform: translateY(102%);
        transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: transform;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    }

    #filter-sidebar.sheet-open > .filter-sheet-panel {
        transform: translateY(0);
    }

    /* Override desktop sticky positioning */
    #filter-sidebar .filter-sticky-box {
        position: static !important;
        top: auto !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: transparent !important;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* Scrollable filter content area */
    #filter-sidebar .filter-scroll-body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-left: 1.25rem; /* iOS nice large sides */
        padding-right: 1.25rem;
    }

    /* General forms within filter body natively spread */
    #filter-sidebar .filter-scroll-body > div {
        border-bottom: 1px solid rgba(0,0,0,0.05); /* Soft dividers natively spaced */
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }
}

/* Drag handle */
.sheet-handle {
    display: none;
}
@media (max-width: 1023px) {
    .sheet-handle {
        display: flex;
        justify-content: center;
        padding: 12px 0 10px;
        flex-shrink: 0;
    }
    .sheet-handle::after {
        content: '';
        display: block;
        width: 44px; /* classic apple size */
        height: 5px;
        background: #e5e5ea;
        border-radius: 3px;
    }
}

/* Sheet header */
.filter-sheet-header {
    flex-shrink: 0;
}
@media (max-width: 1023px) {
    .filter-sheet-header {
        padding: 8px 24px 16px; /* Native feel margins */
        border-bottom: none;
        box-shadow: 0 1px 4px rgba(0,0,0,0.03); /* Soft line replaced with tiny native shadow */
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .filter-sheet-header h3 {
        font-size: 1.125rem !important; /* 18px */
        font-weight: 700 !important;
        margin: 0 !important;
        color: #1c1c1e;
    }
}

/* Sheet footer (mobile apply button) */
.filter-sheet-footer {
    display: none;
}
@media (max-width: 1023px) {
    .filter-sheet-footer {
        display: block;
        flex-shrink: 0;
        padding: 16px 24px;
        padding-bottom: max(24px, env(safe-area-inset-bottom)); /* Add healthy native safe area */
        border-top: none;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
        background: rgba(255,255,255,0.92);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    
    .filter-sheet-footer button {
        width: 100%;
        font-size: 1.0625rem !important; /* Authentic 17px iOS action font */
        font-weight: 600 !important;
        padding: 1rem !important; /* 48px target height minimum */
        border-radius: 0.875rem !important; /* 14px rounded button */
    }
}

/* Close button (mobile only) */
.sheet-close-btn {
    display: none;
}
@media (max-width: 1023px) {
    .sheet-close-btn {
        display: flex;
    }
}


/* ═══════════════════════════════════════════════
   2. SEARCH FORM — MOBILE & iOS FIXES
   ═══════════════════════════════════════════════ */

/* Prevent iOS Safari zoom on focus — must be >= 16px */
@media (max-width: 1023px) {
    .listing-search-card input,
    .listing-search-card select,
    .listing-search-card textarea,
    #filter-sidebar input,
    #filter-sidebar select,
    #filter-sidebar textarea {
        font-size: 16px !important;
    }
}

/* ── 2a. PHONE hero search (≤ 767px) ─────────────────────────── */
@media (max-width: 767px) {

    /* Card container */
    body.category-listing-page .listing-search-card {
        position: relative !important;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
        border-radius: 1.25rem !important;
        background: #ffffff !important;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
        box-sizing: border-box !important;
    }

    /* Grid — single column, tight gap */
    body.category-listing-page .listing-search-card .form-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.625rem !important;
        overflow: visible !important;
    }

    /* Field group card */
    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) {
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0.75rem 0.75rem 0.625rem !important;
        border-radius: 0.875rem !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        overflow: hidden !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.6) !important;
        box-sizing: border-box !important;
    }

    /* Labels */
    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) > label {
        display: block !important;
        margin-bottom: 0.375rem !important;
        padding: 0 !important;
        min-height: auto !important;
        font-size: 0.6875rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.06em !important;
        text-transform: uppercase !important;
        color: #64748b !important;
        line-height: 1.2 !important;
    }

    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) > label i {
        margin-right: 0.25rem !important;
        font-size: 0.7rem !important;
    }

    /* Input container (.relative wrapper) */
    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) .relative,
    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) .date-icon-wrap {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 2.875rem !important;
        border-radius: 0.625rem !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        overflow: hidden !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        box-sizing: border-box !important;
        transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    }

    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) .relative:focus-within,
    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) .date-icon-wrap:focus-within {
        border-color: rgba(var(--page-accent-rgb, 99, 102, 241), 0.5) !important;
        box-shadow: 0 0 0 3px rgba(var(--page-accent-rgb, 99, 102, 241), 0.1) !important;
    }

    /* Left icons */
    body.category-listing-page .listing-search-card .form-grid .relative > i.absolute:not(.fa-chevron-down),
    body.category-listing-page .listing-search-card .form-grid .date-icon-wrap > i.absolute:not(.fa-chevron-down) {
        position: absolute !important;
        left: 0.75rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 2 !important;
        font-size: 0.85rem !important;
        color: #94a3b8 !important;
        pointer-events: none !important;
    }

    /* Date abs icon: hide it, we use the wrapper pseudo */
    body.category-listing-page .listing-search-card .date-icon-wrap .date-abs-icon {
        display: none !important;
    }

    /* Chevron icons: hide original inline ones */
    body.category-listing-page .listing-search-card .form-grid .relative > i.fa-chevron-down {
        display: none !important;
    }

    /* ALL inputs + selects */
    body.category-listing-page .listing-search-card .form-grid input[type="text"],
    body.category-listing-page .listing-search-card .form-grid input[type="search"],
    body.category-listing-page .listing-search-card .form-grid input[type="date"],
    body.category-listing-page .listing-search-card .form-grid input[type="time"],
    body.category-listing-page .listing-search-card .form-grid input[type="datetime-local"],
    body.category-listing-page .listing-search-card .form-grid select {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        margin: 0 !important;
        padding: 0 2.25rem 0 2.5rem !important;
        border: 0 !important;
        border-radius: 0.625rem !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        color: #0f172a !important;
        font-size: 16px !important;
        line-height: 46px !important;
        box-sizing: border-box !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Placeholder */
    body.category-listing-page .listing-search-card .form-grid input::placeholder {
        color: #94a3b8 !important;
        opacity: 1 !important;
    }

    /* Select: right padding for chevron */
    body.category-listing-page .listing-search-card .form-grid select {
        padding-right: 2.5rem !important;
        cursor: pointer !important;
    }

    /* Select — chevron via parent pseudo-element */
    body.category-listing-page .listing-search-card .form-grid > div:not(.search-full-row) .relative:has(select)::after {
        content: '\f078' !important;
        position: absolute !important;
        right: 0.75rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-family: "Font Awesome 6 Free" !important;
        font-weight: 900 !important;
        font-size: 0.75rem !important;
        color: #94a3b8 !important;
        pointer-events: none !important;
        z-index: 2 !important;
    }

    /* Date inputs — specific padding + trailing calendar icon */
    body.category-listing-page .listing-search-card .form-grid .date-icon-wrap input[type="date"],
    body.category-listing-page .listing-search-card .form-grid .date-icon-wrap input[type="time"],
    body.category-listing-page .listing-search-card .form-grid .date-icon-wrap input[type="datetime-local"],
    body.category-listing-page .listing-search-card .form-grid .date-icon-wrap input.listing-mobile-date-input {
        padding-left: 0.75rem !important;
        padding-right: 2.5rem !important;
    }

    body.category-listing-page .listing-search-card .form-grid .date-icon-wrap::after {
        content: '\f073' !important;
        position: absolute !important;
        right: 0.75rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-family: "Font Awesome 6 Free" !important;
        font-weight: 900 !important;
        font-size: 0.8rem !important;
        color: #94a3b8 !important;
        pointer-events: none !important;
        z-index: 2 !important;
    }

    /* WebKit date pseudo-elements */
    body.category-listing-page .listing-search-card input[type="date"]::-webkit-calendar-picker-indicator {
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        width: 2.5rem !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
        cursor: pointer !important;
    }

    body.category-listing-page .listing-search-card input[type="date"]::-webkit-date-and-time-value {
        min-height: 1.2em !important;
        text-align: left !important;
    }

    body.category-listing-page .listing-search-card input[type="date"]::-webkit-datetime-edit,
    body.category-listing-page .listing-search-card input[type="datetime-local"]::-webkit-datetime-edit {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.category-listing-page .listing-search-card input[type="date"]::-webkit-datetime-edit-fields-wrapper,
    body.category-listing-page .listing-search-card input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }

    /* Search button */
    body.category-listing-page .listing-search-card .form-grid .search-full-row {
        display: flex !important;
        align-items: stretch !important;
    }

    body.category-listing-page .listing-search-card .form-grid .search-full-row button {
        width: 100% !important;
        min-height: 50px !important;
        height: 50px !important;
        border-radius: 0.875rem !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        box-shadow: 0 8px 20px rgba(var(--page-accent-rgb, 99, 102, 241), 0.25) !important;
    }

    /* Flatpickr mobile text inputs */
    body.category-listing-page .listing-search-card .form-grid input.listing-mobile-date-input::placeholder {
        color: #94a3b8 !important;
    }

    /* Hide Flatpickr alt inputs */
    body.category-listing-page .listing-search-card .flatpickr-mobile-input,
    body.category-listing-page .listing-search-card input.flatpickr-mobile-input {
        display: none !important;
    }

    /* Flatpickr calendar popup on mobile */
    .listing-mobile-flatpickr-calendar {
        z-index: 9999 !important;
        width: min(92vw, 340px) !important;
        max-width: 92vw !important;
        border-radius: 1.25rem !important;
        overflow: hidden !important;
        box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28) !important;
        border: 1px solid rgba(226, 232, 240, 0.9) !important;
    }
}

/* :has() fallback for select chevrons */
@supports not selector(:has(*)) {
    @media (max-width: 767px) {
        body.category-listing-page .listing-search-card .form-grid .relative > i.fa-chevron-down {
            display: block !important;
            position: absolute !important;
            left: auto !important;
            right: 0.75rem !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            color: #94a3b8 !important;
            pointer-events: none !important;
        }
    }
}

/* ── 2b. TABLET hero search (768px–1023px) ────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
    .date-icon-wrap .date-abs-icon {
        display: none !important;
    }
    .date-icon-wrap input[type="date"],
    .date-icon-wrap input[type="time"],
    .date-icon-wrap input[type="datetime-local"] {
        padding-left: 0.875rem !important;
    }

    .listing-search-card input[type="date"],
    .listing-search-card input[type="time"],
    .listing-search-card input[type="datetime-local"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 0.75rem 0.875rem !important;
        line-height: 1.25 !important;
        font-size: 16px !important;
        border: 1px solid #d1d5db !important;
        border-radius: 0.75rem !important;
        background-color: #fff !important;
        color: #1f2937 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .listing-search-card .relative > select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 48px !important;
        padding: 0.75rem 2rem 0.75rem 0.875rem !important;
        font-size: 16px !important;
    }

    .listing-search-card .form-grid input,
    .listing-search-card .form-grid select {
        min-height: 44px;
        border-radius: 0.75rem !important;
    }
    .listing-search-card .form-grid .search-full-row button {
        min-height: 48px;
    }
    .listing-search-card .form-grid select {
        padding-right: 2.25rem !important;
    }
    .listing-search-card .form-grid .relative > i.absolute {
        top: 50% !important;
        transform: translateY(-50%) !important;
        pointer-events: none;
    }
}

/* ── 2c. FILTER SIDEBAR date/select fixes (all mobile) ────────── */
@media (max-width: 1023px) {
    #filter-sidebar input[type="date"],
    #filter-sidebar input[type="time"],
    #filter-sidebar input[type="datetime-local"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 0.75rem 0.875rem !important;
        line-height: 1.25 !important;
        font-size: 16px !important;
        border: 1px solid #d1d5db !important;
        border-radius: 0.75rem !important;
        background-color: #fff !important;
        color: #1f2937 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #filter-sidebar input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
        line-height: 1.25;
    }

    #filter-sidebar input[type="date"]::-webkit-datetime-edit {
        padding: 0;
        max-width: 100%;
        overflow: hidden;
    }

    #filter-sidebar input[type="date"]::-webkit-calendar-picker-indicator {
        opacity: 0.6;
        width: 1rem;
        height: 1rem;
        margin: 0;
        padding: 0;
    }

    #filter-sidebar .flatpickr-mobile-input {
        display: none !important;
    }

    #filter-sidebar input[type="date"].flatpickr-input {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #filter-sidebar .relative > select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 48px !important;
        padding: 0.75rem 2rem 0.75rem 0.875rem !important;
        font-size: 16px !important;
    }
}


/* ═══════════════════════════════════════════════
   3. TOUCH & ACTIVE STATES FOR CARDS
   ═══════════════════════════════════════════════ */

.tour-card,
.listing-card,
.car-card,
.transfer-card,
.property-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Disable hover lift on pure touch devices (no mouse) */
@media (hover: none) and (pointer: coarse) {
    .tour-card:hover,
    .listing-card:hover,
    .car-card:hover,
    .transfer-card:hover,
    .property-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    .tour-card:active,
    .listing-card:active {
        transform: scale(0.985) !important;
        transition: transform 0.1s ease !important;
    }
}

/* Favorite button: always visible on touch devices */
@media (hover: none) and (pointer: coarse) {
    .listing-card .fav-btn {
        opacity: 1 !important;
    }
}


/* ═══════════════════════════════════════════════
   4. RESPONSIVE HERO SECTION
   ═══════════════════════════════════════════════ */

.listing-hero-title {
    font-size: 3rem;       /* 48px — text-5xl, same as original */
    line-height: 1.1;
}
@media (max-width: 1023px) {
    .listing-hero-title {
        font-size: 2.25rem; /* 36px — text-4xl */
    }
}
@media (max-width: 640px) {
    .listing-hero-title {
        font-size: 1.875rem; /* 30px — text-3xl */
    }
}

.listing-hero-subtitle {
    font-size: 1.25rem;
}
@media (max-width: 640px) {
    .listing-hero-subtitle {
        font-size: 1rem;
    }
}

/* Prevent select/input overflow in grid (long option text creates min-content overflow) */
.listing-search-card .form-grid > div {
    min-width: 0;
    overflow: hidden;
}
.listing-search-card .form-grid select,
.listing-search-card .form-grid input[type="text"],
.listing-search-card .form-grid input[type="date"],
.listing-search-card .form-grid input[type="time"],
.listing-search-card .form-grid input[type="datetime-local"] {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Search card: contain all children — desktop + tablet only.
   On phones the section 2a override handles containment. */
@media (min-width: 768px) {
    .listing-search-card {
        overflow: hidden;
    }
    .listing-search-card .form-grid {
        overflow: hidden;
    }
    .listing-search-card .form-grid .relative {
        overflow: hidden;
    }
}

/* Desktop: let Tailwind handle field heights naturally (py-* classes).
   Only force consistent border-radius and label spacing. */
@media (min-width: 1024px) {
    .listing-search-card .form-grid > div > label {
        margin-bottom: 0.375rem;
        font-size: 0.8125rem;
        font-weight: 600;
        color: #374151;
    }
    .listing-search-card .form-grid input,
    .listing-search-card .form-grid select {
        border-radius: 0.75rem !important;
    }
    .listing-search-card .form-grid .search-full-row button {
        border-radius: 0.75rem !important;
        font-weight: 600;
    }
}

@media (max-width: 640px) {
    .listing-hero-inner {
        padding-top: 1.5rem !important;
        padding-bottom: 1.75rem !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .listing-search-card .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .listing-search-card .form-grid .search-full-row {
        grid-column: 1 / -1;
    }
}


/* ═══════════════════════════════════════════════
   5. MOBILE FILTER TRIGGER BAR
   Now placed outside the padded container so it
   is naturally full-width (no hacks needed).
   ═══════════════════════════════════════════════ */

.mobile-bar {
    display: none;
}

@media (max-width: 1023px) {
    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        position: sticky;
        top: 80px; /* flush below h-20 fixed header */
        z-index: 40;
        width: 100%;
        padding: 10px 16px;
        background: #ffffff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
        box-sizing: border-box;
    }
}

/* Filter pill button */
.mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 18px !important;
    border-radius: 100px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
    transition: transform 0.1s ease, filter 0.15s ease;
}
.mobile-filter-btn:active {
    transform: scale(0.95);
    filter: brightness(0.88);
}

/* Active filter count badge inside button */
.filter-badge {
    display: none;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}
.filter-badge.has-filters {
    display: inline-block;
}

/* Sort dropdown — fills remaining space */
.mobile-sort-select {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 36px 0 14px !important;
    border: 1.5px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 100px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #111 !important;
    background-color: #f4f4f6 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    cursor: pointer;
}

/* Results count — no longer shown in bar */
.results-count-mobile {
    display: none !important;
}


/* ═══════════════════════════════════════════════
   6. MOBILE CARD GRID
   ═══════════════════════════════════════════════ */

@media (max-width: 1023px) {
    .listings-grid {
        gap: 1rem !important;
    }
}

/* Ensure cards fill the column and don't overflow */
.listing-card img,
.tour-card img {
    max-width: 100%;
}

/* Perfect mobile proportions for listing cards */
@media (max-width: 640px) {
    .listing-card, .tour-card, .car-card, .transfer-card, .property-card {
        border-radius: 1.25rem !important; /* Softer, native-like corners */
        box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important; /* Softer, wider native shadow */
        border: 1px solid rgba(0,0,0,0.04) !important;
        margin-bottom: 0.5rem; /* Better spacing between stacking cards */
        background: #ffffff !important;
    }
    
    /* Make the image section a perfect native ratio and rounded nicely */
    .listing-card > div:first-child[class*="aspect-"],
    .tour-card > div:first-child[class*="aspect-"] {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
    
    /* Tweak internal padding of cards for mobile to feel roomy but tight */
    .listing-card > div:not([class*="aspect-"]) > div[class*="p-"],
    .listing-card > div.p-4,
    .listing-card > div.p-5,
    .listing-card > div.p-6 {
        padding: 1.25rem !important;
    }
    
    /* Title sizing native feel */
    .listing-card h3, .tour-card h3 {
        font-size: 1.125rem !important; /* 18px */
        line-height: 1.4 !important;
        font-weight: 700 !important;
        margin-bottom: 0.25rem !important;
        letter-spacing: -0.01em !important;
    }
    
    /* Specification grid mobile optimization */
    .listing-card .grid-cols-4 {
        gap: 0.5rem !important;
    }
    .listing-card .grid-cols-4 > div {
        padding: 0.375rem 0.25rem !important;
        border-radius: 0.5rem !important;
    }
    .listing-card .grid-cols-4 i {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }
    .listing-card .grid-cols-4 span {
        font-size: 0.65rem !important;
    }

    /* Primary actionable buttons inside cards */
    .listing-card a[class*="bg-purple"],
    .tour-card a[class*="bg-emerald"],
    .listing-card btn,
    .listing-card button {
        padding-top: 0.875rem !important;
        padding-bottom: 0.875rem !important;
        border-radius: 0.875rem !important;
        font-weight: 600 !important;
        font-size: 0.9375rem !important;
    }
}


/* ═══════════════════════════════════════════════
   7. FILTER LABELS — bigger tap targets
   ═══════════════════════════════════════════════ */

@media (max-width: 1023px) {
    #filter-sidebar label {
        padding: 0.625rem 0.25rem !important;
        margin-bottom: 0 !important;
        min-height: 2.75rem !important; /* Authentic 44px tap target */
        display: flex;
        align-items: center;
        width: 100%;
        font-size: 1rem !important;
        color: #1c1c1e !important; /* iOS black */
        font-weight: 500 !important;
    }
    
    #filter-sidebar .space-y-4 > div {
        margin-top: 0 !important; /* Use padding from .filter-scroll-body > div instead */
    }

    #filter-sidebar input[type="checkbox"],
    #filter-sidebar input[type="radio"] {
        width: 1.375rem !important; /* 22px checkbox */
        height: 1.375rem !important;
        flex-shrink: 0;
        margin-right: 0.875rem !important;
        border-radius: 0.375rem !important; /* Softer rounded boxes */
        border: 1.5px solid #c7c7cc !important; /* iOS unselected border color */
        -webkit-appearance: none;
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: transparent !important; /* Force transparent strictly */
        transition: all 0.2s ease-in-out;
    }
    
    #filter-sidebar input[type="checkbox"]:checked {
        background-color: #8b5cf6 !important; /* Purple active */
        border-color: #8b5cf6 !important;
    }
    
    #filter-sidebar input[type="checkbox"]:checked::after {
        content: '';
        width: 0.35rem; /* ~6px */
        height: 0.65rem; /* ~10px */
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
        margin-bottom: 2px;
    }

    #filter-sidebar input[type="radio"]:checked {
        border-width: 0.4rem !important; /* 6px stroke inside a dot feeling */
        border-color: #8b5cf6 !important;
    }

    #filter-sidebar select,
    #filter-sidebar input[type="number"] {
        font-size: 1rem !important; /* Prevent zoom */
        padding: 1rem 1rem !important; /* Bigger tap */
        border-radius: 0.875rem !important; /* 14px container */
        border: 1px solid #e5e5ea !important;
        background-color: #f2f2f7 !important; /* iOS gray background for fields */
        color: #1c1c1e !important;
        min-height: 3rem !important; /* 48px height */
        width: 100% !important;
        margin-top: 0.5rem;
    }

    /* iOS native toggle switches logic if you use checkbox toggles somewhere */
}


/* ═══════════════════════════════════════════════
   8. SAFE AREA & SMOOTH SCROLL
   ═══════════════════════════════════════════════ */

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Prevent body scroll when sheet is open */
body.sheet-active {
    overflow: hidden;
    touch-action: none;
}
