* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 20px;
  font-family: Arial, "Malgun Gothic", sans-serif;
  background: #f4f6f8;
  color: #222;
}

.app {
  width: min(980px, 100%);
  margin: 0 auto;
}

.hero,
.filter-panel,
.product-section,
.control-panel {
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
}

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 32px;
}

.hero p {
  margin: 0;
  color: #707781;
}

.field {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d6dbe3;
  border-radius: 12px;
  font-size: 15px;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.category-button {
  width: auto;
  padding: 9px 14px;
  border: 1px solid #d6dbe3;
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-size: 14px;
}

.category-button.active {
  border-color: #2463eb;
  background: #2463eb;
  color: #fff;
}

.status-message,
.empty-message {
  margin: 14px 0 0;
  color: #707781;
  font-size: 14px;
}

.status-message.active {
  padding: 10px 12px;
  border-radius: 12px;
  background: #eaf2ff;
  color: #2463eb;
  font-weight: 700;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
}

.count {
  color: #2463eb;
  font-weight: 700;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  transition: 0.2s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-2px);
}

.product-card.selected {
  border-color: #2463eb;
  background: #eaf2ff;
}

.product-card.soldout {
  border-style: dashed;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.product-card h3 {
  margin: 0;
  font-size: 17px;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffe8e8;
  color: #e5484d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.hidden {
  display: none;
}

.description {
  min-height: 42px;
  margin: 0 0 10px;
  color: #707781;
  font-size: 13px;
  line-height: 1.45;
}

.price-wrap {
  margin-top: auto;
}

.original-price {
  display: inline-block;
  margin-right: 6px;
  color: #999;
  font-size: 13px;
  text-decoration: line-through;
}

.final-price {
  font-size: 18px;
  font-weight: 700;
}

.meta {
  display: block;
  margin-top: 7px;
  color: #707781;
  font-size: 13px;
}

.stock {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
}

.stock.available {
  color: #16a34a;
}

.stock.soldout {
  color: #e5484d;
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

button {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: #222;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

button.primary { background: #2463eb; }
button.warning { background: #f97316; }
button.secondary { background: #666; }
button.success { background: #16a34a; }

@media (max-width: 760px) {
  .product-list,
  .control-panel {
    grid-template-columns: 1fr;
  }
}
