/* Wrapper */
.chm-nearby {
  width: 100%;
}

.chm-nearby__status {
  margin-bottom: 1rem;
  font-weight: 500;
}

.chm-nearby__none {
  opacity: 0.8;
}

/* Grid: 4 desktop, 2 tablet, 1 mobile */
.chm-nearby__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  justify-content: center;
}

/* Card flat; text white always */
.chm-card {
  position: relative;
  display: block;
  width: 100%;
  height: 361px;
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: #000;
}

.chm-card:link,
.chm-card:visited,
.chm-card:hover,
.chm-card:active {
  color: #fff;
}

.chm-card .chm-card__overlay,
.chm-card .chm-card__overlay *:not(.chm-card__btn) {
  color: #fff !important;
}

/* Image */
.chm-card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.chm-card__media img {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.chm-card:hover .chm-card__media img {
  transform: scale(1.03);
}

/* Overlay */
.chm-card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* Typography */
.chm-card__topline {
  font-size: 12px !important;
}

.chm-card__price {
  font-size: 14px !important;
}

.chm-card__title {
  font-size: 1.2rem !important;
  font-family: var(--h1-font-family) !important;
  font-weight: 400 !important;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

/* Footer */
.chm-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.chm-card__km {
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.95;
}

.chm-card__btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  background: #ffffff;
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.chm-card__btn:hover {
  filter: brightness(0.9);
}

/* Large tablet */
@media (max-width: 1200px) {
  .chm-nearby__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablet */
@media (max-width: 992px) {
  .chm-nearby__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chm-card {
    height: 320px;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .chm-nearby__grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }

  .chm-card {
    height: 300px;
  }

  .chm-card__overlay {
    padding: 14px;
  }

  .chm-card__title {
    font-size: 1.05rem !important;
    line-height: 1.2;
  }

  .chm-card__topline {
    font-size: 11px !important;
  }

  .chm-card__price {
    font-size: 13px !important;
  }

  .chm-card__footer {
    gap: 8px;
  }

  .chm-card__km {
    font-size: 0.9rem;
  }

  .chm-card__btn {
    padding: 7px 10px;
    font-size: 0.85rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .chm-card {
    height: 280px;
  }

  .chm-card__overlay {
    padding: 12px;
  }

  .chm-card__title {
    font-size: 1rem !important;
  }

  .chm-card__topline {
    font-size: 10px !important;
  }

  .chm-card__price {
    font-size: 12px !important;
  }

  .chm-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .chm-card__btn {
    width: 100%;
    text-align: center;
  }
}