* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f5fa;
  color: #14182b;
  line-height: 1.5;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #14182b;
  color: #fff;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand { font-weight: 800; font-size: 1.2rem; white-space: nowrap; }

.search-wrap { flex: 1; }
#search {
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #2c3252;
  background: #1f2440;
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}
#search::placeholder { color: #7d85a8; }
#search:focus { border-color: #6c8cff; }

.cart {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.cart-badge {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: #ff4d6d;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid #d7dae8;
  background: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  color: #525a7a;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: #6c8cff; color: #14182b; }
.filter-btn.active {
  background: #14182b;
  color: #fff;
  border-color: #14182b;
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  border: 1px solid #eceef6;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.2s;
}
.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(20,24,43,0.1);
}
.product.hidden { display: none; }

.thumb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

/* gradient backgrounds — one per product */
.thumb-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.thumb-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.thumb-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.thumb-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.thumb-5 { background: linear-gradient(135deg, #fa709a, #fee140); }
.thumb-6 { background: linear-gradient(135deg, #30cfd0, #330867); }
.thumb-7 { background: linear-gradient(135deg, #a8edea, #fed6e3); }
.thumb-8 { background: linear-gradient(135deg, #ff9a9e, #fad0c4); }

.product h3 { font-size: 1rem; margin-bottom: 4px; }
.product .price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #14182b;
  margin-bottom: 8px;
}
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c8cff;
  background: #eef1ff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.add-btn {
  width: 100%;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: #14182b;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.add-btn:hover:not(:disabled) { background: #2c3252; }
.add-btn:active:not(:disabled) { transform: scale(0.97); }
.add-btn:disabled {
  background: #d7dae8;
  color: #9aa0b8;
  cursor: not-allowed;
}

/* out of stock overlay */
.out-of-stock .thumb { opacity: 0.45; }
.stock-label {
  color: #ff4d6d;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.empty-msg {
  text-align: center;
  color: #525a7a;
  padding: 40px;
  font-size: 1.05rem;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 24px;
  color: #525a7a;
  font-size: 0.86rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { flex-wrap: wrap; }
  .search-wrap { order: 3; flex-basis: 100%; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}
