/* Base */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  max-width: 900px;
  margin: auto;
  padding: 20px;
  background: #f5f7fa;
  color: #222;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 32px;
  font-weight: 700;
}

/* Price Groups */
.priceGroup {
  margin-bottom: 40px;
}

.priceGroup h2 {
  margin-bottom: 14px;
  font-size: 22px;
  font-weight: 700;
}

/* Masonry grid inside each group */
.groupGrid {
  column-count: 2;
  column-gap: 20px;
}

@media (max-width: 700px) {
  .groupGrid {
    column-count: 1;
  }
}

/* Cards */
.itemCard {
  break-inside: avoid;
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  transition: 0.18s ease;
}

.itemCard:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* Images */
.itemImage {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* Purchased (guest only) */
.purchasedCard {
  opacity: 0.65;
  filter: grayscale(0.6);
}

.purchasedCard .itemImage {
  filter: grayscale(1);
  opacity: 0.9;
}

.purchasedLabel {
  margin-top: 12px;
  padding: 8px 0;
  background: #6b7280;
  color: white;
  font-weight: 600;
  border-radius: 9999px;
  text-align: center;
}

/* Text */
.detail {
  margin-top: 4px;
  font-size: 14px;
  color: #555;
}

.itemCard a {
  text-decoration: none;
  color: #111;
  font-size: 18px;
  font-weight: 600;
}

.itemCard a:hover {
  text-decoration: underline;
}

/* Buttons */
button {
  width: 100%;
  padding: 10px;
  background: #4f46e5;
  color: white;
  border: none;
  font-size: 15px;
  border-radius: 10px;
  margin-top: 10px;
  cursor: pointer;
}

button:hover {
  background: #4338ca;
}

.editBtn { background: #facc15; color: #333; }
.editBtn:hover { background: #eab308; }

.deleteBtn { background: #ef4444; }
.deleteBtn:hover { background: #dc2626; }

.cancelBtn { background: #e5e7eb; color: #333; }
.cancelBtn:hover { background: #d1d5db; }

/* Add Item */
#add-item {
  background: white;
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 30px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

#add-item input,
#add-item textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fafafa;
  margin-top: 10px;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fafafa;
}

#previewImage {
  width: 100%;
  border-radius: 14px;
  margin-top: 10px;
  display: none;
}

.modal-buttons {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}