/* =========================================
   GRID LAYOUT & TILES
   ========================================= */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: #fff;
  padding-bottom: 20px;
}

/* Mobile: 3 */
.grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Tablet: 4 */
@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop: 5 */
@media (min-width: 1100px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.tile {
  display: block;
  background: #efefef;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  border: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tile.sold {
  filter: grayscale(1);
  opacity: 0.45;
  cursor: default;
}

.tile.sold::after {
  content: "SOLD";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.35);
}

/* ===== Tile Meta & Countdown ===== */
.tile-meta {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  line-height: 1.05;
  letter-spacing: 0.2px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-meta .brand {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.tile-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  flex: 0 0 auto;
}

.tile-meta .off {
  color: #ff0000;
  font-weight: 700;
  flex: 0 0 auto;
}

.tile-meta .tag-mini {
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.2px;
  flex: 0 0 auto;
}

/* Safety: never show SALE / TIME LIMITED mini tags on grid tiles */
.tile-meta .tag-mini {
  display: none !important;
}

.countdown-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.3px;
  line-height: 1.05;
  color: #fff;
  background: rgba(255, 59, 48, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

.countdown-pill.soon {
  background: rgba(255, 149, 0, 0.88);
}

.countdown-pill.urgent {
  background: rgba(255, 59, 48, 0.92);
}

#status {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
}