@media (max-width: 767px) {
  .mobile-viewmap-content {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .mobile-viewmap-content,
  .mobile-search-overlay,
  .mobile-filter-overlay {
    display: none !important;
  }
}
@media (max-width: 767px) {
  /* lock page scrolling (sheet will scroll instead) */
  html,
  body {
    height: 100%;
    overflow: hidden;
  }
  .properties-page.viewmap-fullwidth {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }
  .viewmap-page-header {
    display: none;
  }
  .viewmap-split {
    position: relative;
    height: 100vh;
    margin-bottom: 44px;
  }
  /* topbar stays */
  .mobile-topbar {
    background-color: white !important;
    position: fixed;
    top: 0 !important;
    left: 0;
    right: 0;
    margin: 0;
    height: 80px;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mobile-back-btn,
  .mobile-filter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }
  .mobile-back-btn img,
  .mobile-back-btn svg {
    width: 16px;
    height: 16px;
    display: block;
  }
  .mobile-back-btn i,
  .mobile-filter-btn i {
    font-size: 16px;
    display: block;
    line-height: 16px;
  }
  .mobile-search-pill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 120px);
    max-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: none;
    border: 1px solid #9ca3af;
  }
  .mobile-lbl {
    color: #111827;
    font-weight: 400;
    font-size: 14px;
    text-align: center;
  }
  .mobile-sub {
    font-size: 12px;
    line-height: 16px;
    text-align: center;
  }
  .sheet-expanded .mobile-topbar {
    top: 0;
  }
  .viewmap-list .sortbar {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 8px 12px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .viewmap-list .sortbar-label {
    color: #374151;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
  }
  .viewmap-list .sortbar-label::after {
    content: ": ";
  }
  .viewmap-list .sortbar-select {
    width: 85%;
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    padding-right: 22px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 16px 16px;
  }
  /* MAP always behind */
  .viewmap-map {
    position: fixed;
    inset: 0;
    z-index: 1;
    margin: 0;
    width: 100%;
    height: 100vh;
    touch-action: pan-x pan-y;
  }
  .viewmap-map #googleMapWrapper,
  .viewmap-map #googleMapWrapper #map {
    width: 100% !important;
    height: 100% !important;
    touch-action: pan-x pan-y;
  }
  /* SHEET (the list) */
  .viewmap-list {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* JS will control this via CSS variable */
    top: var(--sheetTop, calc(100vh - 36px));
    z-index: 2000;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  /* handle area */
  .viewmap-list .sheet-handle {
    flex: 0 0 auto;
    cursor: grab;
    touch-action: none;
  }
  .viewmap-list .sheet-handle::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 16px;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.3);
  }
  /* sheet scroll area */
  .viewmap-list .sheet-body {
    flex: 1 1 auto;
    overflow: visible;
    padding-bottom: 12px;
  }
  /* prevent your inner scroller from fighting */
  .hotels-container-scroller {
    height: auto !important;
    overflow: visible !important;
    padding-right: 0;
  }
  /* list layout */
  .viewmap-list .hotels-container {
    grid-template-columns: 1fr;
  }
  .viewmap-list .hotels-container > div {
    width: 100% !important;
    max-width: none !important;
  }
  .sheet-collapsed .viewmap-list {
    overflow: hidden;
  }
  .sheet-expanded .viewmap-list {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-collapsed .viewmap-list {
    background: white;
    box-shadow: none;
    border-radius: 12px;
  }
  .sheet-collapsed .viewmap-list .sheet-handle {
    background: white;
  }

  /* Shared Scrollbar Styles */
  .viewmap-list,
  .mobile-filter-dialog .dialog-body,
  .mobile-search-dialog .dialog-body {
    scrollbar-width: thin;
    scrollbar-color: #bfbfbf transparent;
  }
  .viewmap-list::-webkit-scrollbar,
  .mobile-filter-dialog .dialog-body::-webkit-scrollbar,
  .mobile-search-dialog .dialog-body::-webkit-scrollbar {
    width: 2px;
  }
  .viewmap-list::-webkit-scrollbar-track,
  .mobile-filter-dialog .dialog-body::-webkit-scrollbar-track,
  .mobile-search-dialog .dialog-body::-webkit-scrollbar-track {
    background: transparent;
  }
  .viewmap-list::-webkit-scrollbar-thumb,
  .mobile-filter-dialog .dialog-body::-webkit-scrollbar-thumb,
  .mobile-search-dialog .dialog-body::-webkit-scrollbar-thumb {
    background: #bfbfbf;
    border-radius: 999px;
  }
  .viewmap-list::-webkit-scrollbar-thumb:hover,
  .mobile-filter-dialog .dialog-body::-webkit-scrollbar-thumb:hover,
  .mobile-search-dialog .dialog-body::-webkit-scrollbar-thumb:hover {
    background: #a6a6a6;
  }

  .sheet-expanded .viewmap-list {
    padding-bottom: 35px;
  }
  .sheet-collapsed .viewmap-list .sortbar {
    display: none;
  }
  .sheet-expanded .viewmap-list .sortbar {
    width: 100%;
    margin: 0 0 16px 0;
  }
  /* hide filters in mobile as before */
  .viewmap-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
  }
  .viewmap-filters .panel-divider,
  .viewmap-filters .search-hotel,
  .viewmap-filters .filter {
    display: none;
  }

  /* Shared Overlay Styles */
  .mobile-search-overlay,
  .mobile-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
  }
  .mobile-search-overlay {
    padding: 50% 0;
  }
  .mobile-search-overlay.show,
  .mobile-filter-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-search-dialog {
    position: relative;
    width: min(420px, calc(100% - 32px));
    max-height: 80vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
  }
  .mobile-search-dialog .dialog-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: start;
    color: black;
  }
  .mobile-search-dialog .dialog-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-search-dialog .dialog-actions {
    padding: 16px;
    border-top: none;
  }
  .mobile-search-dialog .header-rmsearch-input,
  .mobile-search-dialog .input-occupancy {
    border-radius: 10px;
    min-height: 42px;
    padding-left: 40px;
    padding-right: 36px;
    font-size: 14px;
  }
  .mobile-search-dialog .header-rmsearch-input::placeholder {
    color: #9ca3af;
    opacity: 1;
  }

  /* Shared Icon Backgrounds for Search Inputs */
  .mobile-search-dialog #filterLocation,
  .mobile-search-dialog #filterDates,
  .mobile-search-dialog .input-occupancy {
    background-repeat: no-repeat, no-repeat;
    background-position: 12px center, right 12px center;
    background-size: 16px 16px, 16px 16px;
  }

  .mobile-search-dialog #filterLocation {
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22s8-7.163 8-12a8 8 0 10-16 0c0 4.837 8 12 8 12z' stroke='%239CA3AF' stroke-width='2'/%3E%3Ccircle cx='12' cy='10' r='3' stroke='%239CA3AF' stroke-width='2'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 15l4 4 4-4M8 9l4-4 4 4' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  .mobile-search-dialog #filterDates {
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' stroke='%239CA3AF' stroke-width='2'/%3E%3Cpath d='M3 9h18' stroke='%239CA3AF' stroke-width='2'/%3E%3Cpath d='M7 3v4M17 3v4' stroke='%239CA3AF' stroke-width='2'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 15l4 4 4-4M8 9l4-4 4 4' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  .mobile-search-dialog .input-occupancy {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 21C20 16.5817 16.4183 13 12 13C7.58172 13 4 16.5817 4 21' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='7' r='4' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 15l4 4 4-4M8 9l4-4 4 4' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    padding-left: 40px;
    padding-right: 36px;
    position: relative;
  }

  .mobile-filter-dialog {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 85vh;
    padding-bottom: 0;
    padding-top: 0;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 220ms ease-in-out;
  }
  .mobile-filter-overlay.show .mobile-filter-dialog {
    transform: translateY(0);
  }
  /* Drag Handle */
  .mobile-filter-dialog::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background-color: #d1d5db;
    margin: 8px auto 6px auto;
    flex: 0 0 auto;
  }
  /* Hide default JS header */
  .mobile-filter-dialog .dialog-header {
    display: none !important;
  }

  .mobile-filter-dialog .border {
    border: none !important;
  }

  .mobile-filter-dialog .dialog-body {
    padding: 0px 0 24px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  /* Filter Header (inside body) */
  .mobile-filter-dialog .p-m.filter,
  .mobile-filter-dialog .filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    padding: 12px 16px;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 0 #e5e7eb;
  }
  .mobile-filter-dialog .filter-header,
  .mobile-filter-dialog .filter-bar .filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin: 0;
  }
  .mobile-filter-dialog #clearAllFilters {
    font-size: 13px;
    color: #6b7280;
    text-decoration: underline;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    display: inline-block;
  }

  /* Layout & Spacing */
  .mobile-filter-dialog .panel-divider,
  .mobile-filter-dialog .filter-divider {
    height: 1px;
    background: #e5e7eb;
    border: none;
    width: 100%;
  }
  .mobile-filter-dialog .form-group,
  .mobile-filter-dialog .filter-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
  }

  /* Section Headers */
  .mobile-filter-dialog .control-label,
  .mobile-filter-dialog .filter-section-title {
    float: none;
  }
  .mobile-filter-dialog .pull-right.small,
  .mobile-filter-dialog .filter-section-action {
    text-decoration: underline;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    display: inline-block;
  }

  /* Checkbox Lists */
  .mobile-filter-dialog ul,
  .mobile-filter-dialog .filter-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .mobile-filter-dialog ul label,
  .mobile-filter-dialog .filter-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  /* Custom Checkbox */
  .mobile-filter-dialog input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    flex: 0 0 auto;
    background: #fff;
    transition: all 0.2s;
  }
  .mobile-filter-dialog input[type="checkbox"]:checked {
    background-color: #2563eb;
    border-color: #2563eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 100% 100%;
  }

  /* Price Section */
  .mobile-filter-dialog #filterPriceMinLbl,
  .mobile-filter-dialog #filterPriceMaxLbl {
    font-size: 12px;
  }
  .mobile-filter-dialog #filterPriceRange {
    margin-top: 16px;
    margin-bottom: 8px;
  }
  .mobile-filter-dialog #filterPriceRange.ui-slider {
    height: 8px;
    background: #e5e7eb;
    border-radius: 8px;
    border: none;
    z-index: 1;
  }
  .mobile-filter-dialog #filterPriceRange .ui-slider-range {
    background: #1292ff;
    border-radius: 8px;
  }
  .mobile-filter-dialog #filterPriceRange .ui-slider-handle {
    width: 16px;
    height: 16px;
    top: -5px;
    background: #fff;
    border: 1px solid #c9c9c9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    cursor: grab;
    margin-left: -8px;
    z-index: 1 !important;
  }
  .mobile-filter-dialog #filterPriceRange .ui-slider-handle:hover,
  .mobile-filter-dialog #filterPriceRange .ui-slider-handle:focus {
    border-color: #9aa0a6;
    outline: none;
    transform: none;
  }

  /* Star Rating Specifics */
  .mobile-filter-dialog #ratingList .star {
    font-size: 18px;
    color: #fbbf24; /* yellow-400 */
    margin-right: 4px;
  }
  .mobile-filter-dialog #ratingList label {
    display: flex;
    align-items: center;
  }
  .mobile-filter-dialog input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
  }
  .mobile-search-dialog .dialog-body #search_occupancy_wrapper {
    position: fixed !important;
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    z-index: 9999999 !important;
    -webkit-box-shadow: none;
    box-shadow: none;
  }
  #search_occupancy_wrapper {
    position: fixed !important;
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%);
    z-index: 9999999 !important;
    width: min(390px, calc(100% - 80px));

    max-height: 30vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  }
  #occupancy_inner_wrapper {
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    position: relative;
    width: 100%;
  }

  #occupancy_inner_wrapper::-webkit-scrollbar {
    width: 6px;
    background: transparent;
  }
  #occupancy_inner_wrapper::-webkit-scrollbar-track {
    background: transparent;
  }
  #occupancy_inner_wrapper::-webkit-scrollbar-thumb {
    background-color: #bfbfbf;
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: content-box;
  }
  #occupancy_inner_wrapper .occupancy_info_block {
    width: 100%;
  }
  #occupancy_inner_wrapper .occupancy_info_block .row {
    width: 90%;
  }

  .map-info-card {
    position: fixed;
    left: 50%;
    bottom: 6.5%;
    width: calc(100% - 32px);
    max-width: 680px;
    min-height: 142px;
    z-index: 3500;
    border-radius: 12px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translate(-50%, 18px);
    transition: opacity 180ms ease, transform 220ms ease;
    background-color: white;
    pointer-events: none;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .map-info-card.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }

  .map-info-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    height: 142px;
  }
  .map-info-media {
    width: 96px;
    min-width: 96px;
    flex: 0 0 96px;
    align-self: stretch;
  }
  .map-info-card .map-info-img  {
    display: block;
    width: 100%;
    height: 100%; 
    object-fit: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .map-info-col {
    min-width: 0;
    padding: 14px 16px;
    gap: 6px;
  }
  .map-info-title {
    color: #111827;
  }
  .map-info-stars {
    font-size: 12px;
    order: 4;
    margin-top: auto;
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f59e0b;
    white-space: nowrap;
  }
  .map-info-stars .map-info-count {
    color: #6b7280;
  }
  /* the right-side text column (parent of title/desc/price) */
  .map-info-text {
    flex: 1;
    min-width: 0; /* ✅ important for ellipsis inside flex */
  }

  /* the description line */
  .map-info-address {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    padding-bottom: 20px;
    max-width: 30; /* ~25 characters */
    overflow: hidden; /* ✅ needed */
    white-space: nowrap; /* ✅ 1 line */
    text-overflow: ellipsis;
    display: block;
  }

  .map-info-price {
    order: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .map-info-price .card-price {
    color: #111827;
  }
  .map-info-price .card-old-price {
    display: block;
    color: #9ca3af;
  }
  .map-info-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    background: #111827;
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
  }

  /* only one scrollbar (native) is shown; no pseudo-elements */
}
