/* ============================================================
   Catalog — Map view
   Split layout: scrollable car list (left) + sticky map (right)
   ============================================================ */

.cmap-body {
  padding: 0;
}

/* Full-width header on this page (overrides container max-width) */
.cmap-page .hd-header .gx-container,
.cmap-page .hd-header__inner {
  max-width: 100%;
}

/* Disable sticky header on this page so the map fills the viewport */
.cmap-page .hd-header,
.cmap-page .hd-header-7 {
  position: relative;
  top: auto;
}

.cmap-layout {
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 0;
  height: calc(100vh - 80px);
  min-height: 720px;
  border-top: 1px solid var(--gx-gray-light);
  border-bottom: 1px solid var(--gx-gray-light);
}

/* ===== LEFT: list ===== */
.cmap-list {
  display: flex;
  flex-direction: column;
  background: var(--gx-bg);
  border-right: 1px solid var(--gx-gray-light);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
.cmap-list::-webkit-scrollbar { width: 6px; }
.cmap-list::-webkit-scrollbar-thumb { background: var(--gx-gray-light); border-radius: 3px; }
.cmap-list::-webkit-scrollbar-thumb:hover { background: var(--gx-g300); }

.cmap-list__header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px 18px;
  background: var(--gx-bg);
  border-bottom: 1px solid var(--gx-gray-light);
}

/* Breadcrumbs */
.cmap-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--gx-g500);
  letter-spacing: 0.02em;
}
.cmap-crumbs a {
  color: var(--gx-g500);
  text-decoration: none;
  transition: color 0.15s ease;
}
.cmap-crumbs a:hover { color: var(--gx-dark); }
.cmap-crumbs__sep { color: var(--gx-g300); }
.cmap-crumbs__current { color: var(--gx-dark); font-weight: 500; }

/* Page title */
.cmap-list__title {
  margin: 0;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 45px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--gx-dark);
}
.cmap-list__desc {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--gx-g500);
  max-width: 100%;
}

/* Bottom meta row: count + sort */
.cmap-list__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--gx-gray-light);
}

.cmap-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gx-g500);
  text-transform: uppercase;
}


.cmap-cards {
  padding: 18px 20px 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: max-content;
  gap: 14px;
  align-items: start;
}

/* Standard .cat-card inside the map sidebar — make it clickable & highlight active */
.cmap-cards .cat-card {
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.cmap-cards .cat-card.is-active {
  border-color: var(--gx-lime-dark);
  box-shadow: 0 0 0 3px rgba(168, 204, 68, 0.22);
}
.cmap-cards .cat-card.is-hover {
  border-color: var(--gx-lime-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
}
/* Prevent flex from shrinking the image area to 0 inside narrower sidebar cards */
.cmap-cards .cat-card__img-wrap { flex-shrink: 0; }
.cmap-cards .cat-card__img { height: 11rem; }


/* Location chip (extra info added to the cat-card top) */
.cat-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cat-card__location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--gx-g500);
  font-family: 'Inter', sans-serif;
}
.cat-card__location svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ===== RIGHT: map ===== */
.cmap-map-wrap {
  position: relative;
  background: #11161B;
}

.cmap-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Floating search overlay on map */
.cmap-map-search {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.97);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  min-width: 320px;
}
.cmap-map-search svg { width: 16px; height: 16px; color: var(--gx-g500); flex-shrink: 0; }
.cmap-map-search input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 14px;
  background: transparent;
  font-family: inherit;
}

/* Floating "Search as I move the map" toggle */
.cmap-map-toggle {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--gx-dark);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.cmap-map-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cmap-map-toggle__track {
  position: relative;
  width: 30px;
  height: 18px;
  background: var(--gx-g300);
  border-radius: 999px;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.cmap-map-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}
.cmap-map-toggle input:checked ~ .cmap-map-toggle__track {
  background: var(--gx-lime-dark);
}
.cmap-map-toggle input:checked ~ .cmap-map-toggle__track::after {
  transform: translateX(12px);
}
.cmap-map-toggle__label {
  font-weight: 500;
}

/* InfoWindow styling for Google Maps (set inline content) */
.cmap-iw { font-family: 'Inter', sans-serif; min-width: 180px; }
.cmap-iw__name { font-weight: 600; font-size: 14px; color: var(--gx-dark); margin-bottom: 2px; }
.cmap-iw__city { font-size: 12px; color: var(--gx-g500); margin-bottom: 8px; }
.cmap-iw__price { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--gx-dark); }
.cmap-iw__link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--gx-dark); border-bottom: 1px solid var(--gx-dark); text-decoration: none; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .cmap-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .cmap-list { border-right: 0; border-bottom: 1px solid var(--gx-gray-light); }
  .cmap-cards { max-height: 60vh; }
  .cmap-map-wrap { height: 60vh; }
  .cmap-map-search { min-width: 0; width: calc(100% - 40px); max-width: 360px; }
  .cmap-map-toggle { top: 64px; font-size: 12px; padding: 7px 12px; }
}

@media (max-width: 1280px) {
  .cmap-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .cmap-cards { grid-template-columns: 1fr; }
}
