:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #667168;
  --line: #d8ded6;
  --paper: #fbfbf7;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --warn: #a16207;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(16px, 4vw, 44px) 20px;
  border-bottom: 1px solid var(--line);
  background: #f5f7f2;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.summary {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

main {
  padding: 20px clamp(16px, 4vw, 44px) 44px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 260px) minmax(150px, 220px);
  gap: 12px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.product {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.product.sold {
  opacity: 0.82;
}

.photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eef1ea;
}

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

.photo[hidden],
.photo[hidden] + .photo-fallback {
  display: grid;
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.sold-stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 78%;
  transform: translate(-50%, -50%) rotate(-13deg);
  border: 4px solid #b42318;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #b42318;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
  padding: 8px 12px;
  text-align: center;
  text-transform: uppercase;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.code,
.status {
  font-size: 12px;
  font-weight: 800;
}

.code {
  color: var(--accent-strong);
}

.status {
  color: var(--warn);
}

h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.desc {
  display: -webkit-box;
  min-height: 60px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

dl {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(96px, auto);
  gap: 8px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.price {
  color: var(--accent-strong);
  font-size: 18px;
}

.whatsapp {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.whatsapp[aria-disabled="true"] {
  background: #9ca3af;
  cursor: default;
  pointer-events: none;
}

.empty {
  grid-column: 1 / -1;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    align-items: start;
  }

  .summary {
    text-align: left;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}
