* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: system-ui, sans-serif;
  background: #111827;
  color: white;
}

.wrap {
  width: min(1100px, 92vw);
}

h1 {
  text-align: center;
  margin-bottom: 2rem;
}

code {
  color: #93c5fd;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  overflow: hidden;
  border: 3px solid #374151;
  border-radius: 1rem;
  background: #1f2937;
  box-shadow: 0 20px 40px rgb(0 0 0 / 0.25);
}

.card::before {
  content: attr(data-status);
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: white;
  color: #111827;
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.content {
  padding: 1.25rem;
}

.content h2 {
  margin: 0 0 0.5rem;
}

.content p {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

button {
  border: 0;
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

/* State styles */
.card[data-status="new"] {
  border-color: #22d3ee;
}

.card[data-status="new"]::before {
  background: #22d3ee;
}

.card[data-status="sale"] {
  border-color: #22c55e;
}

.card[data-status="sale"]::before {
  background: #22c55e;
}

.card[data-status="unavailable"] {
  border-color: #ef4444;
  opacity: 0.65;
}

.card[data-status="unavailable"]::before {
  background: #ef4444;
  color: white;
}

.card[data-status="unavailable"] img {
  filter: grayscale(1);
}

.card[data-status="unavailable"] button {
  cursor: not-allowed;
}