
/* SIMSAR_FLOATING_PROPERTY_CARD_V15 */
@media screen and (max-width:767px) {

  /* Only the selected property is displayed as a glass card */
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-card.smv2-selected) {
    display:flex !important;
    flex-direction:column !important;
    position:fixed !important;
    top:auto !important;
    left:12px !important;
    right:12px !important;
    bottom:calc(92px + env(safe-area-inset-bottom,0px))
      !important;
    inset-block-start:auto !important;
    width:auto !important;
    height:auto !important;
    min-height:0 !important;
    max-height:min(33dvh,215px) !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
    border-radius:20px !important;
    border:1px solid rgba(255,255,255,.88)
      !important;
    background:rgba(255,255,255,.94)
      !important;
    -webkit-backdrop-filter:blur(16px)
      !important;
    backdrop-filter:blur(16px) !important;
    box-shadow:0 12px 36px rgba(15,32,53,.25)
      !important;
    overflow:hidden !important;
    z-index:2147483000 !important;
  }

  /* Compact close row */
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected)
  .smv2-panel-head {
    display:flex !important;
    flex:0 0 35px !important;
    height:35px !important;
    min-height:35px !important;
    align-items:center !important;
    justify-content:flex-end !important;
    padding:3px 10px 0 !important;
    gap:0 !important;
    border:0 !important;
    background:transparent !important;
  }

  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected)
  .smv2-panel-head strong,
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected)
  .smv2-panel-head #smv2Count {
    display:none !important;
  }

  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected) #smv2Close {
    display:grid !important;
    place-items:center !important;
    position:static !important;
    flex:0 0 32px !important;
    width:32px !important;
    height:32px !important;
    min-width:32px !important;
    min-height:32px !important;
    margin-inline-start:auto !important;
    margin-inline-end:0 !important;
    padding:0 !important;
    opacity:1 !important;
    visibility:visible !important;
    color:#24384d !important;
    -webkit-text-fill-color:#24384d !important;
    font:600 24px/1 Arial,sans-serif !important;
    background:#ecf1f6 !important;
    border:1px solid #dce5ee !important;
    border-radius:50% !important;
    z-index:3 !important;
  }

  /* Prevent the previously added duplicate X */
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected)
  #smv2Close::before,
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected)
  #smv2Close::after {
    content:none !important;
    display:none !important;
  }

  /* Selected result only, with internal safety scroll */
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected)
  .smv2-results {
    display:block !important;
    flex:1 1 auto !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 10px 10px !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    overscroll-behavior:contain;
  }

  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-panel:has(.smv2-selected)
  .smv2-card:not(.smv2-selected) {
    display:none !important;
  }

  /* Horizontal modern card */
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-card.smv2-selected {
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    gap:11px !important;
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:9px !important;
    border:1px solid #e7ecf2 !important;
    border-radius:15px !important;
    background:rgba(255,255,255,.82)
      !important;
    box-shadow:none !important;
    text-decoration:none !important;
    cursor:pointer !important;
    transition:border-color .15s ease,
               background .15s ease !important;
  }

  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected:active {
    background:#eef5fe !important;
    border-color:#8bb7ee !important;
  }

  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected:focus-visible {
    outline:3px solid #1c65bb !important;
    outline-offset:2px !important;
  }

  /* Photo */
  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected .smv2-photo {
    display:block !important;
    flex:0 0 92px !important;
    width:92px !important;
    height:109px !important;
    min-width:92px !important;
    margin:0 !important;
    border:0 !important;
    border-radius:11px !important;
    overflow:hidden !important;
    background:#e9eef3 !important;
  }

  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected .smv2-photo img {
    width:100% !important;
    height:100% !important;
    object-fit:cover !important;
    display:block !important;
  }

  /* Details text */
  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected .smv2-card-copy {
    display:flex !important;
    flex:1 1 0 !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:center !important;
    min-width:0 !important;
    gap:4px !important;
    text-align:start !important;
  }

  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected .smv2-pills span {
    padding:3px 8px !important;
    border-radius:999px !important;
    background:#eaf2fe !important;
    color:#165cae !important;
    font-size:10px !important;
  }

  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected
  .smv2-card-copy strong {
    display:-webkit-box !important;
    overflow:hidden !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:2 !important;
    font-size:14px !important;
    line-height:1.3 !important;
    font-weight:750 !important;
    color:#1c3047 !important;
    overflow-wrap:anywhere;
  }

  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected
  .smv2-card-copy small {
    font-size:11px !important;
    color:#697b8e !important;
    max-width:100% !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected
  .smv2-card-copy b {
    color:#155bb5 !important;
    font-size:18px !important;
    font-weight:850 !important;
    line-height:1.2 !important;
    white-space:nowrap !important;
  }

  /* Visual hint: whole card remains the original click target */
  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected
  .smv2-card-copy::after {
    content:"View details  ›";
    display:block;
    align-self:flex-end;
    margin-top:3px;
    color:#d93826;
    font-size:11px;
    font-weight:750;
    pointer-events:none;
  }

  html[lang^="ar"] #page-map.active
  #simsar-map-v1 .smv2-card.smv2-selected
  .smv2-card-copy::after {
    content:"عرض تفاصيل الوحدة  ‹";
  }

  /* Hide the redundant show-results control */
  #page-map.active #simsar-map-v1.smv2-sheet-open
  .smv2-layout:has(.smv2-card.smv2-selected)
  #smv2Show {
    display:none !important;
  }
}

@media screen and (max-width:359px) {
  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected .smv2-photo {
    flex-basis:74px !important;
    width:74px !important;
    min-width:74px !important;
    height:95px !important;
  }
  #page-map.active #simsar-map-v1
  .smv2-card.smv2-selected
  .smv2-card-copy b {
    font-size:16px !important;
  }
}
