:root {
  --bg: #f5efe7;
  --panel: #fffdf9;
  --ink: #171510;
  --muted: #5d584f;
  --line: #ddd4c7;
  --brand: #d6ff5d;
  --accent: #ff7d5b;
  --success: #3d9d5c;
  --shadow: 0 16px 30px rgba(20, 20, 20, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.9);
 
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--brand);
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.brand-name {
  font-weight: 800;
  letter-spacing: -0.05em;
}
.brand-sub {
  color: var(--muted);
  font-size: 0.73rem;
}
.main-nav {
  display: flex;
  gap: 1.6rem;
  color: var(--muted);
  font-weight: 600;
}
.account-strip {
  display: flex;
  align-items: center;
  gap: 12px;
}
.primary-button, .ghost-button, .tab-button, .product-card button {
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  background: var(--ink);
  color: var(--panel);
  font-weight: 600;
}
.ghost-button {
  background: transparent;
  color: var(--ink);
}
.tab-button {
  background: transparent;
  color: var(--ink);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border-color: var(--line);
}
.tab-button.active {
  background: var(--brand);
  border-color: var(--ink);
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 4vw 80px;
}
.auth-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.eyebrow.small { font-size: 0.68rem; }
.auth-card h1, .hero-banner h2, .catalog-topbar h3, .admin-header h3 {
  margin: 0 0 12px;
  letter-spacing: -0.06em;
}
.auth-card h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.auth-copy {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.auth-tabs {
  display: inline-flex;
  gap: 8px;
  background: #efe7dc;
  border-radius: 999px;
  padding: 8px;
  margin-bottom: 1.2rem;
}
.auth-message {
  min-height: 1.2rem;
  margin-top: 1rem;
  color: var(--success);
  font-weight: 600;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}
.field-group label {
  font-weight: 600;
}
.field-group input, .field-group select, .field-group textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.9rem 1rem;
}
.wide { width: 100%; }
.store-shell { display: block; }
.hero-banner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, var(--brand), #c4ff68);
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 2rem;
}
.hero-meta {
  background: rgba(255,255,255,0.5);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0,2.3fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
}
.catalog-panel, .cart-panel, .product-form, .admin-list-panel {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.catalog-panel { padding: 1.3rem; }
.catalog-topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.catalog-topbar select {
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}
.product-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.product-image {
  height: 180px;
  background: linear-gradient(135deg, #efefe9, #dfe1d1);
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--muted);
}
.product-content {
  padding: 1rem;
}
.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.product-price {
  font-weight: 800;
  font-size: 1.3rem;
}
.product-description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  min-height: 3.2rem;
}
.product-card button {
  width: 100%;
  margin-top: 0.8rem;
}
.cart-panel {
  padding: 1.2rem;
}
.cart-header {
  margin-bottom: 1rem;
}
.cart-items {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
}
.cart-totals {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}
.cart-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.admin-shell {
  margin-top: 2rem;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.3fr);
  gap: 1.5rem;
}
.product-form, .admin-list-panel {
  padding: 1.2rem;
}
.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}
.admin-product-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}
.admin-product-row button {
  border: 1px solid var(--ink);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: transparent;
  color: var(--ink);
}
.hidden { display: none !important; }
@media (max-width: 880px) {
  .catalog-layout, .admin-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-wrap: wrap;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}
