﻿.custom-price-marker div {
    white-space: nowrap;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36), 0 0 22px rgba(0, 242, 195, 0.2);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.custom-price-marker div:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #16c97d;
}

/* Leaflet Popup Premium Refresh */
.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: rgba(6, 16, 24, 0.96) !important;
    color: #f4fffb !important;
    border: 1px solid rgba(0, 242, 195, 0.18);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.36) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 220px !important;
}

.leaflet-popup-tip-container {
    display: none !important;
}

.leaflet-container a.leaflet-popup-close-button {
    top: 8px !important;
    right: 8px !important;
    color: white !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 14px !important;
}

body.search-theme {
    --featured-stay-gradient:
        radial-gradient(circle at 12% 0%, rgba(0, 242, 195, 0.14), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(245, 183, 67, 0.1), transparent 28%),
        linear-gradient(180deg, #061018 0%, #071b24 56%, #051017 100%);
    --search-glass:
        linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
    min-height: 100vh;
    background: var(--featured-stay-gradient);
    color: #f4fffb;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body.search-theme #main-nav {
    position: sticky;
    top: 0;
    background: rgba(3, 9, 13, 0.88) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

body.search-theme .search-page-shell {
    position: relative;
    overflow: visible;
    border: 1px solid rgba(0, 242, 195, 0.12);
    border-radius: 0;
    background: var(--featured-stay-gradient);
    box-shadow: 0 32px 86px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    isolation: isolate;
}

body.search-theme .search-page-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 8%, rgba(0, 242, 195, 0.08), transparent 34%),
        radial-gradient(circle at 80% 22%, rgba(245, 183, 67, 0.07), transparent 28%);
    pointer-events: none;
}

body.search-theme .search-glass,
body.search-theme #leaflet-map-container,
body.search-theme .property-card,
body.search-theme #nav-location-dropdown,
body.search-theme #nav-date-dropdown,
body.search-theme #nav-guest-dropdown {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background:
        var(--search-glass),
        var(--featured-stay-gradient) !important;
    color: #f4fffb !important;
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.28) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body.search-theme #nav-search-container > div {
    background:
        var(--search-glass),
        var(--featured-stay-gradient) !important;
    border-color: rgba(0, 242, 195, 0.16) !important;
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body.search-theme #nav-location-container,
body.search-theme #nav-date-container,
body.search-theme #nav-guest-container {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body.search-theme #nav-location-container:hover,
body.search-theme #nav-date-container:hover,
body.search-theme #nav-guest-container:hover,
body.search-theme label:hover {
    background: rgba(0, 242, 195, 0.08) !important;
}

body.search-theme .bg-white,
body.search-theme .bg-gray-50,
body.search-theme .bg-gray-100,
body.search-theme .bg-gray-200 {
    background: rgba(255, 255, 255, 0.075) !important;
    color: #f4fffb !important;
}

body.search-theme .border-gray-100,
body.search-theme .border-gray-200,
body.search-theme .border-gray-300 {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body.search-theme .text-gray-900,
body.search-theme .text-gray-800,
body.search-theme .text-gray-700,
body.search-theme .text-black {
    color: #f4fffb !important;
}

body.search-theme .text-gray-600,
body.search-theme .text-gray-500,
body.search-theme .text-gray-400 {
    color: rgba(244, 255, 251, 0.68) !important;
}

body.search-theme input,
body.search-theme select {
    color: #f4fffb !important;
}

body.search-theme input::placeholder {
    color: rgba(244, 255, 251, 0.5) !important;
}

body.search-theme input[type="checkbox"] {
    accent-color: #00f2c3;
}

body.search-theme .text-blue-600,
body.search-theme .hover\:text-blue-600:hover {
    color: #00f2c3 !important;
}

body.search-theme .bg-blue-600,
body.search-theme #nav-search-trigger {
    background: linear-gradient(135deg, #008eff 0%, #16c97d 100%) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 16px 34px rgba(0, 169, 141, 0.24) !important;
}

body.search-theme .hover\:bg-blue-700:hover,
body.search-theme .hover\:bg-gray-50:hover,
body.search-theme .hover\:bg-gray-100:hover,
body.search-theme .hover\:bg-blue-50:hover {
    background: rgba(0, 242, 195, 0.12) !important;
}

body.search-theme #sort-select {
    background:
        var(--search-glass),
        var(--featured-stay-gradient) !important;
    border-color: rgba(0, 242, 195, 0.18) !important;
}

body.search-theme #sort-select option {
    background: #061018;
    color: #f4fffb;
}

body.search-theme #map {
    background: #061018 !important;
}

body.search-theme .search-results-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    gap: 1.5rem;
    align-items: start;
}

body.search-theme .search-map-panel {
    position: sticky;
    top: 112px;
    min-height: 640px;
    overflow: hidden;
}

body.search-theme #leaflet-map-container {
    height: 640px;
    min-height: 520px;
}

body.search-theme .property-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px !important;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.035)),
        rgba(13, 14, 20, 0.78) !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
    box-shadow: 0 26px 58px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body.search-theme .property-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(0, 242, 195, 0.12), transparent 34%),
        radial-gradient(circle at 88% 20%, rgba(245, 183, 67, 0.1), transparent 28%);
    opacity: 0.75;
    pointer-events: none;
}

body.search-theme .property-card > * {
    position: relative;
    z-index: 1;
}

body.search-theme .property-card img {
    transition: transform 0.45s ease;
}

body.search-theme .property-card:hover img {
    transform: scale(1.045);
}

body.search-theme .search-primary-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

body.search-theme .additional-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 1180px) {
    body.search-theme .search-results-layout {
        grid-template-columns: 1fr;
    }

    body.search-theme .search-primary-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.search-theme .search-map-panel {
        position: relative;
        top: auto;
        min-height: auto;
        order: -1;
    }

    body.search-theme #leaflet-map-container {
        height: 460px;
        min-height: 420px;
    }
}

@media (max-width: 768px) {
    body.search-theme .search-primary-list,
    body.search-theme .additional-results-grid {
        grid-template-columns: 1fr;
    }

    body.search-theme #leaflet-map-container {
        height: 380px;
        min-height: 360px;
    }
}

body.search-theme .leaflet-container {
    background: #061018 !important;
    font-family: 'Outfit', sans-serif !important;
}

body.search-theme .leaflet-tile-pane {
    filter: none;
}

body.search-theme .livasta-dark-map-base {
    filter: brightness(0.98) contrast(1.06) saturate(0.82);
}

body.search-theme .livasta-map-labels {
    filter: brightness(1.85) contrast(1.38) saturate(0.62) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9));
    opacity: 1;
    mix-blend-mode: screen;
}

body.search-theme .leaflet-marker-pane,
body.search-theme .leaflet-popup-pane,
body.search-theme .leaflet-control-container {
    filter: none;
}

body.search-theme footer {
    background: #061018 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.62) !important;
}

body.search-theme footer a {
    color: rgba(255, 255, 255, 0.72) !important;
}

@media (max-width: 768px) {
    body.search-theme .search-page-shell {
        border-radius: 24px;
    }

    body.search-theme #nav-location-dropdown,
    body.search-theme #nav-date-dropdown,
    body.search-theme #nav-guest-dropdown {
        max-width: calc(100vw - 2rem);
    }
}

/* Match the Home Page search calendar on /search */
body.search-theme #nav-date-dropdown {
    background: rgba(7, 22, 29, 0.98) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 22px !important;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45) !important;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

body.search-theme #nav-date-dropdown #view-calendar {
    background: rgba(255, 255, 255, 0.025) !important;
    color: #ffffff !important;
}

body.search-theme #nav-date-dropdown > .border-t {
    background: rgba(255, 255, 255, 0.045) !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 0 22px 22px;
}

body.search-theme #nav-date-dropdown .flatpickr-calendar {
    background: transparent !important;
    color: #ffffff !important;
}

body.search-theme #nav-date-dropdown .flatpickr-current-month,
body.search-theme #nav-date-dropdown .flatpickr-weekday,
body.search-theme #nav-date-dropdown .flatpickr-day {
    color: #ffffff !important;
}

body.search-theme #nav-date-dropdown .flatpickr-prev-month svg,
body.search-theme #nav-date-dropdown .flatpickr-next-month svg {
    fill: #ffffff !important;
}

body.search-theme #nav-date-dropdown .flatpickr-day.prevMonthDay,
body.search-theme #nav-date-dropdown .flatpickr-day.nextMonthDay {
    color: rgba(255, 255, 255, 0.3) !important;
}

body.search-theme #nav-date-dropdown .flatpickr-day:hover {
    background: rgba(0, 242, 195, 0.12) !important;
    border-color: rgba(0, 242, 195, 0.24) !important;
}

body.search-theme #nav-date-dropdown .flatpickr-day.inRange,
body.search-theme #nav-date-dropdown .flatpickr-day.prevMonthDay.inRange,
body.search-theme #nav-date-dropdown .flatpickr-day.nextMonthDay.inRange {
    background: rgba(0, 242, 195, 0.16) !important;
    border-color: rgba(0, 242, 195, 0.04) !important;
    box-shadow: -5px 0 0 rgba(0, 242, 195, 0.16), 5px 0 0 rgba(0, 242, 195, 0.16) !important;
    color: rgba(255, 255, 255, 0.94) !important;
}

body.search-theme #nav-date-dropdown .flatpickr-day.selected,
body.search-theme #nav-date-dropdown .flatpickr-day.startRange,
body.search-theme #nav-date-dropdown .flatpickr-day.endRange,
body.search-theme #nav-date-dropdown .flatpickr-day.selected.inRange,
body.search-theme #nav-date-dropdown .flatpickr-day.today.selected {
    background: rgba(0, 242, 195, 0.32) !important;
    border-color: rgba(0, 242, 195, 0.72) !important;
    box-shadow: 0 0 0 1px rgba(0, 242, 195, 0.36), 0 8px 18px rgba(0, 0, 0, 0.2) !important;
    color: #ffffff !important;
}

body.search-theme #nav-date-dropdown .flatpickr-day.startRange {
    border-radius: 999px 0 0 999px !important;
}

body.search-theme #nav-date-dropdown .flatpickr-day.endRange {
    border-radius: 0 999px 999px 0 !important;
}

body.search-theme #nav-date-dropdown .flatpickr-day.startRange.endRange,
body.search-theme #nav-date-dropdown .flatpickr-day.selected:not(.startRange):not(.endRange) {
    border-radius: 999px !important;
}

body.search-theme #nav-apply-dates {
    color: #ffffff !important;
    background: #007a7a !important;
    border: 0 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(0, 242, 195, 0.12) !important;
}

body.search-theme #nav-apply-dates:hover {
    background: #006666 !important;
}

/* Mobile /search responsive filter drawer */
.search-filter-mobile-header,
.search-filter-backdrop,
.search-filter-open {
    display: none;
}

@media (max-width: 767px) {
    body.search-filter-open-state {
        overflow: hidden;
        touch-action: none;
    }

    body.search-theme .search-page-shell {
        width: 100%;
        margin: 0;
        padding: 0.85rem !important;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    body.search-theme .search-page-shell > .grid {
        display: block;
    }

    body.search-theme .search-filter-drawer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10030;
        display: block;
        width: 100%;
        max-height: min(86vh, 720px);
        overflow-y: auto;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)) !important;
        border-radius: 28px 28px 0 0 !important;
        border: 1px solid rgba(0, 242, 195, 0.16) !important;
        border-bottom: 0 !important;
        background:
            radial-gradient(circle at 16% 0%, rgba(0, 242, 195, 0.18), transparent 34%),
            radial-gradient(circle at 92% 12%, rgba(124, 58, 237, 0.16), transparent 34%),
            linear-gradient(145deg, rgba(3, 16, 21, 0.98), rgba(7, 22, 29, 0.97) 54%, rgba(11, 19, 37, 0.98)) !important;
        box-shadow: 0 -28px 70px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
        -webkit-backdrop-filter: blur(24px);
        backdrop-filter: blur(24px);
        transform: translateY(110%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease, visibility 220ms ease;
        -webkit-overflow-scrolling: touch;
    }

    body.search-filter-open-state .search-filter-drawer {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.search-theme .search-filter-mobile-header {
        position: sticky;
        top: -1rem;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin: -1rem -1rem 1rem;
        padding: 1rem;
        background: rgba(3, 16, 21, 0.86);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }

    body.search-theme .search-filter-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 999px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
    }

    body.search-theme .search-filter-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10020;
        display: block;
        background: rgba(0, 0, 0, 0.58);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 220ms ease, visibility 220ms ease;
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    body.search-filter-open-state .search-filter-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.search-theme .search-filter-drawer nav[aria-label="Breadcrumb"] {
        display: none;
    }

    body.search-theme .search-filter-drawer h3 {
        color: #ffffff !important;
        font-size: 0.98rem;
    }

    body.search-theme .search-filter-drawer label {
        min-height: 44px;
        padding: 0.55rem 0.65rem;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.045);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: rgba(244, 255, 251, 0.84) !important;
    }

    body.search-theme .search-filter-drawer input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
        flex: 0 0 auto;
    }

    body.search-theme .search-summary-card {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
        margin-bottom: 1rem !important;
        padding: 1rem !important;
        border-radius: 24px !important;
    }

    body.search-theme .search-summary-card h1 {
        font-size: clamp(1.18rem, 5vw, 1.45rem) !important;
        line-height: 1.18;
    }

    body.search-theme .search-summary-actions {
        display: grid;
        grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
        gap: 0.7rem;
        width: 100%;
    }

    body.search-theme .search-filter-open {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 44px;
        border-radius: 999px;
        border: 1px solid rgba(0, 242, 195, 0.22);
        background: linear-gradient(135deg, rgba(0, 142, 255, 0.82), rgba(21, 174, 176, 0.92)) !important;
        color: #ffffff !important;
        font-size: 0.86rem;
        font-weight: 900;
        box-shadow: 0 14px 28px rgba(0, 142, 255, 0.2);
    }

    body.search-theme #sort-select {
        width: 100%;
        min-height: 44px;
        padding-inline: 0.85rem !important;
        font-size: 0.82rem !important;
    }

    body.search-theme .search-results-layout {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    body.search-theme .search-map-panel {
        order: -1;
        position: relative;
        top: auto;
        min-height: auto;
        padding: 0.55rem !important;
        border-radius: 24px !important;
    }

    body.search-theme #leaflet-map-container {
        height: min(52vh, 330px) !important;
        min-height: 260px !important;
        border-radius: 20px !important;
    }

    body.search-theme .search-primary-list,
    body.search-theme .additional-results-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    body.search-theme .property-card {
        border-radius: 22px !important;
        padding: 0.85rem !important;
        gap: 0.85rem !important;
        touch-action: manipulation;
    }

    body.search-theme .property-card img {
        min-height: 190px;
        border-radius: 18px !important;
    }

    body.search-theme #additional-results-section {
        margin-top: 1.25rem !important;
    }

    body.search-theme #no-results-message {
        padding: 3rem 1rem !important;
    }

    body.search-theme .mt-12.flex.justify-center {
        margin-top: 1.5rem !important;
        gap: 0.45rem !important;
        flex-wrap: wrap;
    }

    body.search-theme footer {
        margin-top: 2rem !important;
    }
}

/* /search mobile stability fixes: navbar, drawer content, map, cards */
@media (max-width: 767px) {
    body.search-theme #main-nav {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    body.search-theme #main-nav > div {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    body.search-theme #main-nav .h-20 {
        height: 68px !important;
        min-height: 68px;
        gap: 0.75rem !important;
        justify-content: space-between;
    }

    body.search-theme #main-nav .logo-img {
        height: clamp(38px, 11vw, 50px) !important;
        max-width: 150px !important;
        object-fit: contain;
    }

    body.search-theme #main-nav .nav-lang-btn {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    body.search-theme #main-nav #mobile-menu-trigger {
        min-width: 74px;
        height: 42px;
        flex: 0 0 auto;
    }

    body.search-theme #user-menu-dropdown {
        position: fixed !important;
        top: 76px !important;
        right: 0.75rem !important;
        width: min(320px, calc(100vw - 1.5rem)) !important;
        max-height: calc(100vh - 92px);
        overflow-y: auto;
    }

    body.search-theme .search-filter-drawer[aria-hidden="true"] {
        visibility: hidden;
    }

    body.search-theme.search-filter-open-state .search-filter-drawer,
    body.search-filter-open-state .search-filter-drawer {
        display: block !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    body.search-filter-open-state .search-filter-drawer > * {
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.search-theme .search-filter-drawer > div:not(.search-filter-mobile-header) {
        display: block;
    }

    body.search-theme .search-filter-drawer .space-y-2,
    body.search-theme .search-filter-drawer .space-y-6 {
        width: 100%;
    }

    body.search-theme .search-filter-drawer button:not(.search-filter-close) {
        min-height: 40px;
        padding: 0.35rem 0.2rem;
        color: #00f2c3 !important;
    }

    body.search-theme .search-filter-drawer span {
        overflow-wrap: anywhere;
        line-height: 1.25;
    }

    body.search-theme .search-summary-card > div:first-child {
        min-width: 0;
        width: 100%;
    }

    body.search-theme .search-summary-card h1 span,
    body.search-theme .search-summary-card h1 {
        overflow-wrap: anywhere;
    }

    body.search-theme .search-summary-card .inline-block {
        display: inline-flex !important;
        align-items: center;
        max-width: 100%;
        white-space: normal;
        line-height: 1.25;
    }

    body.search-theme .search-map-panel {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    body.search-theme #leaflet-map-container,
    body.search-theme #map {
        display: block !important;
        width: 100% !important;
    }

    body.search-theme #map {
        height: 100% !important;
        min-height: inherit !important;
    }

    body.search-theme .leaflet-container {
        min-height: inherit !important;
    }

    body.search-theme .property-card {
        width: 100%;
        min-width: 0;
    }

    body.search-theme .property-card img {
        width: 100% !important;
        height: clamp(180px, 52vw, 230px) !important;
        max-height: 240px;
        object-fit: cover;
        flex: none !important;
    }

    body.search-theme .property-card h2,
    body.search-theme .property-card h3,
    body.search-theme .property-card p,
    body.search-theme .property-card span,
    body.search-theme .property-card div {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 380px) {
    body.search-theme .search-summary-actions {
        grid-template-columns: 1fr;
    }

    body.search-theme #sort-select,
    body.search-theme .search-filter-open {
        width: 100%;
    }

    body.search-theme #leaflet-map-container {
        height: 285px !important;
        min-height: 260px !important;
    }
}

/* /search mobile final usability polish */
@media (max-width: 767px) {
    body.search-theme .search-filter-drawer {
        min-height: 46vh;
        color: #f4fffb !important;
        overscroll-behavior: contain;
    }

    body.search-filter-open-state .search-filter-drawer {
        display: flex !important;
        flex-direction: column;
    }

    body.search-filter-open-state .search-filter-drawer > div:not(.search-filter-mobile-header),
    body.search-filter-open-state .search-filter-drawer nav,
    body.search-filter-open-state .search-filter-drawer h3,
    body.search-filter-open-state .search-filter-drawer label,
    body.search-filter-open-state .search-filter-drawer button:not(.search-filter-close) {
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.search-theme .search-filter-drawer > div:not(.search-filter-mobile-header) {
        flex: 0 0 auto;
        margin-bottom: 1.15rem;
    }

    body.search-theme .search-filter-drawer label span {
        display: block;
        min-width: 0;
        white-space: normal;
    }

    body.search-theme .search-filter-drawer .hidden label {
        margin-top: 0.5rem;
    }

    body.search-theme .search-primary-list,
    body.search-theme .additional-results-grid {
        justify-items: center;
        align-items: start;
    }

    body.search-theme .property-card {
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
        align-self: center;
    }

    body.search-theme .property-card > .relative:first-child {
        width: 100% !important;
        border-radius: 18px !important;
    }

    body.search-theme .property-card h3.truncate,
    body.search-theme .property-card .truncate {
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
    }

    body.search-theme .property-card .flex.items-start.justify-between,
    body.search-theme .property-card .flex.items-center.justify-between {
        flex-wrap: wrap;
    }

    body.search-theme .property-card .shrink-0 {
        flex-shrink: 1 !important;
    }
}

/* /search mobile filter drawer hard-open fallback */
@media (max-width: 767px) {
    body.search-theme .search-filter-drawer.is-open,
    body.search-theme.search-filter-open-state .search-filter-drawer.is-open,
    body.search-filter-open-state .search-filter-drawer.is-open {
        display: flex !important;
        flex-direction: column !important;
        transform: translate3d(0, 0, 0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        height: auto !important;
        min-height: 52vh !important;
        max-height: min(88vh, 760px) !important;
        overflow-y: auto !important;
    }

    body.search-theme .search-filter-drawer.is-open .search-filter-mobile-header {
        display: flex !important;
    }

    body.search-theme .search-filter-drawer.is-open > div,
    body.search-theme .search-filter-drawer.is-open h3,
    body.search-theme .search-filter-drawer.is-open label,
    body.search-theme .search-filter-drawer.is-open span,
    body.search-theme .search-filter-drawer.is-open button:not(.search-filter-close) {
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.search-theme .search-filter-drawer.is-open > div:not(.search-filter-mobile-header) {
        display: block !important;
    }

    body.search-theme .search-primary-list,
    body.search-theme .additional-results-grid {
        justify-content: center;
    }

    body.search-theme .search-primary-list > .property-card,
    body.search-theme .additional-results-grid > .property-card {
        justify-self: center !important;
        width: min(100%, 460px) !important;
    }
}

/* /search mobile drawer real content wrapper */
.search-filter-content {
    display: contents;
}

@media (max-width: 767px) {
    body.search-theme .search-filter-drawer .search-filter-content {
        display: block !important;
        width: 100%;
        min-height: 1px;
    }

    body.search-theme .search-filter-drawer.is-open .search-filter-content,
    body.search-filter-open-state .search-filter-drawer .search-filter-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.search-theme .search-filter-drawer .search-filter-content > div {
        display: block !important;
        margin-bottom: 1.15rem;
    }

    body.search-theme .search-filter-drawer .search-filter-content > div:last-child {
        margin-bottom: 0;
    }

    body.search-theme .search-filter-drawer .search-filter-content nav[aria-label="Breadcrumb"] {
        display: none !important;
    }
}

/* /search definitive mobile filter drawer rendering fix */
@media (max-width: 767px) {
    body.search-theme .search-filter-backdrop.is-open,
    body.search-filter-open-state .search-filter-backdrop {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 2147483000 !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        background: rgba(0, 0, 0, 0.62) !important;
        -webkit-backdrop-filter: blur(6px) !important;
        backdrop-filter: blur(6px) !important;
    }

    body.search-theme .search-filter-drawer {
        z-index: 2147483001 !important;
    }

    body.search-theme .search-filter-drawer.is-open,
    body.search-filter-open-state .search-filter-drawer.is-open {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        height: auto !important;
        min-height: 58vh !important;
        max-height: 88vh !important;
        padding: 0 1rem calc(1rem + env(safe-area-inset-bottom)) !important;
        margin: 0 !important;
        overflow-y: auto !important;
        transform: translate3d(0, 0, 0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        filter: none !important;
        background:
            radial-gradient(circle at 14% 0%, rgba(0, 242, 195, 0.16), transparent 34%),
            radial-gradient(circle at 94% 10%, rgba(124, 58, 237, 0.14), transparent 34%),
            linear-gradient(145deg, #031015 0%, #07161d 52%, #0b1325 100%) !important;
        color: #f4fffb !important;
        border-radius: 28px 28px 0 0 !important;
        border: 1px solid rgba(0, 242, 195, 0.2) !important;
        border-bottom: 0 !important;
        box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.64), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    }

    body.search-theme .search-filter-drawer.is-open .search-filter-mobile-header {
        display: flex !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 3 !important;
        margin: 0 -1rem 1rem !important;
        padding: 1rem !important;
        background: rgba(3, 16, 21, 0.98) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
        filter: none !important;
    }

    body.search-theme .search-filter-drawer.is-open .search-filter-content {
        display: block !important;
        position: relative !important;
        z-index: 2 !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #f4fffb !important;
        filter: none !important;
    }

    body.search-theme .search-filter-drawer.is-open .search-filter-content > div {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-bottom: 1.25rem !important;
        padding: 0 !important;
        filter: none !important;
    }

    body.search-theme .search-filter-drawer.is-open h3,
    body.search-theme .search-filter-drawer.is-open label,
    body.search-theme .search-filter-drawer.is-open span,
    body.search-theme .search-filter-drawer.is-open button:not(.search-filter-close) {
        visibility: visible !important;
        opacity: 1 !important;
        filter: none !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body.search-theme .search-filter-drawer.is-open h3 {
        color: #ffffff !important;
    }

    body.search-theme .search-filter-drawer.is-open label {
        display: flex !important;
        color: rgba(244, 255, 251, 0.9) !important;
    }

    body.search-theme .search-filter-drawer.is-open input[type="checkbox"] {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.search-theme .search-filter-drawer.is-open .search-filter-close {
        display: inline-flex !important;
        color: #ffffff !important;
    }
}

/* /search corrected split filter architecture */
.search-filter-drawer {
    display: none;
}

.search-filter-mobile-footer {
    display: none;
}

@media (min-width: 768px) {
    body.search-theme .search-filter-source {
        display: block !important;
    }
}

@media (max-width: 767px) {
    body.search-theme .search-filter-source {
        display: none !important;
    }

    body.search-theme .search-filter-drawer {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        z-index: 2147483001 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        min-height: 58vh !important;
        max-height: 88vh !important;
        margin: 0 !important;
        padding: 0 1rem calc(78px + env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        transform: translate3d(0, 110%, 0) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        background:
            radial-gradient(circle at 14% 0%, rgba(0, 242, 195, 0.16), transparent 34%),
            radial-gradient(circle at 94% 10%, rgba(124, 58, 237, 0.14), transparent 34%),
            linear-gradient(145deg, #031015 0%, #07161d 52%, #0b1325 100%) !important;
        color: #f4fffb !important;
        border-radius: 28px 28px 0 0 !important;
        border: 1px solid rgba(0, 242, 195, 0.2) !important;
        border-bottom: 0 !important;
        box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.64), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
        transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease, visibility 220ms ease !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    body.search-theme .search-filter-drawer.is-open,
    body.search-filter-open-state .search-filter-drawer.is-open {
        transform: translate3d(0, 0, 0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    body.search-theme .search-filter-content {
        display: block !important;
        width: 100% !important;
        padding-bottom: 1rem;
        color: #f4fffb !important;
    }

    body.search-theme .search-filter-content > div,
    body.search-theme .search-filter-content nav {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-bottom: 1.2rem !important;
    }

    body.search-theme .search-filter-content nav[aria-label="Breadcrumb"] {
        display: none !important;
    }

    body.search-theme .search-filter-drawer h3 {
        color: #ffffff !important;
        font-size: 0.98rem !important;
    }

    body.search-theme .search-filter-drawer label {
        display: flex !important;
        align-items: center;
        min-height: 44px;
        padding: 0.55rem 0.65rem;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.045);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: rgba(244, 255, 251, 0.9) !important;
    }

    body.search-theme .search-filter-drawer label span {
        display: block;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    body.search-theme .search-filter-drawer input[type="checkbox"],
    body.search-theme .search-filter-drawer input[type="radio"] {
        display: inline-block !important;
        width: 1.25rem;
        height: 1.25rem;
        flex: 0 0 auto;
        opacity: 1 !important;
        visibility: visible !important;
        accent-color: #00f2c3;
    }

    body.search-theme .search-filter-mobile-footer {
        position: sticky;
        bottom: calc(-78px - env(safe-area-inset-bottom));
        z-index: 4;
        display: grid !important;
        grid-template-columns: 0.8fr 1.2fr;
        gap: 0.75rem;
        margin: 1rem -1rem calc(-78px - env(safe-area-inset-bottom));
        padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
        background: rgba(3, 16, 21, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }

    body.search-theme .search-filter-reset,
    body.search-theme .search-filter-apply {
        min-height: 44px;
        border-radius: 999px;
        font-size: 0.88rem;
        font-weight: 900;
    }

    body.search-theme .search-filter-reset {
        color: rgba(244, 255, 251, 0.82) !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
    }

    body.search-theme .search-filter-apply {
        color: #ffffff !important;
        background: linear-gradient(135deg, #008eff 0%, #15AEB0 52%, #16c97d 100%) !important;
        border: 1px solid rgba(0, 242, 195, 0.18) !important;
        box-shadow: 0 14px 28px rgba(0, 142, 255, 0.22) !important;
    }
}

@media (max-width: 767px) {
    body.search-theme .search-filter-mobile-footer,
    body.search-theme .search-filter-reset,
    body.search-theme .search-filter-apply {
        display: none !important;
    }
}

/* /search mobile property card centering */
@media (max-width: 767px) {
    body.search-theme #results-container.search-primary-list,
    body.search-theme #additional-results-container.additional-results-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    body.search-theme #results-container > .property-card,
    body.search-theme #additional-results-container > .property-card {
        width: min(100%, 460px) !important;
        max-width: calc(100vw - 2rem) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-self: center !important;
        flex: 0 1 auto !important;
    }
}
