/* ============================================================
       CSS صفحة العقارات (نفس الكود السابق)
       ============================================================ */

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    :root {
      --silver: #c0c0c0;
      --silver-light: #ececec;
      --silver-dark: #8e8e8e;
      --bg: #f6f3ef;
      --bg2: #ece7df;
      --surface: #ffffff;
      --surface2: #f5f1ea;
      --text: #1d1b18;
      --text2: #6d675f;
      --line: rgba(0, 0, 0, 0.06);
      --glass: rgba(255, 255, 255, 0.7);
      --shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
      --font-title: 'El Messiri', serif;
      --font-body: 'Tajawal', sans-serif;
      --radius: 8px;
      --transition: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    }

    [data-theme="dark"] {
      --bg: #121110;
      --bg2: #181715;
      --surface: #1d1c1a;
      --surface2: #252321;
      --text: #f3efe8;
      --text2: #aea89f;
      --line: rgba(255, 255, 255, 0.06);
      --glass: rgba(20, 20, 20, 0.7);
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      font-family: var(--font-body);
      background: var(--bg);
      color: var(--text);
      overflow-x: hidden;
      direction: rtl;
      transition: 0.5s;
      line-height: 1.7;
    }

    img {
      display: block;
      max-width: 100%;
      border-radius: var(--radius);
    }
    a {
      color: inherit;
      text-decoration: none;
    }
    ul {
      list-style: none;
    }
    button {
      border: none;
      background: none;
      cursor: pointer;
      font-family: inherit;
    }

    .container {
      width: min(1360px, 92%);
      margin: auto;
    }

    /* ============================================================
       شاشة التحميل
       ============================================================ */
    .loader {
      position: fixed;
      inset: 0;
      background: var(--bg);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 99999;
      transition: 0.8s var(--transition);
      gap: 28px;
    }
    .loader.hide {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
    .loader-logo {
      width: 180px;
      height: 180px;
      border-radius: 50%;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
      border: 2px solid var(--silver-light);
      animation: loaderPulse 1.8s ease-in-out infinite;
    }
    .loader-logo img {
      width: 72%;
    }
    @keyframes loaderPulse {
      0%,
      100% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.04);
        box-shadow: 0 25px 60px rgba(192, 192, 192, 0.2);
      }
    }
    .loader-bar-wrap {
      width: 220px;
      height: 3px;
      background: rgba(192, 192, 192, 0.15);
      border-radius: 10px;
      overflow: hidden;
      position: relative;
    }
    .loader-bar {
      position: absolute;
      right: 0;
      top: 0;
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--silver-light), var(--silver), var(--silver-light));
      border-radius: 10px;
      animation: loadBar 1.6s ease-in-out infinite;
    }
    @keyframes loadBar {
      0% {
        width: 0%;
        right: 0;
        left: auto;
      }
      50% {
        width: 70%;
        right: 0;
        left: auto;
      }
      100% {
        width: 0%;
        right: 100%;
        left: auto;
      }
    }
    .loader-text {
      font-size: 15px;
      letter-spacing: 2px;
      color: var(--text2);
      font-weight: 500;
      font-family: var(--font-title);
      margin-top: 6px;
      opacity: 0.8;
    }

    /* ============================================================
       الناف بار
       ============================================================ */
    .navbar {
      position: fixed;
      inset: 0 0 auto 0;
      height: 80px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-inline: 5vw;
      z-index: 999;
      transition: 0.5s var(--transition);
      transform: translateY(-100%);
      opacity: 0;
    }
    .navbar.show {
      transform: translateY(0);
      opacity: 1;
    }
    .navbar.solid {
      backdrop-filter: blur(18px);
      background: var(--glass);
      border-bottom: 1px solid var(--line);
    }

    .nav-logo {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .nav-logo-badge {
      width: 70px;
      height: 70px;
      border-radius: 50%;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      border: 2px solid var(--silver-light);
      flex-shrink: 0;
    }
    .nav-logo-badge img {
      width: 72%;
    }
    .nav-logo-text {
      font-size: 24px;
      font-family: var(--font-title);
      background: linear-gradient(120deg, #999, #ddd, #999);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      font-weight: 700;
    }

    .nav-links {
      display: flex;
      align-items: center;
      gap: 28px;
    }
    .nav-links li {
      position: relative;
    }
    .nav-links a {
      font-size: 14px;
      color: var(--text2);
      transition: 0.35s;
      font-weight: 500;
      padding: 6px 0;
      position: relative;
    }
    .nav-links a::after {
      content: "";
      position: absolute;
      right: 0;
      bottom: -4px;
      width: 0;
      height: 2px;
      background: var(--silver);
      transition: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .nav-links a:hover {
      color: var(--silver);
    }
    .nav-links a:hover::after {
      width: 100%;
    }
    .nav-links a.active {
      color: var(--text2);
    }
    .nav-links a.active::after {
      width: 100%;
      background: var(--silver);
      animation: activeSlide 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes activeSlide {
      0% {
        width: 0;
        right: 50%;
      }
      50% {
        width: 100%;
        right: 0;
      }
      100% {
        width: 100%;
        right: 0;
      }
    }

    .nav-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .theme-toggle {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      border: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: 0.35s;
      font-size: 17px;
      color: var(--text2);
    }
    .theme-toggle:hover {
      background: var(--silver);
      color: #fff;
    }
    .nav-cta {
      padding: 10px 24px;
      border: 1.5px solid var(--silver);
      border-radius: var(--radius);
      color: var(--silver);
      font-weight: 700;
      transition: 0.35s;
      font-size: 13px;
    }
    .nav-cta:hover {
      background: var(--silver);
      color: #fff;
    }
    .nav-burger {
      display: none;
      width: 40px;
      height: 40px;
      border-radius: var(--radius);
      background: var(--silver);
      color: #fff;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      transition: 0.3s;
    }
    .nav-burger:hover {
      background: var(--silver-dark);
    }
    .nav-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.35);
      backdrop-filter: blur(3px);
      opacity: 0;
      visibility: hidden;
      transition: 0.4s;
      z-index: 998;
    }
    .nav-overlay.active {
      opacity: 1;
      visibility: visible;
    }
    .close-menu {
      display: none;
      font-size: 24px;
      color: var(--text2);
      padding: 8px 0 20px 0;
      width: 100%;
      text-align: right;
      transition: 0.3s;
    }
    .close-menu:hover {
      color: var(--text);
    }

    @media (max-width: 992px) {
      .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 310px;
        max-width: 84%;
        height: 100vh;
        background: var(--glass);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid var(--line);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 32px 40px;
        gap: 0;
        transition: 0.5s var(--transition);
        z-index: 999;
        overflow-y: auto;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.06);
      }
      .nav-links.active {
        right: 0;
      }
      .nav-links li {
        width: 100%;
      }
      .nav-links a {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 16px 0;
        font-size: 17px;
        border-bottom: 1px solid var(--line);
        font-weight: 500;
        color: var(--text2);
        transition: 0.3s;
        gap: 6px;
      }
      .nav-links a:hover {
        color: var(--text);
        padding-right: 6px;
      }
      .nav-links a::after {
        display: none;
      }
      .nav-links a i {
        margin-left: 14px;
        width: 28px;
        font-size: 18px;
        color: #6d675f;
        transition: 0.3s;
      }
      .nav-links a:hover i {
        color: #1d1b18;
      }
      .nav-links a.active {
        color: var(--text);
        font-weight: 600;
      }
      .nav-links a.active i {
        color: #1d1b18;
      }
      .close-menu {
        display: block;
      }
      .nav-cta {
        display: none;
      }
      .nav-burger {
        display: flex;
      }
      .nav-logo-text {
        font-size: 18px;
      }
      .nav-logo-badge {
        width: 58px;
        height: 58px;
      }
    }

    @media (max-width: 480px) {
      .navbar {
        height: 68px;
        padding-inline: 4vw;
      }
      .nav-logo-badge {
        width: 52px;
        height: 52px;
      }
      .nav-logo-text {
        font-size: 16px;
      }
      .nav-links {
        padding: 22px 22px 30px;
        width: 280px;
      }
      .nav-links a {
        font-size: 15px;
        padding: 14px 0;
      }
      .nav-links a i {
        font-size: 16px;
        width: 24px;
      }
    }

    /* ============================================================
       صفحة العقارات
       ============================================================ */
    .properties-page {
      padding-top: 120px;
      padding-bottom: 100px;
      background: var(--bg);
    }

    .properties-header {
      text-align: center;
      margin-bottom: 50px;
    }
    .properties-header h1 {
      font-family: var(--font-title);
      font-size: clamp(36px, 5vw, 56px);
      margin-bottom: 12px;
    }
    .properties-header p {
      color: var(--text2);
      font-size: 17px;
      max-width: 600px;
      margin: 0 auto;
    }

    /* ===== فلتر ===== */
    .filter-section {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 30px 30px 20px;
      margin-bottom: 50px;
      box-shadow: var(--shadow);
    }
    .filter-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 18px;
      align-items: end;
    }
    .filter-group label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--text2);
      margin-bottom: 6px;
    }
    .filter-group select,
    .filter-group input {
      width: 100%;
      padding: 12px 16px;
      background: var(--bg);
      border: 1.5px solid var(--line);
      border-radius: var(--radius);
      color: var(--text);
      font-family: inherit;
      font-size: 14px;
      transition: 0.3s;
      appearance: none;
      -webkit-appearance: none;
    }
    .filter-group select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236d675f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: left 14px center;
    }
    .filter-group select:focus,
    .filter-group input:focus {
      border-color: var(--silver);
      outline: none;
    }
    .filter-btn {
      padding: 12px 32px;
      background: var(--silver);
      color: #fff;
      border-radius: var(--radius);
      font-weight: 700;
      transition: 0.35s;
      font-size: 14px;
      cursor: pointer;
      border: none;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
    }
    .filter-btn:hover {
      background: var(--silver-dark);
    }

    /* ===== شبكة العقارات ===== */
    .properties-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 30px;
    }

    .property-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      overflow: hidden;
      transition: 0.4s var(--transition);
    }
    .property-card:hover {
      transform: translateY(-8px);
      box-shadow: var(--shadow);
    }

    .property-card-image {
      position: relative;
      height: 230px;
      overflow: hidden;
      cursor: pointer;
    }
    .property-card-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.6s var(--transition);
    }
    .property-card:hover .property-card-image img {
      transform: scale(1.05);
    }

    .property-card-image .property-tag {
      position: absolute;
      top: 16px;
      right: 16px;
      background: var(--silver);
      color: #fff;
      padding: 6px 16px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
    }

    .property-card-body {
      padding: 22px 22px 26px;
    }
    .property-card-body .property-price {
      color: var(--silver);
      font-size: 26px;
      font-weight: 700;
      margin-bottom: 4px;
    }
    .property-card-body .property-title {
      font-family: var(--font-title);
      font-size: 20px;
      margin-bottom: 4px;
    }
    .property-card-body .property-location {
      color: var(--text2);
      font-size: 14px;
      margin-bottom: 14px;
    }
    .property-card-body .property-features {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      margin-bottom: 16px;
      padding-top: 14px;
      border-top: 1px solid var(--line);
    }
    .property-card-body .property-features span {
      font-size: 13px;
      color: var(--text2);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .property-card-body .property-features span i {
      color: var(--silver);
    }

    .property-card-body .property-detail-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 12px 28px;
      background: var(--silver);
      color: #fff;
      border-radius: var(--radius);
      font-weight: 600;
      transition: 0.35s;
      font-size: 14px;
      border: none;
      cursor: pointer;
    }
    .property-card-body .property-detail-btn:hover {
      background: var(--silver-dark);
      gap: 14px;
    }

    /* ===== ترقيم الصفحات ===== */
    .pagination {
      display: flex;
      justify-content: center;
      gap: 10px;
      margin-top: 50px;
      flex-wrap: wrap;
    }
    .pagination button {
      width: 44px;
      height: 44px;
      border-radius: var(--radius);
      border: 1px solid var(--line);
      background: var(--surface);
      color: var(--text2);
      font-weight: 600;
      transition: 0.3s;
      cursor: pointer;
    }
    .pagination button:hover,
    .pagination button.active {
      background: var(--silver);
      color: #fff;
      border-color: var(--silver);
    }

    /* ============================================================
       استجابة الجوال – كل 2 منتجين جنب بعض
       ============================================================ */
    @media (max-width: 600px) {
      .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
      }

      .property-card-image {
        height: 150px;
      }

      .property-card-body {
        padding: 14px 12px 18px;
      }

      .property-card-body .property-price {
        font-size: 18px;
      }

      .property-card-body .property-title {
        font-size: 15px;
      }

      .property-card-body .property-location {
        font-size: 12px;
        margin-bottom: 8px;
      }

      .property-card-body .property-features {
        gap: 10px;
        padding-top: 10px;
        margin-bottom: 12px;
      }

      .property-card-body .property-features span {
        font-size: 11px;
        gap: 4px;
      }

      .property-card-body .property-features span i {
        font-size: 11px;
      }

      .property-card-body .property-detail-btn {
        padding: 8px 14px;
        font-size: 12px;
        gap: 4px;
        width: 100%;
        justify-content: center;
      }

      .property-card-image .property-tag {
        font-size: 10px;
        padding: 4px 12px;
        top: 10px;
        right: 10px;
      }

      .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
      }

      .filter-group label {
        font-size: 12px;
      }
      .filter-group select,
      .filter-group input {
        padding: 10px 12px;
        font-size: 13px;
      }

      .filter-btn {
        height: 42px;
        font-size: 13px;
        padding: 8px 16px;
      }

      .properties-header h1 {
        font-size: 28px;
      }
      .properties-header p {
        font-size: 14px;
      }

      .pagination button {
        width: 38px;
        height: 38px;
        font-size: 14px;
      }
    }

    @media (max-width: 400px) {
      .properties-grid {
        gap: 10px;
      }
      .property-card-image {
        height: 120px;
      }
      .property-card-body .property-price {
        font-size: 15px;
      }
      .property-card-body .property-title {
        font-size: 13px;
      }
      .property-card-body .property-detail-btn {
        font-size: 10px;
        padding: 6px 10px;
      }
      .filter-grid {
        grid-template-columns: 1fr;
      }
    }

    /* ============================================================
       الفوتر
       ============================================================ */
    footer {
      background: #111;
      color: #fff;
      padding: 60px 0 30px;
    }
    .footer-grid {
      display: grid;
      grid-template-columns: 2fr 1fr 1fr;
      gap: 40px;
    }
    .footer-logo {
      font-size: 28px;
      font-family: var(--font-title);
      margin-bottom: 12px;
      background: linear-gradient(120deg, #999, #ddd, #999);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      display: inline-block;
    }
    .footer-about {
      color: #bdbdbd;
      line-height: 2;
      font-size: 14px;
    }
    .footer-links {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .footer-links a {
      color: #bdbdbd;
      transition: 0.3s;
      font-size: 14px;
    }
    .footer-links a:hover {
      color: var(--silver);
      padding-right: 6px;
    }
    .footer-bottom {
      margin-top: 50px;
      padding-top: 18px;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      text-align: center;
      color: #888;
      font-size: 13px;
    }
    @media (max-width: 992px) {
      .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
      }
    }
    @media (max-width: 768px) {
      .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
      }
    }

    /* ============================================================
       نافذة تفاصيل العقار (Modal)
       ============================================================ */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(6px);
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: 0.4s var(--transition);
      padding: 20px;
    }
    .modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    .modal-content {
      background: var(--surface);
      border-radius: var(--radius);
      max-width: 900px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      padding: 40px;
      position: relative;
      transform: scale(0.95);
      transition: 0.4s var(--transition);
    }
    .modal-overlay.active .modal-content {
      transform: scale(1);
    }

    .modal-close {
      position: sticky;
      top: 0;
      left: 100%;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--silver);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      cursor: pointer;
      transition: 0.3s;
      border: none;
      float: left;
      margin-bottom: 10px;
      z-index: 10;
    }
    .modal-close:hover {
      background: var(--silver-dark);
      transform: rotate(90deg);
    }

    .modal-gallery {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 12px;
      margin-bottom: 30px;
    }
    .modal-gallery .main-img {
      height: 350px;
      overflow: hidden;
      border-radius: var(--radius);
    }
    .modal-gallery .main-img img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .modal-gallery .thumbnails {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    .modal-gallery .thumbnails img {
      height: 167px;
      width: 100%;
      object-fit: cover;
      border-radius: var(--radius);
      cursor: pointer;
      transition: 0.3s;
    }
    .modal-gallery .thumbnails img:hover {
      opacity: 0.8;
    }

    .modal-details h2 {
      font-family: var(--font-title);
      font-size: 30px;
      margin-bottom: 6px;
    }
    .modal-details .modal-price {
      color: var(--silver);
      font-size: 28px;
      font-weight: 700;
      margin-bottom: 16px;
    }
    .modal-details .modal-location {
      color: var(--text2);
      margin-bottom: 16px;
    }
    .modal-details .modal-description {
      color: var(--text2);
      line-height: 2;
      margin-bottom: 20px;
    }
    .modal-details .modal-specs {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 12px;
      margin-bottom: 24px;
    }
    .modal-details .modal-specs .spec {
      background: var(--bg);
      padding: 14px 18px;
      border-radius: var(--radius);
      text-align: center;
    }
    .modal-details .modal-specs .spec strong {
      display: block;
      font-size: 18px;
      color: var(--text);
    }
    .modal-details .modal-specs .spec span {
      font-size: 13px;
      color: var(--text2);
    }

    .modal-contact-btn {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 14px 36px;
      background: var(--silver);
      color: #fff;
      border-radius: var(--radius);
      font-weight: 700;
      transition: 0.35s;
      border: none;
      cursor: pointer;
      font-size: 16px;
    }
    .modal-contact-btn:hover {
      background: var(--silver-dark);
      gap: 16px;
    }

    @media (max-width: 768px) {
      .modal-gallery {
        grid-template-columns: 1fr;
      }
      .modal-gallery .thumbnails {
        grid-template-columns: repeat(4, 1fr);
      }
      .modal-gallery .thumbnails img {
        height: 80px;
      }
      .modal-content {
        padding: 24px;
      }
      .modal-close {
        left: 0;
        float: none;
        margin-right: auto;
        margin-bottom: 16px;
      }
    }

    /* ===== زر العودة للأعلى ===== */
    .to-top {
      position: fixed;
      left: 24px;
      bottom: 28px;
      width: 55px;
      height: 55px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--silver);
      color: #fff;
      border-radius: 50%;
      box-shadow: var(--shadow);
      opacity: 0;
      visibility: hidden;
      transition: 0.35s;
      z-index: 999;
    }
    .to-top.show {
      opacity: 1;
      visibility: visible;
    }
    .to-top:hover {
      transform: translateY(-4px);
    }

    .cursor {
      position: fixed;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--silver);
      pointer-events: none;
      z-index: 999999;
      transform: translate(-50%, -50%);
      transition: width 0.25s, height 0.25s, background 0.25s;
      display: none;
    }
    @media (pointer: fine) {
      .cursor {
        display: block;
      }
    }
    .cursor.active {
      width: 44px;
      height: 44px;
      background: rgba(192, 192, 192, 0.15);
      backdrop-filter: blur(4px);
    }