/* ============================================================
   ARWEQAH INTERACTIVE MAP — Premium Frontend Stylesheet v2.0
   All JS-bound selectors are PRESERVED exactly.
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand Colors */
  --pmap-primary:           #003948;
  --pmap-primary-hover:     #004f63;
  --pmap-primary-10:        rgba(0, 57, 72, 0.10);
  --pmap-primary-06:        rgba(0, 57, 72, 0.06);
  --pmap-secondary:         #e0d9d0;
  --pmap-accent:            #00a99d;

  /* Surfaces */
  --pmap-surface:           #ffffff;
  --pmap-surface-raised:    #f8fafc;
  --pmap-surface-sunken:    #f1f5f9;
  --pmap-bg:                #f0f4f7;

  /* Text */
  --pmap-text-dark:         #0f1923;
  --pmap-text-mid:          #374151;
  --pmap-text-muted:        #64748b;
  --pmap-text-faint:        #94a3b8;

  /* Borders */
  --pmap-border:            #e2e8f0;
  --pmap-border-strong:     #cbd5e1;

  /* Border Radius Scale */
  --pmap-radius-xs:         1px;
  --pmap-radius-sm:         2px;
  --pmap-radius-md:         3px;
  --pmap-radius-lg:         4px;
  --pmap-radius-xl:         6px;
  --pmap-radius-full:       9999px;

  /* Shadow Scale */
  --pmap-shadow-xs:         0 1px 2px rgba(15, 25, 35, 0.06);
  --pmap-shadow-sm:         0 2px 8px rgba(15, 25, 35, 0.08);
  --pmap-shadow-md:         0 4px 16px rgba(15, 25, 35, 0.10);
  --pmap-shadow-lg:         0 12px 32px rgba(15, 25, 35, 0.12);
  --pmap-shadow-xl:         0 24px 48px rgba(15, 25, 35, 0.15);
  --pmap-shadow-focus:      0 0 0 3px rgba(0, 57, 72, 0.20);

  /* Transitions */
  --pmap-transition-fast:   0.15s ease;
  --pmap-transition-base:   0.22s ease;
  --pmap-transition-slow:   0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --pmap-sidebar-w:         340px;
  --pmap-map-h:             640px;

  /* Typography */
  --pmap-font:              inherit, 'Segoe UI', system-ui, -apple-system, sans-serif
}

/* ============================================================
   GLOBAL RESETS FOR THE COMPONENT
   ============================================================ */
#pmap-container,
#pmap-container * {
  box-sizing: border-box;
}

#pmap-container {
  max-width: 1340px;
  min-height: 500px;
  margin: 32px auto;
  font-family: var(--pmap-font);
  color: var(--pmap-text-dark);
}

/* Direction scoped to container class — set by PHP based on is_rtl() */
#pmap-container.pmap-rtl { direction: rtl; text-align: right; }
#pmap-container.pmap-ltr { direction: ltr; text-align: left; }

/* ============================================================
   FILTER BAR
   ============================================================ */
#filter-bar {
  background: var(--pmap-surface);
  border: 1px solid var(--pmap-border);
  border-bottom: none;
  border-radius: var(--pmap-radius-lg) var(--pmap-radius-lg) 0 0;
  padding: 16px 24px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Filter Rows ---------- */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-row--primary {
  flex-wrap: nowrap;
  order: 2;
}

/* ---------- Search (Hidden) ---------- */
.search-box {
  display: none !important;
}

.search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--pmap-text-muted);
  pointer-events: none;
  transition: color var(--pmap-transition-fast);
}

#pmap-container.pmap-rtl .search-icon { right: 14px; left: auto; }
#pmap-container.pmap-ltr .search-icon { left: 14px; right: auto; }

/* ⚠ JS-bound: #property-search */
#property-search {
  width: 100%;
  height: 44px;
  font-size: 14px;
  font-family: var(--pmap-font);
  border-radius: var(--pmap-radius-sm);
  border: 1.5px solid var(--pmap-border);
  background: var(--pmap-surface-raised);
  color: var(--pmap-text-dark);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--pmap-transition-base),
              box-shadow   var(--pmap-transition-base),
              background   var(--pmap-transition-base);
}

#pmap-container.pmap-rtl #property-search { padding: 0 42px 0 14px; }
#pmap-container.pmap-ltr #property-search { padding: 0 14px 0 42px; }

#property-search::placeholder {
  color: var(--pmap-text-faint);
}

#property-search:focus {
  border-color: var(--pmap-primary);
  background: var(--pmap-surface);
  box-shadow: var(--pmap-shadow-focus);
}

#property-search:focus ~ .search-icon {
  color: var(--pmap-primary);
}

/* ⚠ JS-bound: .search-clear-btn */
.search-clear-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: var(--pmap-border-strong);
  border-radius: var(--pmap-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--pmap-transition-fast),
              background var(--pmap-transition-fast),
              transform var(--pmap-transition-fast);
}

#pmap-container.pmap-rtl .search-clear-btn { left: 10px; right: auto; }
#pmap-container.pmap-ltr .search-clear-btn { right: 10px; left: auto; }

.search-clear-btn svg {
  width: 10px;
  height: 10px;
  color: #fff;
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background: var(--pmap-primary);
  transform: translateY(-50%) scale(1.1);
}

.search-box.has-value .search-clear-btn {
  opacity: 1;
  pointer-events: auto;
}

.search-box.has-value #property-search {
  padding-left: 42px;
  padding-right: 42px;
}

/* ---------- City Select ---------- */
.city-filter {
  flex: 0 0 160px;
}

/* ⚠ JS-bound: #city-select, #status-select */
.city-filter select,
.status-filter select {
  width: 100%;
  height: auto;
  padding: 0 14px 0 36px;
  font-size: 13.5px;
  font-family: var(--pmap-font);
  border-radius: var(--pmap-radius-sm);
  border: 1.5px solid var(--pmap-border);
  background: var(--pmap-surface-raised);
  color: var(--pmap-text-mid);
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color var(--pmap-transition-base),
              box-shadow   var(--pmap-transition-base),
              background   var(--pmap-transition-base);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  background-size: 16px;
}

.city-filter select:focus,
.status-filter select:focus {
  border-color: var(--pmap-primary);
  background-color: var(--pmap-surface);
  box-shadow: var(--pmap-shadow-focus);
  color: var(--pmap-text-dark);
}

/* ---------- More Filters Button ---------- */
.more-filters-wrap {
  position: relative;
  flex: 0 0 auto;
}

/* ⚠ JS-bound: .more-filters-btn */
.more-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 44px;
  font-size: 13.5px;
  font-family: var(--pmap-font);
  font-weight: 500;
  border: 1.5px solid var(--pmap-border);
  border-radius: var(--pmap-radius-sm);
  background: var(--pmap-surface);
  color: var(--pmap-text-mid);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--pmap-transition-base),
              color        var(--pmap-transition-base),
              background   var(--pmap-transition-base),
              box-shadow   var(--pmap-transition-base);
}

.more-filters-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform var(--pmap-transition-base);
}

.more-filters-btn:hover {
  border-color: var(--pmap-primary);
  color: var(--pmap-primary);
  background: var(--pmap-primary-06);
}

.more-filters-btn[aria-expanded="true"] {
  border-color: var(--pmap-primary);
  color: var(--pmap-primary);
  background: var(--pmap-primary-10);
  box-shadow: var(--pmap-shadow-focus);
}

.more-filters-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.more-filters-btn:focus-visible {
  outline: none;
  box-shadow: var(--pmap-shadow-focus);
}

/* Active filter count badge */
.more-filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--pmap-radius-full);
  background: var(--pmap-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- More Filters Dropdown Panel ---------- */
/* ⚠ JS-bound: #more-filters-panel */
.more-filters-panel {
  position: absolute;
  top: calc(100% + 8px);
  background: var(--pmap-surface);
  border: 1.5px solid var(--pmap-border);
  border-radius: var(--pmap-radius-md);
  padding: 18px 20px;
  min-width: 240px;
  z-index: 200;
  box-shadow: var(--pmap-shadow-lg);
  animation: pmapDropdownIn var(--pmap-transition-base) both;
}

.more-filters-panel[hidden] { display: none; }

#pmap-container.pmap-rtl .more-filters-panel { right: 0; left: auto; }
#pmap-container.pmap-ltr .more-filters-panel { left: 0; right: auto; }

@keyframes pmapDropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.filter-panel-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--pmap-text-faint);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.more-filters-panel .status-filter {
  width: 100%;
}

.more-filters-panel .status-filter select {
  width: 100%;
}

/* ---------- Results Count ---------- */
.pmap-meta {
  flex-shrink: 0;
  order: 3;
}

#pmap-container.pmap-rtl .pmap-meta { margin-right: 8px; margin-left: 0; }
#pmap-container.pmap-ltr .pmap-meta { margin-left: 8px; margin-right: 0; }

/* ⚠ JS-bound: #pmap-results-count */
#pmap-results-count {
  font-size: 12.5px;
  color: var(--pmap-text-muted);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* ---------- Property Type Chips ---------- */
.filter-row--types {
  padding-top: 0;
  border-top: none;
  order: 1;
}

/* ⚠ JS-bound: .property-types, .filter-btn, data-type */
.property-types {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.property-types::-webkit-scrollbar {
  display: none;
}

.filter-row--types {
  justify-content: flex-end;
}
.filter-btn {
  flex-shrink: 0;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: var(--pmap-radius-md);
  border: 1.5px solid var(--pmap-border);
  background: var(--pmap-surface);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--pmap-font);
  font-weight: 500;
  color: var(--pmap-text-mid);
  transition: border-color var(--pmap-transition-fast),
              color        var(--pmap-transition-fast),
              background   var(--pmap-transition-fast),
              box-shadow   var(--pmap-transition-fast),
              transform    var(--pmap-transition-fast);
  white-space: nowrap;
  line-height: 1.4;
  user-select: none;
}

.filter-btn:hover {
  background: var(--pmap-primary);
  color: #fff;
  border-radius: var(--pmap-radius-md);
  border-color: var(--pmap-primary);
  box-shadow: 0 3px 10px rgba(0, 57, 72, 0.28);
  transform: translateY(-1px);
}

.filter-btn:active {
  transform: translateY(0);
}

.filter-btn:focus-visible {
  outline: none;
  box-shadow: var(--pmap-shadow-focus);
}

/* ⚠ JS-bound: .filter-btn.active */
.filter-btn.active {
  background: var(--pmap-primary);
  color: #fff;
  border-radius: var(--pmap-radius-md);
  border-color: var(--pmap-primary);
  box-shadow: 0 3px 10px rgba(0, 57, 72, 0.28);
}

.filter-btn.active:hover {
  background: var(--pmap-primary-hover);
  transform: translateY(-1px);
}

/* ---------- Active Filter Chips ---------- */
/* ⚠ JS-bound: #active-filters */
#active-filters {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  flex-wrap: nowrap;
  gap: 8px;

  z-index: 100;

  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);

  padding: 8px 12px;
  border-radius: 999px;

  box-shadow:
    0 10px 25px rgba(0,0,0,.12);

  max-width: calc(100% - 40px);
  overflow-x: auto;
  scrollbar-width: none;
}

#active-filters::-webkit-scrollbar {
  display: none;
}

#active-filters[hidden] { display: none; }

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--pmap-radius-full);
  background: var(--pmap-primary-10);
  border: 1px solid rgba(0, 57, 72, 0.2);
  color: var(--pmap-primary);
  font-size: 12px;
  font-weight: 600;
  animation: pmapChipIn var(--pmap-transition-base) both;
}


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

.active-chip-remove {
  cursor: pointer;
  background: rgba(0, 57, 72, 0.15);
  border: none;
  border-radius: var(--pmap-radius-full);
  padding: 0;
  color: var(--pmap-primary);
  font-size: 12px;
  line-height: 1;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--pmap-transition-fast);
}

.active-chip-remove:hover {
  background: var(--pmap-primary);
  color: #fff;
}

/* ============================================================
   MAP + SIDEBAR WRAPPER
   ============================================================ */
/* ⚠ JS-bound: #pmap-wrapper */
#pmap-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--pmap-surface);
  border-radius: 0 0 var(--pmap-radius-lg) var(--pmap-radius-lg);
  border: 1px solid var(--pmap-border);
  overflow: hidden;
  box-shadow: var(--pmap-shadow-md);
  height: 75vh;
}

/* ⚠ JS-bound: #map */
#map {
  flex: auto;
  width: 100%;
  position: relative;
  min-width: 0;
  height: 75vh;

}
 


/* ⚠ JS-bound: #pmap-sidebar */
#pmap-sidebar {
  width: 100%;
  background: transparent;
  border-top: none;
  border-right: none;
  overflow-y: hidden;
  overflow-x: auto;
  z-index: 9;
  padding: 20px;
  box-sizing: border-box;
  cursor: grab;
  /* Smooth momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  position: absolute;
  bottom: 0;
}

/* Active drag state — added by JS initDragScroll */
#pmap-sidebar.pmap-dragging {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto; /* disable smooth during drag for snappy feel */
}

#property-list {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  min-width: min-content;
  /* Prevent text selection during drag swipe */
  pointer-events: auto;
}

/* Premium scrollbar */
#pmap-sidebar::-webkit-scrollbar        { height: 6px; }
#pmap-sidebar::-webkit-scrollbar-track  { background: var(--pmap-surface-sunken); border-radius: var(--pmap-radius-full); }
#pmap-sidebar::-webkit-scrollbar-thumb  {
  background: var(--pmap-border-strong);
  border-radius: var(--pmap-radius-full);
}
#pmap-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--pmap-primary);
}

/* ============================================================
   PROPERTY CARDS
   ============================================================ */
/* ⚠ JS-bound: .property-card, .property-action */
.property-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;

    border: 1px solid var(--pmap-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--pmap-surface);

    flex: 0 0 560px;
    height: 150px;

    scroll-snap-align: start;
    cursor: pointer;

    /* Scope layout/paint to each card — reduces cost of hover & progress bar updates */
    contain: content;

    transition:
        transform var(--pmap-transition-slow),
        box-shadow var(--pmap-transition-slow),
        border-color var(--pmap-transition-base);

    will-change: transform, box-shadow;
}

/* Elementor template wrapper reset */
.property-card > .elementor {
  width: 100%;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pmap-shadow-lg);
  border-color: var(--pmap-border-strong);
}

.property-card:active {
  transform: translateY(-2px);
  box-shadow: var(--pmap-shadow-md);
}

.property-card:focus-visible {
  outline: none;
  box-shadow: var(--pmap-shadow-focus), var(--pmap-shadow-md);
}

/* --- Image area --- */
.property-card__image-wrap {
    position: relative;
    width: 150px;
    min-width: 150px;
    overflow: hidden;
    flex-shrink: 0;
}

/* ⚠ JS-bound: .property-image */
.property-image {
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
    display: block;
    transition: transform var(--pmap-transition-slow);
}

.property-card:hover .property-image {
  transform: scale(1.04);
}

/* Gradient overlay on image bottom */
.property-card__image-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 57, 72, 0.55), transparent);
  pointer-events: none;
}

/* ⚠ JS-bound: .property-type-badge */
.property-type-badge {
  position: absolute;
  top: 10px;
  background: rgba(224, 217, 208, 0.92);
  color: var(--pmap-primary);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--pmap-font);
  border-radius: var(--pmap-radius-xs);
  z-index: 5;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
  box-shadow: var(--pmap-shadow-xs);
}

#pmap-container.pmap-rtl .property-type-badge { right: 10px; left: auto; }
#pmap-container.pmap-ltr .property-type-badge { left: 10px; right: auto; }

/* --- Card body --- */
/* ⚠ JS-bound: .property-info */
.property-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 20px;
}

#pmap-container.pmap-rtl .property-info { text-align: right; }
#pmap-container.pmap-ltr .property-info { text-align: left; }

/* ⚠ JS-bound: .property-row */
.property-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
}

/* ⚠ JS-bound: .property-logo */
.property-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ⚠ JS-bound: .property-title */
.property-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--pmap-text-dark);
    line-height: 1.4;
    flex: 1;
	text-align:start;
}

/* ⚠ JS-bound: .property-action */
.property-action {
    margin-top: auto;
    min-width: 180px;

    font-size: 13px;
    font-weight: 600;

    background: var(--pmap-primary);
    color: #fff;

    border: none;
    border-radius: var(--pmap-radius-sm);

    padding: 11px 18px;

    cursor: pointer;

    transition:
        background var(--pmap-transition-base),
        transform var(--pmap-transition-fast);
}

#pmap-container.pmap-rtl .property-action { margin-left: auto; margin-right: 0; }
#pmap-container.pmap-ltr .property-action { margin-right: auto; margin-left: 0; }

.property-action:hover {
    background: var(--pmap-primary-hover);
    color: #f0f4f7;
}

.property-action:active {
  transform: scale(0.98);
}

.property-action:focus-visible {
  outline: none;
  box-shadow: var(--pmap-shadow-focus);
}

/* ============================================================
   PIE CHART (replaces progress bar)
   ⚠ JS-bound: .progress-bar-container, .progress-bar-fill, .progress-bar-text
   Positioned on bottom-right corner of the card image.
   SVG uses stroke-dasharray on a circle with r=15.9 (circumference ≈ 100).
   ============================================================ */
.progress-bar-container {
  position: absolute;
  bottom: 10px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--pmap-primary);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  z-index: 6;
  flex-shrink: 0;
}

#pmap-container.pmap-rtl .progress-bar-container { left: 10px; right: auto; }
#pmap-container.pmap-ltr .progress-bar-container { right: 10px; left: auto; }

/* SVG pie ring */
.pmap-pie-svg {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  transform: rotate(-90deg);  /* start arc from 12-o'clock */
  overflow: visible;
}

/* Background ring track */
.pmap-pie-track {
  stroke: rgba(255, 255, 255, 0.15);
}

/* ⚠ JS-bound: .progress-bar-fill — now an SVG <circle> arc */
.progress-bar-fill {
  stroke: var(--pmap-secondary);
  transition: stroke-dasharray 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 0 2px rgba(0, 57, 72, 0.30));
}

/* ⚠ JS-bound: .progress-bar-text — centered percentage label */
.progress-bar-text {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--pmap-font);
  line-height: 1;
  text-align: center;
  letter-spacing: -0.3px;
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
@keyframes pmapSkeletonPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.pmap-skeleton {
  background: var(--pmap-surface-sunken);
  border-radius: var(--pmap-radius-xs);
  animation: pmapSkeletonPulse 1.6s ease-in-out infinite;
}

/* Skeleton matches the horizontal card layout */
.pmap-skeleton-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--pmap-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--pmap-surface);
  flex: 0 0 560px;
  min-height: 190px;
  scroll-snap-align: start;
}

.pmap-skeleton-card__image {
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
  background: var(--pmap-surface-sunken);
  animation: pmapSkeletonPulse 1.6s ease-in-out infinite;
}

.pmap-skeleton-card__body {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.pmap-skeleton-card__line {
  height: 12px;
  background: var(--pmap-surface-sunken);
  border-radius: var(--pmap-radius-xs);
  margin-bottom: 10px;
  animation: pmapSkeletonPulse 1.6s ease-in-out infinite;
}

.pmap-skeleton-card__line:nth-child(1) { width: 70%; }
.pmap-skeleton-card__line:nth-child(2) { width: 45%; animation-delay: 0.15s; }
.pmap-skeleton-card__line:nth-child(3) {
  width: 100%;
  height: 32px;
  margin-top: 14px;
  border-radius: var(--pmap-radius-sm);
  animation-delay: 0.3s;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.pmap-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  animation: pmapFadeIn var(--pmap-transition-slow) both;
  width: 100%;
}

.pmap-empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--pmap-border-strong);
}

.pmap-empty-state__icon svg {
  width: 100%;
  height: 100%;
}

.pmap-empty-state__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--pmap-text-mid);
  margin: 0 0 6px;
}

.pmap-empty-state__desc {
  font-size: 13px;
  color: var(--pmap-text-muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.pmap-empty-state__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--pmap-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--pmap-font);
  border: none;
  border-radius: var(--pmap-radius-full);
  cursor: pointer;
  transition: background var(--pmap-transition-base),
              transform  var(--pmap-transition-fast);
}

.pmap-empty-state__btn:hover {
  background: var(--pmap-primary-hover);
  transform: translateY(-1px);
}

/* ============================================================
   MAP PRELOADER
   ============================================================ */
/* ⚠ JS-bound: #map-preloader */
#map-preloader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
  font-size: 13.5px;
  color: var(--pmap-text-muted);
  font-family: var(--pmap-font);
  font-weight: 500;
}

#map-preloader .spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--pmap-border);
  border-top-color: var(--pmap-primary);
  border-radius: var(--pmap-radius-full);
  animation: pmapSpin 0.75s linear infinite;
}

@keyframes pmapSpin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   CF7 MODAL
   ============================================================ */
/* ⚠ JS-bound: #pmap-cf7-modal, #pmap-cf7-content, #pmap-cf7-close */
.pmap-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.60);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: pmapBackdropIn 0.25s ease both;
}

@keyframes pmapBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pmap-modal-content {
  position: relative;
  background: var(--pmap-surface);
  border-radius: var(--pmap-radius-lg);
  padding: 36px 32px 32px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--pmap-shadow-xl);
  animation: pmapModalIn 0.30s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pmapModalIn {
  from { opacity: 0; transform: scale(0.93) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pmap-modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 32px;
  height: 32px;
  background: var(--pmap-surface-sunken);
  border: none;
  border-radius: var(--pmap-radius-full);
  font-size: 18px;
  cursor: pointer;
  color: var(--pmap-text-muted);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--pmap-transition-fast),
              color     var(--pmap-transition-fast),
              transform var(--pmap-transition-fast);
}

.pmap-modal-close:hover {
  background: var(--pmap-primary);
  color: #fff;
  transform: scale(1.1);
}

/* ============================================================
   MAPBOX CLUSTER MARKERS
   ============================================================ */
/* ⚠ JS-bound: .mapboxgl-cluster */
.mapboxgl-cluster {
  background-color: var(--pmap-primary) !important;
  color: #fff !important;
  border: 3px solid rgba(255,255,255,0.85) !important;
  box-shadow: 0 4px 12px rgba(0, 57, 72, 0.35) !important;
  font-family: var(--pmap-font) !important;
  font-weight: 700 !important;
}

/* Google Maps Advanced cluster marker class (added via JS renderer) */
.pmap-cluster-marker {
  border-radius: var(--pmap-radius-full);
  background: var(--pmap-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--pmap-font);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 57, 72, 0.35);
  cursor: pointer;
  transition: transform var(--pmap-transition-fast),
              box-shadow var(--pmap-transition-fast);
}

.pmap-cluster-marker:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 57, 72, 0.45);
}

/* ============================================================
   UTILITY ANIMATIONS
   ============================================================ */
@keyframes pmapFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pmapSlideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Cards fade in on first render */
.property-card {
  animation: pmapFadeIn 0.28s ease both;
}

/* Stagger children in sidebar */
#property-list .property-card:nth-child(1) { animation-delay: 0.04s; }
#property-list .property-card:nth-child(2) { animation-delay: 0.08s; }
#property-list .property-card:nth-child(3) { animation-delay: 0.12s; }
#property-list .property-card:nth-child(4) { animation-delay: 0.16s; }
#property-list .property-card:nth-child(n+5) { animation-delay: 0.20s; }

/* ============================================================
   RESPONSIVE — Tablet ≤ 1100px
   ============================================================ */
@media (max-width: 1100px) {
  :root {
    --pmap-sidebar-w: 300px;
    --pmap-map-h:     580px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile ≤ 768px
   ============================================================ */
@media (max-width: 768px) {
  #pmap-container {
    margin: 0;
    min-height: 300px;
  }

  /* Borderless on mobile — full bleed feel */
  #filter-bar {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 14px 16px 12px;
    gap: 12px;
  }

  #pmap-wrapper {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  /* Chips: horizontal scroll */
  .filter-row--types {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .filter-row--types::-webkit-scrollbar { display: none; }

  .property-types {
    flex-wrap: nowrap;
  }

  /* Filters panel: anchor left on mobile */
  .more-filters-panel {
    right: 0;
    left: auto;
    min-width: 200px;
  }

  /* Map: tall enough to be useful */
  #map {
    flex: 0 0 350px;
  }

  /* Sidebar below map */
  #pmap-sidebar {
    padding: 16px;
  }

  /* Make cards a bit narrower on mobile */
  .property-card, .pmap-skeleton-card {
    flex: 0 0 280px;
  }

  /* Bigger touch targets on mobile */
  .filter-btn {
    padding: 8px 18px;
    min-height: 38px;
  }

 .property-card {
  flex-direction: row;
  flex-wrap: wrap;
  min-height: fit-content;
}


.property-card__image-wrap {
    width: 100%;
    min-width: 100%;
}

.property-image {
    height: 180px;
    min-height: 180px;
}

.property-info {
    padding: 16px;
}

.property-action {
    width: 100%;
    min-width: 100%;
}

  /* Modal full-screen on mobile */
  .pmap-modal {
    padding: 0;
    align-items: flex-end;
  }

  .pmap-modal-content {
    border-radius: var(--pmap-radius-lg) var(--pmap-radius-lg) 0 0;
    max-height: 92vh;
    padding: 28px 20px 32px;
  }

  @keyframes pmapModalIn {
    from { opacity: 0; transform: translateY(60px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ============================================================
   ACCESSIBILITY — High-Contrast Focus Rings
   (Visible only for keyboard users via :focus-visible)
   ============================================================ */
#property-search:focus-visible,
.city-filter select:focus-visible,
.status-filter select:focus-visible {
  outline: 2px solid var(--pmap-primary);
  outline-offset: 2px;
}

/* aria-live region helper */
[aria-live] {
  contain: content;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:       0.01ms !important;
  }
}

/* ============================================================
   JS-TOGGLE: aria-expanded CSS hook
   ============================================================ */
.more-filters-btn[aria-expanded="true"] + .more-filters-panel {
  display: block;
}
