:root {
  --brand: #ffc107;
  --brand-dark: #d39e00;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.site-header .bar {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  color: var(--ink) !important;
  text-decoration: none !important;
}
.brand span { color: var(--brand-dark); }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.nav-links a { color: var(--ink); }

.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.container.narrow { max-width: 460px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 0 0 12px; }

form .field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #111;
  border: none;
  padding: 11px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.muted { color: var(--muted); font-size: 13px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.open, .badge.pending { background: #fef3c7; color: #92400e; }
.badge.resolved, .badge.completed, .badge.fulfilled { background: #dcfce7; color: #166534; }
.badge.cancelled, .badge.declined, .badge.refunded { background: #fee2e2; color: #991b1b; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px 20px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.qr-box { text-align: center; margin: 16px 0; }
.qr-box img { border: 1px solid var(--border); border-radius: 6px; padding: 10px; background: #fff; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* --- Storefront (Phase C) -------------------------------------------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card img.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
}
.product-card .name { font-weight: 700; font-size: 14px; }
.product-card .price { font-weight: 800; color: var(--ink); }
.product-card .stock-out { color: var(--danger); font-size: 12px; font-weight: 600; }

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.filters-bar .field { margin-bottom: 0; min-width: 140px; }

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.product-detail .gallery-main img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gallery-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.gallery-thumbs img.active { border-color: var(--brand); }
@media (max-width: 720px) { .product-detail { grid-template-columns: 1fr; } }

.qty-input { width: 70px; }

.cart-table img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.cart-summary { max-width: 340px; margin-left: auto; }
.cart-summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.cart-summary .row.total { font-weight: 800; font-size: 16px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }

.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .checkout-grid { grid-template-columns: 1fr; } }

.rating-stars { color: var(--brand-dark); font-size: 13px; }
