/* Accessible "screen-reader only" utility */
.listings__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.listings__header {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.listings__table-wrap {
  padding: 0; /* table should look like it belongs to the card */
  overflow-x: auto;
}

.listings__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px; /* keeps columns usable; wrapper scrolls on small screens */
}

.listings__table thead th {
  text-align: left;
  padding: 1rem 1rem .75rem;
  font-weight: 650;
  color: #111;
  border-bottom: 1px solid #e9e9e9;
  background: #fff;
}

.listings__cell {
  padding: 1rem;
  border-bottom: 1px solid #e9e9e9;
  vertical-align: middle;
}

.listings__row:last-child .listings__cell {
  border-bottom: 0;
}

/* Column sizing */
.listings__col-thumb { width: 190px; }
.listings__col-address { width: 170px; }
.listings__col-action { width: 70px; }
.listings__col-price { width: 110px; }

/* Thumbnail */
.listings__thumb {
  width: 160px;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f3f3f3;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.06);
}

.listings__row-link {
  display: inline-block;
  width: 100%;
}

/* Address + description */
.listings__address {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.listings__desc {
  margin: 0;
  color: #555;
  line-height: 1.55;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Price */
.listings__price {
  font-weight: 650;
  font-size: 1.05rem;
}

/* Reduced price styles */
.listings__price--old {
  color: #c62828;        /* red */
  text-decoration: line-through;
  font-weight: 650;
  font-size: .98rem;
  line-height: 1.2;
}

.listings__price--new {
  color: #111;           /* regular black */
  font-weight: 650;
  font-size: 1.05rem;
  line-height: 1.25;
}

.listings__price--reduced {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}


/* Details arrow */
.listings__details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #e9e9e9;
  background: #fff;
  transition: transform 120ms ease, border-color 120ms ease;
}

.listings__row-link:focus-visible,
.listings__details:focus-visible {
  outline: 3px solid rgba(230, 39, 39, .35);
  outline-offset: 2px;
}

.listings__details:hover {
  transform: translateX(2px);
  border-color: #cfcfcf;
}

/* Small screens: show as "stacked cards" per row */
@media (max-width: 860px) {
  .listings__table {
    min-width: 0;
  }

  .listings__table thead {
    display: none;
  }

  .listings__table,
  .listings__table tbody,
  .listings__table tr,
  .listings__table td {
    display: block;
    width: 100%;
  }

  .listings__cell {
    border-bottom: 0;
    padding: .75rem 1rem;
  }

  .listings__row {
    border-bottom: 1px solid #e9e9e9;
    padding: .5rem 0;
    position: relative;
  }

  .listings__cell--thumb {
    padding-top: 1rem;
  }

  .listings__thumb {
    width: 100%;
    max-width: 320px;
  }

  .listings__cell--action {
    padding-bottom: 1rem;
  }

  .listings__details {
    width: 100%;
    justify-content: flex-end;
  }
}

/* SOLD stamp overlay on description column (on top) */
.listings__cell--desc {
  position: relative;
}

.listings__row.is-sold .listings__cell--desc::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../images/assets/sold.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 40% auto;
  pointer-events: none;
  opacity: 80%;
  z-index: 10;
}

/* keep the text above the background stamp if needed */
.listings__row.is-sold .listings__desc {
  position: relative;
  z-index: 11;
}
