:root {
  --plum: #6f2d7a;
  --plum-dark: #3f1748;
  --plum-light: #f7eef8;
  --ink: #202124;
  --muted: #68707a;
  --line: #e6e0e8;
  --card: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #fbf7fc 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--plum); text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  border: 0;
  border-radius: 999px;
  background: var(--plum);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.75rem 1.1rem;
}
button:disabled { cursor: not-allowed; opacity: 0.5; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  padding: 0.75rem;
  width: 100%;
}
label { display: grid; gap: 0.4rem; font-weight: 700; }

.site-header {
  align-items: center;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-nav, .auth-links { align-items: center; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.auth-links { justify-content: flex-end; }
.auth-links form { margin: 0; }
.link-button { background: none; color: var(--plum); padding: 0; }
.danger-button { background: #b3261e; }
.brand { align-items: center; color: var(--plum-dark); display: flex; flex-direction: column; font-weight: 900; letter-spacing: 0.02em; }
.brand img { height: 58px; width: 58px; }

.page-shell { margin: 0 auto; max-width: 1180px; padding: 2rem clamp(1rem, 4vw, 2rem); }
.hero-panel {
  background: radial-gradient(circle at 15% 15%, #fff 0, var(--plum-light) 45%, #fff 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  margin-bottom: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}
.hero-panel h1 { font-size: clamp(2rem, 5vw, 4rem); margin: 0.3rem 0; }
.eyebrow, .muted { color: var(--muted); font-weight: 700; }
.filter-bar { display: grid; gap: 0.75rem; grid-template-columns: 220px 1fr auto; margin-bottom: 1.5rem; }

.product-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product-grid.compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 14px 35px rgba(63, 23, 72, 0.08);
  overflow: hidden;
}
.product-card img, .product-image img {
  aspect-ratio: 4 / 3;
  background: var(--plum-light);
  display: block;
  object-fit: cover;
  width: 100%;
}
.product-card-body { padding: 1rem; }
.product-card h2, .product-card h3 { font-size: 1.05rem; margin: 0.6rem 0; }
.pill { background: var(--plum-light); border-radius: 999px; color: var(--plum-dark); display: inline-flex; font-size: 0.8rem; font-weight: 800; padding: 0.25rem 0.65rem; }
.price { color: var(--plum-dark); font-size: 1.2rem; font-weight: 900; }
.price-row {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
}
.price-row .price { margin: 0; }
.quick-cart-form { flex: 0 0 auto; margin: 0; }
.quick-cart-button {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  font-size: 1.15rem;
  height: 2rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 2rem;
}

.detail-layout { align-items: center; display: grid; gap: 2rem; grid-template-columns: minmax(260px, 1fr) 1fr; }
.detail-image img { border-radius: 28px; box-shadow: 0 18px 50px rgba(63, 23, 72, 0.14); width: 100%; }
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}
.form-card form { display: grid; gap: 1rem; }
.error { background: #fff0f0; border: 1px solid #ffcdcd; border-radius: 12px; color: #a40000; padding: 0.75rem; }
.admin-grid { align-items: start; display: grid; gap: 1.25rem; grid-template-columns: 1.4fr 1fr; }
.admin-products { margin-top: 2rem; }
.cart-list { display: grid; gap: 1rem; }
.cart-item { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; display: grid; gap: 1rem; grid-template-columns: 120px 1fr; padding: 1rem; }
.cart-item img { border-radius: 14px; width: 100%; }
.cart-total { font-size: 1.35rem; font-weight: 900; }
.empty-state { background: var(--plum-light); border-radius: 18px; padding: 1rem; }

@media (max-width: 760px) {
  .site-header, .filter-bar, .detail-layout, .admin-grid { grid-template-columns: 1fr; }
  .brand { order: -1; }
  .top-nav, .auth-links { justify-content: center; }
}
