﻿  .wrapper.ovh {
    overflow-x: clip;  /* prevents horizontal overflow without breaking sticky */
    overflow-y: visible;
  }

  /* =============================================
     TOP CONTROLS LAYOUT
     - Search bar constrained to same width as filter/sort row
     - View-toggle cards sit to the right alongside it
     ============================================= */
  .hp-controls-shell {
    max-width: 75%;   /* matches the col-xl-9 width of the filter zone on desktop */
  }

  @media (max-width: 1199px) {
    .hp-controls-shell {
      max-width: 100%;
    }
  }

  /* Row that holds the search bar (left) + view toggles (right) */
  .hp-search-and-views {
    display: flex;
    align-items: stretch;
    gap: 14px;
  }

  .hp-search-and-views .hp-search-bar-wrapper {
    flex: 1;
    min-width: 0;
  }

  /* ---- Search bar wrapper ---- */
  .hp-search-bar-wrapper {
    position: relative;
    z-index: 100;
  }

  .hp-search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 6px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 52px;
    height: 100%;
  }

  .hp-search-bar:focus-within {
    border-color: #EB6753;
    box-shadow: 0 0 0 3px rgba(235, 103, 83, 0.12);
  }

  .hp-search-icon {
    flex-shrink: 0;
    color: #717171;
    font-size: 18px;
    margin-right: 10px;
    display: flex;
    align-items: center;
  }

  .hp-search-pills-and-input {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .hp-search-input {
    flex: 1;
    min-width: 180px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #222;
    background: transparent;
    padding: 6px 0;
    line-height: 1.4;
  }

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

  .hp-search-clear {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hp-search-clear:hover {
    color: #EB6753;
    background: rgba(235, 103, 83, 0.08);
  }

  /* ---- Selected location pills ---- */
  .hp-selected-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .hp-location-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 10px;
    background: #EB6753;
    border: 0px solid #c7d2fe;
    border-radius: 16px;
    font-size: 13px;
    color: #FFFFFF;
    font-weight: 500;
    white-space: nowrap;
    animation: pillFadeIn 0.2s ease;
    line-height: 1.3;
  }

  .hp-location-pill .hp-pill-type-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #FFFFFF;
    font-weight: 600;
    margin-right: 2px;
  }

  .hp-location-pill .hp-pill-remove {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
  }

  .hp-location-pill .hp-pill-remove:hover {
    color: #000000;
    background: rgba(220, 38, 38, 0.1);
  }

  @keyframes pillFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* ---- Autocomplete dropdown ---- */
  .hp-autocomplete-container {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    max-height: 360px;
    overflow-y: auto;
    z-index: 9999;
  }

  .hp-autocomplete-container.show {
    display: block;
  }

  .hp-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.12s;
    gap: 12px;
    border-bottom: 1px solid #f5f5f5;
  }

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

  .hp-autocomplete-item:hover,
  .hp-autocomplete-item.selected {
    background: #f7f7f7;
  }

  .hp-autocomplete-item .hp-ac-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #999;
  }

  .hp-autocomplete-item .hp-ac-content {
    flex: 1;
    min-width: 0;
  }

  .hp-autocomplete-item .hp-ac-category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    font-weight: 600;
    line-height: 1.2;
    float: right;
    margin-top: 5px;
  }

  .hp-autocomplete-item .hp-ac-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-autocomplete-item .hp-ac-text .highlighted {
    font-weight: 700;
    color: #EB6753;
  }

  .hp-autocomplete-item .hp-ac-add-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #EB6753;
    background: #fff;
    color: #EB6753;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
  }

  .hp-autocomplete-item .hp-ac-add-btn:hover {
    background: #EB6753;
    color: #fff;
  }

  .hp-autocomplete-item.already-added .hp-ac-add-btn {
    border-color: #ccc;
    color: #ccc;
    cursor: default;
    pointer-events: none;
  }

  .hp-autocomplete-item.already-added .hp-ac-add-btn::after {
    content: '✓';
    font-size: 14px;
  }

  .hp-autocomplete-item.already-added .hp-ac-add-btn .fa {
    display: none;
  }

  .hp-autocomplete-no-results {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
  }

  /* =============================================
     DESKTOP VIEW-MODE TOGGLE CARDS
     - Larger tappable cards with labels
     - Sit to the right alongside the search bar
     ============================================= */
  .hp-view-toggles {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
  }

  .hp-view-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 64px;
    padding: 6px 10px;
    background: #FFFFFF;
    border: 2px solid #E9E9E9;
    border-radius: 12px;
    color: #EB6753;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
  }

  .hp-view-card i {
    font-size: 20px;
    line-height: 1;
    font-weight: 200;
  }

  .hp-view-card .hp-view-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
  }

  .hp-view-card:hover {
      background: #181A20;
    color: #FFFFFF;
  }

  .hp-view-card.active {
    border-color: #EB6753;
    background: #EB6753;
    color: #fff;
    box-shadow: 0 4px 12px rgba(235, 103, 83, 0.25);
  }

  /* ---- Responsive ---- */
  @media (max-width: 575px) {
    .hp-search-bar {
      padding: 5px 10px;
      min-height: 46px;
    }
    .hp-search-input {
      font-size: 14px;
      min-width: 120px;
    }
    .hp-location-pill {
      font-size: 12px;
      padding: 3px 6px 3px 8px;
    }
  }

  /* =============================================
     TINDER VIEW UNIQUE STYLES
     ============================================= */
  .hp-tinder-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    gap: 20px;
  }

  @media (min-width: 992px) {
    .hp-tinder-wrapper {
      flex-direction: row;
      align-items: flex-start;
    }
  }

  .hp-tinder-main-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
  }

  /* ---- Tinder Stack Area ---- */
  .hp-tinder-card-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 540px;
    margin: 15px auto;
    perspective: 1000px;
  }

.hp-tinder-card {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  overflow: hidden;
  user-select: none;
  cursor: grab;
  display: flex;
  flex-direction: column;
  transform-origin: 50% 100%;
  /* Smoother, longer transition for promotion between stack positions */
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.45s ease;
}

  .hp-tinder-card:active {
    cursor: grabbing;
  }

  /* Stack depth styling */
  .hp-tinder-card.hp-tinder-card-1 {
    z-index: 3;
    transform: translate3d(0, 0, 0) scale(1);
  }
  .hp-tinder-card.hp-tinder-card-2 {
    z-index: 2;
    transform: translate3d(0, 12px, -15px) scale(0.95);
    opacity: 0.9;
  }
  .hp-tinder-card.hp-tinder-card-3 {
    z-index: 1;
    transform: translate3d(0, 24px, -30px) scale(0.90);
    opacity: 0.7;
  }
  .hp-tinder-card.hp-tinder-card-back {
    z-index: 0;
    transform: translate3d(0, 24px, -30px) scale(0.90);
    opacity: 0;
  }

  /* Card inner content */
  .hp-tinder-card-media {
    position: relative;
    width: 100%;
    background: #eee;
  }

  .hp-tinder-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
  }

  .hp-tinder-card-badge {
    position: absolute;
    top: 25px;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transform: rotate(-10deg);
    pointer-events: none;
    transition: opacity 0.1s;
    z-index: 10;
  }

  .hp-tinder-card-badge.badge-like {
    right: 20px;
    border: 4px solid #4caf50;
    color: #4caf50;
    transform: rotate(-12deg);
  }

  .hp-tinder-card-badge.badge-nope {
    left: 20px;
    border: 4px solid #f44336;
    color: #f44336;
    transform: rotate(12deg);
  }

  .hp-tinder-card-info {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
  }

  .hp-tinder-card-price {
    font-size: 18px;
    font-weight: 800;
    color: #555555;
    margin-bottom: 2px;
  }

  .hp-tinder-card-address {
    font-size: 16px;
    font-weight: 600;
    color: #EB6753;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
  }

  .hp-tinder-card-summary {
    font-size: 14px;
    font-weight: normal;
    color: #888888;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    line-height: 14px;
  }

  .hp-tinder-card-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #717171;
    font-size: 14px;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
  }

  .hp-tinder-card-stats span i {
    margin-right: 5px;
    color: #EB6753;
  }

  /* ---- Action Buttons ---- */
  .hp-tinder-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    width: 100%;
  }

  .hp-tinder-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    outline: none;
    background: #ffffff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
  }

  .hp-tinder-btn:hover {
    transform: scale(1.1);
  }

  .hp-tinder-btn:active {
    transform: scale(0.95);
  }

  .hp-tinder-btn.btn-rewind {
    color: #ffa726;
    width: 50px;
    height: 50px;
    font-size: 16px;
  }

  .hp-tinder-btn.btn-rewind:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
  }

  .hp-tinder-btn.btn-dislike {
    color: #f44336;
    font-size: 24px;
    border: 2px solid rgba(244, 67, 54, 0.1);
  }

  .hp-tinder-btn.btn-dislike:hover {
    background: rgba(244, 67, 54, 0.05);
  }

  .hp-tinder-btn.btn-like {
    color: #4caf50;
    font-size: 24px;
    border: 2px solid rgba(76, 175, 80, 0.1);
  }

  .hp-tinder-btn.btn-like:hover {
    background: rgba(76, 175, 80, 0.05);
  }

  .hp-tinder-btn.btn-link {
    color: #2196f3;
    width: 50px;
    height: 50px;
    font-size: 16px;
  }

  /* ---- Tinder Empty State ---- */
  .hp-tinder-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 30px;
    color: #717171;
  }

  .hp-tinder-empty i {
    font-size: 56px;
    color: #EB6753;
    margin-bottom: 20px;
    opacity: 0.8;
  }

  .hp-tinder-empty h3 {
    font-size: 20px;
    font-weight: 700;
    color: #181a20;
    margin-bottom: 8px;
  }

  /* ---- Tinder Swipes Progress History Pane ---- */
  .hp-tinder-history {
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 480px;
  }

  @media (min-width: 992px) {
    .hp-tinder-history {
      width: 340px;
      height: 540px;
      margin-top: 15px;
    }
  }

  .hp-tinder-history-header {
    background: #f7f7f7;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
  }

  .hp-tinder-history-tab {
    flex: 1;
    border: none;
    background: none;
    padding: 15px 10px;
    font-size: 14px;
    font-weight: 700;
    color: #717171;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 3px solid transparent;
  }

  .hp-tinder-history-tab.active {
    color: #EB6753;
    border-bottom-color: #EB6753;
  }

  .hp-tinder-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
  }

  .hp-tinder-history-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    font-size: 13px;
    text-align: center;
    padding: 20px;
  }

  .hp-tinder-history-list-empty i {
    font-size: 30px;
    margin-bottom: 10px;
  }

  /* ---- Swipe History Item Card ---- */
  .hp-tinder-history-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    margin-bottom: 10px;
    transition: background 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
  }

  .hp-tinder-history-item:hover {
    background: #f9f9f9;
    box-shadow: 0 3px 10px rgba(0,0,0,0.03);
  }

  .hp-tinder-history-thumb {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eee;
  }

  .hp-tinder-history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hp-tinder-history-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hp-tinder-history-price {
    font-size: 15px;
    font-weight: 700;
    color: #181a20;
    margin-bottom: 1px;
  }

  .hp-tinder-history-addr {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-tinder-history-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
  }

  .hp-tinder-history-action-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
    align-self: center;
    transition: color 0.15s;
  }

  .hp-tinder-history-action-remove:hover {
    color: #f44336;
  }

  /* Dynamic animation states */
  .hp-tinder-swipe-left {
    transform: translate3d(-150%, 0, 0) rotate(-25deg) !important;
    opacity: 0 !important;
  }

  .hp-tinder-swipe-right {
    transform: translate3d(150%, 0, 0) rotate(25deg) !important;
    opacity: 0 !important;
  }

  /* History Toggle Mobile Control */
  .hp-tinder-history-toggle-btn {
    display: none;
  }

.hp-tinder-card.hp-tinder-swipe-left,
.hp-tinder-card.hp-tinder-swipe-right {
  transition: transform 0.4s ease-out, opacity 0.3s ease-out !important;
}

  @media (max-width: 991px) {
    .hp-tinder-history-toggle-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px;
      border: 1px solid #e8e8e8;
      background: #ffffff;
      border-radius: 30px;
      color: #181a20;
      font-weight: 600;
      font-size: 13px;
      margin-top: 10px;
      cursor: pointer;
    }
    .hp-tinder-history-toggle-btn.active {
      background: #181a20;
      color: #ffffff;
      border-color: #181a20;
    }
    .hp-tinder-history-drawer {
      display: none;
    }
    .hp-tinder-history-drawer.open {
      display: flex;
      margin-top: 15px;
    }
  }

              /* ----------------------------------------------------------
               POLYGON DRAW BUTTON STATES
               ---------------------------------------------------------- */
            #btnDrawPolygon.active-control {
                background: #181a20;
                color: #fff;
                border-color: #181a20;
            }
             
            #btnDrawPolygon.active-control:hover {
                background: #181a20;
                border-color: #181a20;
            }
             
            #btnClearPolygon {
                color: #DC2626;
            }
            #btnClearPolygon:hover {
                background: #FEE2E2;
                border-color: #DC2626;
                color: #DC2626;
            }
             
            /* ----------------------------------------------------------
               DRAWING INSTRUCTIONS OVERLAY
               ---------------------------------------------------------- */
            .draw-instructions {
                position: absolute;
                top: 4px;
                right: 55px;
                z-index: 10;
                background: rgba(0, 0, 0, 0.65);
                color: #fff;
                padding: 4px 8px;
                border-radius: 8px;
                font-size: 11px;
                font-weight: 500;
                line-height: 1.4;
                pointer-events: none;
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
                animation: drawInstructionsFadeIn 0.3s ease;
            }
             
            @keyframes drawInstructionsFadeIn {
                from { opacity: 0; }
                to   { opacity: 1; }
            }
             
            @media (max-width: 600px) {
                .draw-instructions {
                    white-space: normal;
                    font-size: 10px;
                    padding: 4px 8px;
                    width: 320px;
                }
            }
             
            /* ----------------------------------------------------------
               MAP POPUP STYLING
               ---------------------------------------------------------- */
            .polygon-active-label {
                color: #181a20;
                font-weight: 600;
            }

            .maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
              border-top-color: #222222 !important;
              border-bottom-color: transparent !important;
              border-left-color: transparent !important;
              border-right-color: transparent !important;
            }

            .maplibregl-popup-anchor-top .maplibregl-popup-tip {
              border-bottom-color: #222222 !important;
              border-top-color: transparent !important;
              border-left-color: transparent !important;
              border-right-color: transparent !important;
            }

            .maplibregl-popup-anchor-left .maplibregl-popup-tip {
              border-right-color: #222222 !important;
              border-left-color: transparent !important;
              border-top-color: transparent !important;
              border-bottom-color: transparent !important;
            }

            .maplibregl-popup-anchor-right .maplibregl-popup-tip {
              border-left-color: #222222 !important;
              border-right-color: transparent !important;
              border-top-color: transparent !important;
              border-bottom-color: transparent !important;
            }

            .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {
              border-top-color: #222222 !important;
              border-bottom-color: transparent !important;
              border-left-color: transparent !important;
              border-right-color: transparent !important;
            }

            .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
              border-top-color: #222222 !important;
              border-bottom-color: transparent !important;
              border-left-color: transparent !important;
              border-right-color: transparent !important;
            }

            .maplibregl-popup-anchor-top-left .maplibregl-popup-tip {
              border-bottom-color: #222222 !important;
              border-top-color: transparent !important;
              border-left-color: transparent !important;
              border-right-color: transparent !important;
            }

            .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
              border-bottom-color: #222222 !important;
              border-top-color: transparent !important;
              border-left-color: transparent !important;
              border-right-color: transparent !important;
            }
