:root {
  --bg: #fff5f7;
  --card: #ffffff;
  --accent: #ff4d6d;
  --accent-dark: #c9184a;
  --text: #2b2b2b;
  --muted: #8a8a8a;
  --border: #ffd6de;
  --shadow: 0 6px 18px rgba(201, 24, 74, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 28px;
  background: var(--card);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { margin: 0; font-size: 1.5rem; }

main { padding: 28px; max-width: 1100px; margin: 0 auto; }

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-3px); }

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

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-name { font-weight: 600; font-size: 1.05rem; }

.card-price { color: var(--accent-dark); font-weight: 600; }

.card-actions { display: flex; gap: 8px; margin-top: auto; align-items: center; }

.btn {
  font: inherit;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: #fff0f3; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-buy { flex: 1; }
.btn-buy:disabled {
  background: #f1c5cf;
  border-color: #f1c5cf;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.8;
}

.empty { text-align: center; color: var(--muted); margin-top: 60px; font-size: 1.1rem; }
.hidden { display: none; }

/* Flying hearts */
.fly-heart {
  position: fixed;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 1000;
  animation: floatUp 1s ease-out forwards;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0%   { transform: translateY(0) scale(1);   opacity: 1; }
  100% { transform: translateY(-120px) scale(1.4); opacity: 0; }
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 1.2rem; }

  main { padding: 16px; }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-body { padding: 11px; gap: 6px; }
  .card-name { font-size: 0.95rem; }

  /* bigger tap targets */
  .btn { padding: 10px 12px; }
}

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