:root {
  --bg: #f7f5ef;
  --panel: #ffffffd9;
  --ink: #1b1f1d;
  --muted: #5c645f;
  --accent: #2e7a4e;
  --accent-soft: #d8efdf;
  --line: #d2dcd5;
  --shadow: 0 18px 40px rgba(25, 46, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, #fcfaf5 0%, #f6f9f7 45%, #eef6f1 100%);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(25px);
  z-index: -1;
}

.bg-1 {
  width: 340px;
  height: 340px;
  top: -80px;
  left: -120px;
  background: #bddcb6;
}

.bg-2 {
  width: 300px;
  height: 300px;
  bottom: -120px;
  right: -80px;
  background: #f3d9ac;
}

.hero {
  padding: 42px 22px 22px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  letter-spacing: 0.04em;
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent);
}

.subtitle {
  margin: 10px auto 0;
  max-width: 700px;
  color: var(--muted);
}

.container {
  width: min(1180px, 92vw);
  margin: 0 auto 40px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 14px;
  margin-bottom: 10px;
}

.controls input,
.controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  background: #fff;
}

.result-count {
  margin: 0 0 16px;
  color: var(--muted);
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: fade 0.35s ease both;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px rgba(25, 46, 32, 0.16);
}

.card-body {
  padding: 12px;
}

.category {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
}

.name {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
  min-height: 2.4em;
}

.variant {
  margin: 6px 0 10px;
  font-size: 0.86rem;
  color: var(--muted);
}

.prices {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.price-box {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 6px 8px;
  width: 50%;
}

.price-box--single {
  width: 100%;
}

.price-label {
  display: block;
  color: #3d5d47;
}

.price-value {
  font-weight: 700;
}

.product-dialog {
  border: none;
  border-radius: 14px;
  max-width: min(92vw, 760px);
  padding: 16px;
}

.product-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.dialog-meta {
  margin: 8px 0;
  color: var(--muted);
}

.dialog-description {
  margin: 0;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 62vh;
  overflow: auto;
  padding: 10px 12px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.close-btn {
  border: none;
  background: #1b1f1d;
  color: #fff;
  border-radius: 10px;
  padding: 7px 11px;
  cursor: pointer;
  margin-bottom: 8px;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .controls {
    grid-template-columns: 1fr;
  }
}
