/* ===============================
   🏠 Barcelona Real Estate – Property Card (v3 Refined)
================================*/
.bre-card {
  background:#fff;
  border:1px solid #e5e7eb;
  overflow:hidden;
  transition:all .25s ease;
  box-shadow:0 4px 12px rgba(0,0,0,0.05);
  height:100%;
  display:flex;
  flex-direction:column;
}
.bre-card:hover {
  transform:translateY(-5px);
  box-shadow:0 8px 24px rgba(0,0,0,0.1);
}
.bre-card-inner {
  display:flex; flex-direction:column; text-decoration:none; color:inherit; height:100%;
}
.bre-thumb {
  height:220px;
  background-size:cover;
  background-position:center;
  position:relative;
}
.bre-badge {
  position:absolute;
  top:12px; right:12px;
  background:#f4b504;
  color:#2c2c2c;
  font-weight:600;
  font-size:13px;
  padding:4px 10px;
  border-radius:4px;
}
.bre-body {
  padding:16px;
  direction:rtl;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  flex-grow:1;
}
.bre-meta-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:13px;
  color:#444;
  margin-bottom:10px;
}
.bre-meta-top img { width:14px; height:14px; vertical-align:middle; margin-left:4px; opacity:.7; }
.bre-status {
  background:#fdf3c2;
  padding:2px 8px;
  border-radius:4px;
  font-weight:600;
  font-size:12px;
  color:#2c2c2c;
}
.bre-title {
  font-size:17px;
  font-weight:700;
  color:#2c2c2c;
  margin:0 0 8px;
}
.bre-desc {
  font-size:13px;
  color:#6b7280;
  margin:0 0 14px;
  line-height:1.6;
  min-height:36px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.bre-specs {
  display:flex;
  flex-wrap:wrap;
  gap:6px 12px;
  align-items:center;
  font-size:13px;
  color:#444;
  margin-bottom:12px;
}
.bre-specs span:not(:last-child)::after {
  content:"|";
  margin:0 6px;
  color:#ddd;
}
.bre-specs img {
  width:15px; height:15px; margin-left:4px;
  filter:brightness(0) saturate(100%) invert(25%) sepia(0%) saturate(0%) hue-rotate(172deg) brightness(95%) contrast(86%);
}
.bre-price {
  font-weight:700;
  font-size:16px;
  color:#f4b504;
  margin-bottom:8px;
}
.bre-deposit {
  font-size:12px;
  color:#777;
  margin-right:6px;
}
.bre-location {
  font-size:12.5px;
  color:#777;
  display:flex;
  align-items:center;
  gap:4px;
}
.bre-location img { width:13px; height:13px; opacity:.6; }

@media (max-width:768px){
  .bre-thumb{height:180px}
  .bre-title{font-size:15px}
}


/* ==========================
   🎨 فیلتر املاک
========================== */
.bre-filter-form {
display: flex;
flex-wrap: wrap;
gap: 16px; /* فاصله کمتر بین آیتم‌ها */
justify-content: flex-start;
}

.bre-filter-box {
flex: 1 1 calc(25% - 16px);
min-width: 200px;
background: #f9fafb;
border: 1px solid #e5e7eb;
padding: 16px 20px;
}

.bre-filter-box h4 {
margin: 0 0 10px;
font-size: 15px;
color: #111827;
font-weight: 600;
}

.bre-filter-box label {
display: block;
margin-bottom: 6px;
color: #374151;
font-size: 14px;
cursor: pointer;
}

.bre-filter-box input[type="checkbox"] {
margin-left: 6px;
}

/* حالت موبایل */
@media (max-width: 768px) {
.bre-filter-box {
  flex: 1 1 100%;
}
}


/* ===============================
   📱 اصلاح ریسپانسیو نهایی (نسخه override)
================================= */
@media (max-width: 900px) {
  /* آرشیو املاک */
  .bre-archive-layout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    padding: 20px !important;
    gap: 20px !important;
  }

  .bre-filter-sidebar {
    order: 2 !important;
    width: 100% !important;
  }

  .bre-property-list {
    order: 1 !important;
    width: 100% !important;
  }

  .bre-archive-wrap {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .bre-toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .bre-toolbar form select {
    width: 100% !important;
  }
}

/* صفحه تکی ملک */
@media (max-width: 900px) {
  .bre-single-layout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    padding: 20px !important;
    gap: 20px !important;
  }

  .bre-single-layout main,
  .bre-single-layout aside {
    width: 100% !important;
  }

  .bre-single-layout img {
    max-width: 100% !important;
    height: auto !important;
  }

  .similar-slider {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
  }

  .similar-slider a {
    flex: 0 0 80% !important;
  }
}

/* بهبود فونت و فضا در موبایل */
@media (max-width: 600px) {
  body {
    font-size: 15px !important;
  }

  h1, h2, h3 {
    font-size: 18px !important;
  }

  button, select, input {
    font-size: 15px !important;
  }

  .bre-filter-form {
    padding: 16px !important;
  }

  .bre-filter-box h4 {
    font-size: 14px !important;
  }

  .bre-filter-box label {
    font-size: 13px !important;
  }
}

/* ===============================
   🎠 Similar Slider Responsive
================================= */
.similar-slider {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* موبایل: حالت افقی قابل اسکرول */
@media (max-width: 900px) {
  .similar-slider {
    display: flex !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    gap: 16px !important;
    padding-bottom: 10px !important;
    -webkit-overflow-scrolling: touch;
  }

  .similar-slider a {
    flex: 0 0 85% !important;
    min-width: 85% !important;
    scroll-snap-align: start;
  }

  .similar-slider::-webkit-scrollbar {
    display: none;
  }
}



/* ===============================
   📱 Mobile Filter Drawer
================================= */
.bre-filter-toggle {
  display: none;
}

@media (max-width: 900px) {
  .bre-filter-toggle {
    display: block;
    width: 100%;
    background: #f4b504;
    color: #2c2c2c;
    font-weight: 600;
    border: none;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 12px;
  }

  .bre-filter-sidebar {
    position: fixed !important;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 24px;
  }

  .bre-filter-sidebar.active {
    right: 0;
  }

  /* بک‌دراپ نیمه‌شفاف */
  .bre-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
  }

  .bre-filter-overlay.show {
    display: block;
  }
}

input, select, textarea, button {
  font-size: 16px !important; /* Safari zoom fix */
}

@supports (-webkit-touch-callout: none) {
  /* فقط برای Safari و iOS */
  .bre-archive-layout,
  .bre-single-layout {
    width: 100vw !important;
    overflow-x: hidden !important;
  }

  body {
    overflow-x: hidden !important;
  }
}


/* ===============================
   🎠 Similar Properties Slider Fix (Final)
================================= */
.similar-slider {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.similar-slider .bre-card {
  flex: 1 1 calc(33.333% - 20px);
  min-width: 300px;
}

/* 📱 موبایل: به صورت اسلایدی تک‌کارت */
@media (max-width: 900px) {
  .similar-slider {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    gap: 16px !important;
    padding-bottom: 10px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .similar-slider::-webkit-scrollbar {
    display: none;
  }

  .similar-slider .bre-card {
    flex: 0 0 85% !important;
    min-width: 85% !important;
    max-width: 85% !important;
    scroll-snap-align: start;
  }
}



/* ===============================
   ❌ دکمه بستن فیلتر در موبایل
================================= */
.bre-filter-close {
  display: none;
}

@media (max-width: 900px) {
  .bre-filter-close {
    display: block;
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f4b504;
    color: #2c2c2c;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  .bre-filter-close:hover {
    background: #eab308;
  }

  .bre-filter-sidebar {
    position: fixed !important;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 50px 24px 24px; /* 👈 بالا کمی فاصله برای دکمه بستن */
  }

  .bre-filter-sidebar.active {
    right: 0;
  }
}



