* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --ocean: #0ea5e9; --teal: #14b8a6; --sand: #fbbf24;
  --ink: #0f172a; --muted: #64748b; --bg: #f8fafc; --card: #ffffff;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
  display: flex; flex-direction: column;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }
a { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: linear-gradient(120deg, var(--ocean), var(--teal));
  color: #fff; padding: 0.9rem 0; box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.brand { font-size: 1.35rem; font-weight: 700; color: #fff; }
.brand:hover { text-decoration: none; }
.nav-cats { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.nav-cats a, .nav-user a { color: rgba(255,255,255,0.92); font-size: 0.92rem; }
.nav-user { display: flex; align-items: center; gap: 0.9rem; }
.user-name { font-size: 0.9rem; opacity: 0.85; }
.cart-link { position: relative; font-weight: 600; }
.cart-badge {
  background: var(--sand); color: var(--ink); border-radius: 999px;
  font-size: 0.75rem; padding: 0.05rem 0.45rem; margin-left: 0.2rem; font-weight: 700;
}

/* Buttons & forms */
.btn {
  display: inline-block; background: var(--ocean); color: #fff; border: none;
  padding: 0.6rem 1.3rem; border-radius: 0.5rem; font-size: 0.95rem;
  font-weight: 600; cursor: pointer;
}
.btn:hover { background: #0284c7; text-decoration: none; }
.btn-small { padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn-ghost { background: rgba(255,255,255,0.18); font-size: 0.85rem; padding: 0.35rem 0.9rem; }
.btn-ghost:hover { background: rgba(255,255,255,0.3); }
.btn-danger { background: #ef4444; } .btn-danger:hover { background: #dc2626; }
.inline-form { display: inline; }
.form-card {
  background: var(--card); border-radius: 0.9rem; padding: 2rem;
  max-width: 460px; margin: 2.5rem auto; box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.form-card h1 { margin-bottom: 1.2rem; font-size: 1.5rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.field input {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid #cbd5e1;
  border-radius: 0.5rem; font-size: 0.95rem;
}
.field input:focus { outline: 2px solid var(--ocean); border-color: transparent; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.form-footer { margin-top: 1rem; font-size: 0.88rem; color: var(--muted); }

/* Flashes */
.flashes { margin-top: 1rem; }
.flash { padding: 0.7rem 1rem; border-radius: 0.5rem; margin-bottom: 0.5rem; font-size: 0.92rem; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #e0f2fe; color: #075985; }

/* Hero + product grid */
main { flex: 1; padding: 2rem 0 3rem; }
.hero {
  background: linear-gradient(160deg, var(--ocean), var(--teal) 60%, var(--sand));
  color: #fff; border-radius: 1rem; padding: 2.5rem 2rem; margin-bottom: 2rem;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.4rem; }
.hero p { opacity: 0.92; }
.section-title { font-size: 1.4rem; margin: 1.5rem 0 1rem; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
}
.product-card {
  background: var(--card); border-radius: 0.9rem; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06); display: flex; flex-direction: column;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.product-emoji {
  font-size: 3.5rem; text-align: center; padding: 1.8rem 0;
  background: linear-gradient(140deg, #e0f2fe, #ccfbf1);
}
.product-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.product-name { font-weight: 700; color: var(--ink); }
.product-name:hover { color: var(--ocean); text-decoration: none; }
.product-desc { font-size: 0.85rem; color: var(--muted); flex: 1; }
.product-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; }
.price { font-weight: 700; font-size: 1.05rem; }
.stock { font-size: 0.78rem; color: var(--muted); }
.stock.out { color: #ef4444; font-weight: 600; }

/* Product detail */
.product-detail { display: flex; gap: 2.5rem; background: var(--card); border-radius: 1rem;
  padding: 2.5rem; box-shadow: 0 2px 12px rgba(0,0,0,0.06); flex-wrap: wrap; }
.product-detail .product-emoji { font-size: 7rem; border-radius: 0.9rem; padding: 3rem 4rem; }
.product-detail-info { flex: 1; min-width: 280px; }
.product-detail-info h1 { margin-bottom: 0.5rem; }
.product-detail-info .price { font-size: 1.6rem; display: block; margin: 1rem 0; }
.qty-row { display: flex; gap: 0.8rem; align-items: center; margin-top: 1.2rem; }
.qty-row input { width: 4.5rem; padding: 0.55rem; border: 1px solid #cbd5e1; border-radius: 0.5rem; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }

/* Tables (cart, orders) */
.table-card { background: var(--card); border-radius: 0.9rem; padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); padding: 0.6rem 0.8rem; border-bottom: 2px solid #e2e8f0; }
td { padding: 0.9rem 0.8rem; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
.cart-total-row td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid #e2e8f0; }
.cart-qty-input { width: 3.8rem; padding: 0.4rem; border: 1px solid #cbd5e1; border-radius: 0.4rem; }
.cart-actions { display: flex; justify-content: space-between; margin-top: 1.4rem; align-items: center; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .big { font-size: 3rem; display: block; margin-bottom: 0.6rem; }

/* Checkout */
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .checkout-grid { grid-template-columns: 1fr; } }
.pay-note {
  background: #fef9c3; border: 1px solid #fde047; color: #713f12;
  padding: 0.7rem 1rem; border-radius: 0.5rem; font-size: 0.85rem; margin-bottom: 1rem;
}
.order-status { display: inline-block; background: #dcfce7; color: #166534;
  border-radius: 999px; padding: 0.15rem 0.75rem; font-size: 0.8rem; font-weight: 700; }
.confirmation-banner {
  background: linear-gradient(120deg, #16a34a, #14b8a6); color: #fff;
  border-radius: 1rem; padding: 2rem; text-align: center; margin-bottom: 1.5rem;
}
.confirmation-banner h1 { margin-bottom: 0.4rem; }

/* Footer */
.site-footer { background: var(--ink); color: #94a3b8; padding: 1.4rem 0; font-size: 0.85rem; }
