/* assets/css/properties.css (v7) */

/* Global reset & overflow fix */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ====== GLOBAL BACKGROUND ====== */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #0f172a;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: -200px;
    background:
        radial-gradient(circle at 15% 10%, rgba(59,130,246,0.18), transparent 60%),
        radial-gradient(circle at 80% 90%, rgba(16,185,129,0.20), transparent 60%),
        radial-gradient(circle at 50% 130%, rgba(250,204,21,0.15), transparent 55%);
    opacity: 0.7;
    z-index: -1;
    animation: reBgFloat 22s ease-in-out infinite alternate;
}

@keyframes reBgFloat {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-30px, 20px, 0); }
}

/* ====== PAGE WRAPPER ====== */
.re-page {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ====== LOADING OVERLAY ====== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 80;
}
.loading-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.loading-box {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(15,23,42,0.35);
    font-size: 13px;
    color: #111827;
}
.loading-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    animation: reSpin 0.6s linear infinite;
}
@keyframes reSpin {
    to { transform: rotate(360deg); }
}

/* ====== PAGE HEADER ====== */
.re-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.re-page-title-wrap {
    max-width: 720px;
}
.re-breadcrumb {
    font-size: 12px;
    color: #6b7280;
}
.re-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}
.re-breadcrumb a:hover {
    text-decoration: underline;
}
.re-breadcrumb-sep {
    margin: 0 4px;
}
.re-page-title {
    margin: 6px 0 0;
    font-size: 26px;
    font-weight: 700;
    color: #111827;
}

.re-page-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 6px 16px rgba(15,23,42,0.10);
    backdrop-filter: blur(10px);
}
.re-summary-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
}

/* ====== LAYOUT ====== */
.re-layout {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

/* ====== FILTERS (SIDEBAR) ====== */
.re-filters-wrapper {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    align-self: flex-start;
}

/* mobile/desktop toggle bar */
.re-filter-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.45);
    background: linear-gradient(120deg, rgba(15,23,42,0.97), rgba(15,23,42,0.88));
    color: #e5e7eb;
    font-size: 13px;
    margin-bottom: 10px;
    cursor: pointer;
    box-shadow:
        0 10px 30px rgba(15,23,42,0.55),
        0 0 0 1px rgba(15,23,42,0.6);
}
.re-filter-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.re-filter-toggle-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: radial-gradient(circle at 0 0, #22c55e, #15803d);
    display: flex;
    align-items: center;
    justify-content: center;
}
.re-filter-toggle-icon span {
    display: block;
    width: 11px;
    height: 2px;
    border-radius: 999px;
    background: #ecfdf5;
    margin: 1px 0;
}
.re-filter-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.re-filter-toggle-title {
    font-weight: 600;
}
.re-filter-toggle-sub {
    font-size: 11px;
    color: #9ca3af;
}
.re-filter-toggle-pill {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.8);
}

/* Active state */
.re-filter-toggle.is-open {
    background: linear-gradient(120deg, rgba(30,64,175,0.98), rgba(37,99,235,0.96));
    box-shadow:
        0 10px 32px rgba(30,64,175,0.7),
        0 0 0 1px rgba(129,140,248,0.6);
}

/* Filter card look */
.re-filter-card {
    background: radial-gradient(circle at 0 0, rgba(59,130,246,0.12), transparent 65%),
                radial-gradient(circle at 100% 0, rgba(16,185,129,0.14), transparent 55%),
                rgba(248,250,252,0.96);
    border-radius: 22px;
    padding: 14px 14px 16px;
    box-shadow:
        0 20px 40px rgba(15,23,42,0.16),
        0 0 0 1px rgba(148,163,184,0.25);
    border: 1px solid rgba(226,232,240,0.95);
    position: relative;
    overflow: hidden;
}
.re-filter-card::before {
    content: "";
    position: absolute;
    inset: -80px;
    background:
        radial-gradient(circle at 10% 0%, rgba(59,130,246,0.18), transparent 55%),
        radial-gradient(circle at 70% 0%, rgba(14,165,233,0.14), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
}
.re-filter-card > * {
    position: relative;
}

/* header row */
.re-filter-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.re-filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.re-filter-title-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: radial-gradient(circle, #22c55e, #15803d);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
}

.re-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.re-filter-badge {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
}
.re-filter-badge-all {
    background: #ecfdf5;
    color: #16a34a;
}
.re-filter-all-link {
    font-size: 11px;
    color: #6b7280;
    text-decoration: none;
}
.re-filter-all-link:hover {
    text-decoration: underline;
}

/* quick chips */
.re-filter-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.re-chip-quick {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid rgba(148,163,184,0.6);
    background: rgba(255,255,255,0.8);
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.re-chip-quick::before {
    content: "⚡";
    font-size: 11px;
}
.re-chip-quick.is-active {
    border-color: #2563eb;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #f9fafb;
}

/* form */
.re-filter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.re-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.re-filter-label {
    font-size: 11px;
    color: #6b7280;
}

/* Search group with icon */
.re-filter-search-group {
    position: relative;
}
.re-filter-search-group::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-2px);
    font-size: 13px;
    opacity: 0.55;
}
.re-filter-search-group .re-filter-input {
    padding-left: 32px;
}

.re-filter-input,
.re-filter-select {
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 7px 11px;
    font-size: 13px;
    outline: none;
    background: #f9fafb;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
    width: 100%;
}
.re-filter-input:focus,
.re-filter-select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.25);
}
.re-filter-row-2col {
    display: flex;
    gap: 8px;
}
.re-filter-row-2col .re-filter-group {
    flex: 1;
}

/* actions */
.re-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.re-btn-filter {
    flex: 1;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: center;
}
.re-btn-apply {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #ffffff;
}
.re-btn-apply:hover {
    filter: brightness(1.05);
}
.re-btn-reset {
    background: #ffffff;
    color: #4b5563;
    border-color: #e5e7eb;
}
.re-btn-reset:hover {
    background: #f9fafb;
}

/* ====== LISTING SECTION ====== */
.re-listing-section {
    flex: 1;
}

/* ====== GRID + CARD ====== */
.re-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.re-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 16px 35px rgba(15,23,42,0.10);
    border: 1px solid rgba(226,232,240,0.9);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}
.re-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(59,130,246,0.08), transparent 55%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.re-card.is-hidden {
    display: none;
}
.re-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 22px 45px rgba(15,23,42,0.20);
    border-color: rgba(148,163,184,0.9);
    background: linear-gradient(180deg, #ffffff, #f9fafb);
}
.re-card:hover::before {
    opacity: 1;
}

/* ====== POPULAR RIBBON ====== */
.re-card-ribbon {
    position: absolute;
    top: 10px;
    right: -48px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #f97316, #fb7185);
    padding: 6px 48px;
    z-index: 5;
    box-shadow: 0 8px 18px rgba(248,113,113,0.55);
}
.re-card-ribbon span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #f9fafb;
}

/* ====== CARD MEDIA + SLIDER ====== */
.re-card-media {
    position: relative;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    background: #e5e7eb;
    aspect-ratio: 4 / 3;
}

.re-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.re-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6b7280;
}

/* slider wrapper */
.re-card-slider {
    position: relative;
    width: 100%;
    height: 100%;
}
.re-card-slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.28s ease;
}
.re-card-slide {
    min-width: 100%;
    height: 100%;
}
.re-card-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* nav buttons */
.re-card-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: none;
    background: rgba(15,23,42,0.55);
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}
.re-card-slider-prev {
    left: 8px;
}
.re-card-slider-next {
    right: 8px;
}
.re-card-slider-nav:hover {
    background: rgba(15,23,42,0.8);
}

/* dots */
.re-card-slider-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 4px;
}
.re-card-slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    border: none;
    background: rgba(243,244,246,0.7);
    cursor: pointer;
}
.re-card-slider-dot.is-active {
    width: 14px;
    background: #2563eb;
}

/* ====== MEDIA TOP (location pill) ====== */
.re-card-media-top {
    position: absolute;
    inset: 10px 10px auto 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}
.re-location-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    background: rgba(17,24,39,0.78);
    color: #f9fafb;
    padding: 3px 8px;
    font-size: 11px;
}
.re-location-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
}

/* ====== CARD BODY ====== */
.re-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.re-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.re-card-title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}
.re-card-title a {
    color: inherit;
    text-decoration: none;
}
.re-card-title a:hover {
    text-decoration: underline;
}
.re-card-location {
    font-size: 12px;
    color: #6b7280;
}

/* meta row */
.re-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.re-meta-pill {
    border-radius: 999px;
    padding: 2px 8px;
    background: #f3f4f6;
    font-size: 11px;
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.re-meta-label {
    color: #9ca3af;
}

/* price */
.re-card-price {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 4px;
}
.re-card-price strong {
    font-size: 16px;
    color: #111827;
}
.re-card-price span {
    font-size: 11px;
    color: #6b7280;
}

/* footer */
.re-card-footer {
    margin-top: 6px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}
.re-portal-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.re-portal-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.re-portal-chip {
    border-radius: 999px;
    font-size: 11px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    border: 1px solid transparent;
}
.re-portal-chip-icon {
    font-size: 11px;
}
.re-portal-bayut {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}
.re-portal-dubizzle {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.re-portal-other {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* contact buttons */
.re-contact-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.re-btn-wa,
.re-btn-video {
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border: 1px solid transparent;
}

/* WhatsApp strong */
.re-btn-wa {
    background: #22c55e;
    color: #ecfdf5;
    border-color: #16a34a;
}
.re-btn-wa:hover {
    filter: brightness(1.03);
}

/* Request video light gradient */
.re-btn-video {
    background: linear-gradient(90deg, #fee2e2, #ffedd5);
    color: #7c2d12;
    border-color: #fecaca;
}
.re-btn-video:hover {
    filter: brightness(1.03);
}

.re-btn-icon {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: rgba(15,23,42,0.1);
}

/* date badge */
.re-card-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
}
.re-status-badge {
    padding: 2px 6px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
}

/* empty state */
.re-empty {
    margin-top: 30px;
    padding: 20px;
    border-radius: 18px;
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    font-size: 13px;
    color: #4b5563;
}

/* load more */
.re-load-more-wrap {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}
.re-btn-load-more {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    padding: 8px 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.re-btn-load-more:hover {
    background: #f9fafb;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    .re-layout {
        flex-direction: column;
    }
    .re-filters-wrapper {
        width: 100%;
        position: static;
    }
    .re-filter-toggle {
        display: flex;
    }
    .re-filter-card {
        margin-top: 4px;
        display: none;
    }
    .re-filter-card.is-open {
        display: block;
    }

    .re-page {
        padding-inline: 14px;
    }
}

/* Mobile-specific */
@media (max-width: 640px) {
    /* Header: breadcrumb left, summary right */
    .re-page-header {
        position: relative;
        align-items: flex-start;
    }
    .re-page-title-wrap {
        width: 100%;
    }
    .re-page-summary {
        position: absolute;
        right: 0;
        top: 0;
        transform: scale(0.9);
        transform-origin: top right;
        font-size: 11px;
        padding: 4px 8px;
    }
    .re-page-title {
        margin-top: 18px;
        font-size: 22px;
    }

    /* Filters rows stack full width */
    .re-filter-row-2col {
        flex-direction: column;
    }

    .re-card-body {
        padding: 10px 10px 12px;
    }
    .re-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .re-contact-wrap {
        width: 100%;
    }
    .re-btn-wa,
    .re-btn-video {
        flex: 1;
        justify-content: center;
    }
}

/* ========= MOBILE HEADER + FILTER FIXES ========= */
@media (max-width: 640px) {

  /* 1) Hide "All properties" heading on mobile */
  .re-page-title {
      display: none !important;
  }

  /* 2) Make mobile filter toggle LIGHT instead of dark */
  .re-filter-toggle {
      background: linear-gradient(145deg, #ffffff, #f3f4f6) !important;
      border: 1px solid #e5e7eb !important;
      box-shadow: 0 6px 18px rgba(15,23,42,0.10) !important;
      color: #111827 !important;
  }

  .re-filter-toggle-sub {
      color: #6b7280 !important;
  }

  .re-filter-toggle-pill {
      background: #f8fafc !important;
      border: 1px solid #e5e7eb !important;
      color: #334155 !important;
  }

  /* 3) Make filter icon professional (no childish dots) */
  .re-filter-toggle-icon {
      background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
      box-shadow: 0 4px 12px rgba(37,99,235,0.35) !important;
  }

  .re-filter-toggle-icon span {
      background: #ffffff !important;
      width: 14px;
      height: 2px;
      border-radius: 10px;
  }

  /* Remove previous dark glow when open */
  .re-filter-toggle.is-open {
      background: linear-gradient(145deg, #ffffff, #eef2ff) !important;
      box-shadow: 
        0 10px 20px rgba(37,99,235,0.18),
        0 0 0 1px #c7d2fe !important;
  }

  /* Light filter panel background on mobile */
  .re-filter-card {
      background: linear-gradient(160deg, #ffffff, #f8fafc) !important;
      box-shadow: 0 14px 40px rgba(15,23,42,0.12) !important;
      border: 1px solid #e5e7eb !important;
  }

  /* Reduce top padding now that title is removed */
  .re-page-header {
      margin-bottom: 8px !important;
  }
}
