.gpa-wrap {
  width: 100%;
  max-width: 1320px;
  margin: 40px auto;
  padding: 0 18px;
  position: relative;
  box-sizing: border-box;
}

.gpa-wrap *,
.gpa-wrap *::before,
.gpa-wrap *::after {
  box-sizing: border-box;
}

.gpa-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}

.gpa-head h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
}

.gpa-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-weight: 600;
}

.gpa-search {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.gpa-search input,
.gpa-search select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  outline: none;
}

.gpa-search input:focus,
.gpa-search select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.gpa-search button,
.gpa-reset {
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.gpa-search button:hover,
.gpa-reset:hover {
  color: #fff;
  transform: translateY(-1px);
}

.gpa-reset {
  background: #0f172a;
}

.gpa-advanced-toggle {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.gpa-check {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  font-weight: 900;
}

.gpa-check input {
  width: auto;
  height: auto;
  margin: 0;
}

.gpa-search.manual-collapsed input[name="district"],
.gpa-search.manual-collapsed input[name="min_area"],
.gpa-search.manual-collapsed input[name="max_area"],
.gpa-search.manual-collapsed input[name="rooms"],
.gpa-search.manual-collapsed select[name="sort"],
.gpa-search.manual-collapsed .gpa-check {
  display: none;
}

.gpa-autocomplete {
  position: relative;
}

.gpa-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 9999;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.gpa-suggestions.active {
  display: block;
}

.gpa-suggestions button {
  width: 100%;
  min-height: 42px;
  padding: 11px 14px;
  border: 0;
  border-radius: 0;
  justify-content: flex-start;
  background: #fff;
  color: #0f172a;
  text-align: left;
  font-weight: 800;
}

.gpa-suggestions button:hover,
.gpa-suggestions button.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  transform: none;
}

.gpa-mobile-filter-btn {
  display: none;
}

.gpa-archive-content {
  position: relative;
}

.gpa-wrap.is-loading .gpa-archive-content {
  opacity: 0.45;
  pointer-events: none;
}

.gpa-wrap.is-loading::after {
  content: "იტვირთება...";
  position: absolute;
  top: 220px;
  left: 50%;
  z-index: 50;
  padding: 12px 18px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
}

.gpa-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 22px;
}

.gpa-active-filters a {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  text-decoration: none;
}

.gpa-active-filters a:hover {
  background: #2563eb;
  color: #fff;
}

.gpa-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  font-weight: 800;
}

.gpa-results-bar strong {
  color: #2563eb;
}

.gpa-results-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gpa-results-sort select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
  font-weight: 800;
}

.gpa-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
}

.gpa-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e7eaf0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gpa-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.gpa-image {
  position: relative;
  display: block;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: #eef2f7;
  color: #94a3b8;
  text-decoration: none;
}

.gpa-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

.gpa-image img,
.gpa-image > span {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gpa-image > span {
  display: grid;
  place-items: center;
  font-size: 44px;
}

.gpa-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.gpa-badges em {
  padding: 7px 10px;
  border-radius: 999px;
  display: inline-flex;
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.gpa-badges .deal { background: rgba(22, 163, 74, 0.92); }
.gpa-badges .vip { background: rgba(245, 158, 11, 0.95); }
.gpa-badges .boost { background: rgba(37, 99, 235, 0.95); }

.gpa-price {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 3;
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 950;
}

.gpa-card-actions {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  gap: 7px;
}

.gpa-card-actions a,
.gpa-card-actions button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  cursor: pointer;
}

.gpa-body {
  padding: 17px;
}

.gpa-title {
  display: block;
  margin: 0 0 9px;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 900;
  text-decoration: none;
}

.gpa-title:hover {
  color: #2563eb;
}

.gpa-location {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.gpa-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
}

.gpa-meta span {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.gpa-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}

.gpa-type {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.gpa-view {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2b5f9e;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.gpa-view:hover {
  background: #2563eb;
  color: #fff;
}

.gpa-card-footer {
  padding: 12px 17px;
  border-top: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6b7280;
  font-size: 12px;
}

.gpa-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gpa-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.gpa-empty {
  grid-column: 1 / -1;
  padding: 40px;
  border: 1px dashed #cbd5e1;
  border-radius: 22px;
  background: #fff;
  color: #64748b;
  text-align: center;
  font-weight: 800;
}

.gpa-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.gpa-pagination .page-numbers {
  min-width: 40px;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #0f172a;
  font-weight: 900;
  text-decoration: none;
}

.gpa-pagination .page-numbers.current,
.gpa-pagination .page-numbers:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

@media (max-width: 1200px) {
  .gpa-search {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gpa-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .gpa-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .gpa-wrap {
    margin: 24px auto;
    padding: 0 14px;
  }

  .gpa-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .gpa-head h2 {
    font-size: 26px;
  }

  .gpa-mobile-filter-btn {
    display: flex;
    width: 100%;
    height: 46px;
    margin-bottom: 14px;
    border: 0;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    font-weight: 900;
  }

  .gpa-search {
    display: none;
    grid-template-columns: 1fr;
    padding: 14px;
    border-radius: 18px;
  }

  .gpa-search.mobile-open {
    display: grid;
  }

  .gpa-search.is-collapsed input[name="district"],
  .gpa-search.is-collapsed input[name="min_area"],
  .gpa-search.is-collapsed input[name="max_area"],
  .gpa-search.is-collapsed input[name="rooms"],
  .gpa-search.is-collapsed .gpa-check {
    display: none;
  }

  .gpa-results-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .gpa-results-sort {
    justify-content: space-between;
  }

  .gpa-grid {
    grid-template-columns: 1fr;
  }

  .gpa-image {
    height: 235px;
  }
}


/* New unified GenieHome property card */

.gpa-grid {
    align-items: stretch;
}

.gpa-grid .gh-property-card {
    width: 100%;
    height: 100%;
}

.gpa-grid .gh-property-card .gpa-body {
    display: block;
}

.gpa-grid .gh-property-card .gh-card-image {
    width: calc(100% - 18px);
}
/* =========================================================
   ARCHIVE GRID — unified property card V2
========================================================= */
.gpa-wrap {
  max-width: 1520px;
}

.gpa-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.gpa-grid > .ghp-card {
  width: 100% !important;
  max-width: none !important;
}

@media (max-width: 1180px) {
  .gpa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .gpa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .gpa-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* =========================================================
   FINAL ARCHIVE LAYOUT / TOUCH STABILITY — 2026-07
========================================================= */
.gpa-wrap { width: 100%; max-width: 1520px; }
.gpa-search, .gpa-search * { box-sizing: border-box; }
.gpa-search button, .gpa-search select, .gpa-search input { touch-action: manipulation; }
.gpa-grid {
  width: 100%;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 22px !important;
  align-items: stretch !important;
}
.gpa-grid > .ghp-card { width: 100% !important; min-width: 0 !important; max-width: none !important; height: 100%; }
.gpa-grid .ghp-media { aspect-ratio: 4 / 3; height: auto !important; }
.gpa-grid .ghp-image, .gpa-grid .ghp-image img { width: 100%; height: 100%; }
.gpa-grid .ghp-image img { object-fit: cover; }

@media (max-width: 1180px) { .gpa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 860px) { .gpa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 680px) {
  .gpa-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .gpa-search.mobile-open {
    position: fixed;
    z-index: 1000000;
    inset: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    display: grid !important;
    align-content: start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 80px rgba(15,23,42,.35);
  }
}
html.gpa-filter-open, body.gpa-filter-open { overflow: hidden !important; overscroll-behavior: none; }
