:root {
  --green: #0f4d3a;
  --green-dark: #0a3627;
  --maroon: #7a0e2e;
  --gold: #f4c430;
  --cream: #fdf6e3;
  --text: #2b2b2b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--cream);
  color: var(--text);
}

a { text-decoration: none; color: inherit; }

/* ---------- Header ---------- */
.site-header {
  background: var(--green);
  color: white;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 28px; }
.logo-text { font-weight: 800; font-size: 18px; color: var(--gold); display: flex; flex-direction: column; line-height: 1.1; }
.logo-text small { font-weight: 400; font-size: 11px; color: #eee; }

.main-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.main-nav a { font-weight: 600; }
.cart-link { position: relative; }
.cart-badge {
  background: var(--maroon);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  padding: 2px 6px;
  position: absolute;
  top: -10px;
  right: -14px;
}
.btn-login, .btn-link {
  background: var(--gold);
  color: var(--green-dark);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 700;
}
.btn-link { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.user-chip { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.user-chip img { width: 26px; height: 26px; border-radius: 50%; }

/* ---------- Main ---------- */
.site-main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; min-height: 60vh; }

.hero {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 24px;
  text-align: center;
}
.hero h1 { color: var(--gold); margin: 0 0 8px; font-size: 26px; }
.hero p { margin: 0; opacity: 0.9; }

.category-title {
  background: var(--maroon);
  color: white;
  display: inline-block;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  margin: 28px 0 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.product-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-icon { font-size: 42px; text-align: center; }
.product-name { font-weight: 700; font-size: 15px; min-height: 40px; }
.product-price { color: var(--maroon); font-weight: 800; font-size: 16px; }
.product-form { display: flex; gap: 8px; margin-top: auto; }
.product-form select {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
}
.btn-add {
  background: var(--green);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.btn-add:hover { background: var(--green-dark); }

/* ---------- Cart / Checkout ---------- */
.cart-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.cart-table th, .cart-table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
.cart-table th { background: var(--green); color: white; }
.qty-input { width: 70px; padding: 6px; border-radius: 6px; border: 1px solid #ddd; }
.btn-remove { color: var(--maroon); font-weight: 700; background: none; border: none; cursor: pointer; }
.cart-summary { text-align: right; margin-top: 16px; font-size: 18px; }
.cart-summary strong { color: var(--maroon); }

.btn-primary {
  background: var(--maroon);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 16px;
}
.btn-primary:hover { background: #5c0a22; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.empty-state { text-align: center; padding: 40px 16px; color: #777; }

form.checkout-form { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); max-width: 500px; }
form.checkout-form label { display: block; margin-top: 12px; font-weight: 600; font-size: 14px; }
form.checkout-form input, form.checkout-form textarea {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* ---------- Orders ---------- */
.order-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.order-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.status-badge { padding: 4px 12px; border-radius: 14px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.status-pending { background: #fff3cd; color: #856404; }
.status-paid { background: #d4edda; color: #155724; }
.status-failed { background: #f8d7da; color: #721c24; }
.status-shipped { background: #cfe2ff; color: #084298; }
.status-delivered { background: #d1e7dd; color: #0f5132; }
.order-items-list { margin-top: 10px; font-size: 14px; color: #555; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-success { background: #d4edda; color: #155724; }

.success-box { text-align: center; background: white; padding: 40px 20px; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.success-box .tick { font-size: 60px; color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-dark); color: #eee; padding: 24px 16px 0; margin-top: 40px; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-inner p { margin: 4px 0; font-size: 14px; }
.footer-bottom { text-align: center; padding: 14px; margin-top: 14px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; }

@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
}
