/* ===== LISTINGS GRID ===== */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem; /* even spacing between cards */
  margin: 2rem 0;
}

/* ===== ADVERTISING ===== */
#ad_lb,
#ad_mlb {
  justify-self: center;
  margin-bottom: 10px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  margin: 1rem 0;
}
.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--grey);
  border-radius: 12px;
  font-size: 1rem;
}
.search-bar i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue);
}

/*===== FILTERS =====*/
.filters-panel {
  background-color: var(--grey);
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 1rem;
  max-width: fit-content;
}
.filters-panel select,
.filters-panel input {
  background-color: white;
  border-radius: 6px;
  border: 1px solid var(--blue);
  padding: 4px;
}
.filters-panel select,
.filters-panel input,
.filters-panel button,
.filters-panel label {
  margin: 4px;
}

/* ===== LISTING CARD ===== */
.listing-card {
  background: white;
  border: 1px solid var(--grey);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition:
    transform 0.4s,
    box-shadow 0.4s;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* ===== CARD IMAGE ===== */
.card-image {
  width: 100%;
  aspect-ratio: 16 / 9; /* consistent image area */
  object-fit: cover;
  background: #f5f5f5;
}

/* ===== CARD CONTENT ===== */
.card-content {
  padding: 1rem;
  flex: 1; /* pushes the button to the bottom */
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.card-price {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--blue);
  margin: 0.5rem 0;
}

.card-condition {
  font-size: 0.85rem;
  color: #666;
  margin: 0.25rem 0;
}

.card-delivery {
  font-size: 0.85rem;
  color: #666;
  margin: 0.25rem 0;
}

.card-btn {
  display: inline-block;
  align-self: center;
}

/* Condition text styling – no background, just colored text */
.card-condition {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0.5rem 0;
}

/*====RESPONSIVE====*/
@media (max-width: 768px) {
  #ad_lb {
    display: none;
  }
}
@media (min-width: 769px) {
  #ad_mlb {
    display: none;
  }
}
