:root {
  --forest: #2f4433;
  --forest-dark: #1e2e22;
  --amber: #c97f2b;
  --amber-dark: #a8641c;
  --cream: #f7f3e9;
  --ink: #2a2a24;
  --muted: #6b6b5f;
  --card-bg: #ffffff;
  --danger: #b3392f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.site-header {
  background: var(--forest);
  color: white;
  padding: 14px 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: white;
  font-size: 1.4rem;
  font-weight: bold;
}
.logo:hover { text-decoration: none; }

.main-nav a {
  color: white;
  margin-left: 20px;
  font-weight: 500;
}
.main-nav a:hover { text-decoration: underline; }

.cart-count {
  display: inline-block;
  background: var(--amber);
  color: white;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.8rem;
  margin-left: 4px;
}

main.container {
  min-height: 60vh;
  padding-top: 30px;
  padding-bottom: 60px;
}

.hero {
  text-align: center;
  margin-bottom: 30px;
}
.hero h1 { margin-bottom: 6px; }
.hero p { color: var(--muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.product-card h3 {
  font-size: 1rem;
  margin: 4px 0;
  color: var(--ink);
}

.product-card .price {
  font-weight: bold;
  color: var(--amber-dark);
  margin: 4px 0 12px;
}

.btn {
  display: inline-block;
  background: var(--forest);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: auto;
  text-align: center;
}
.btn:hover { background: var(--forest-dark); text-decoration: none; }
.btn:disabled { background: #999; cursor: not-allowed; }

.btn-primary { background: var(--amber); }
.btn-primary:hover { background: var(--amber-dark); }

.btn-secondary { background: transparent; color: var(--forest); border: 1px solid var(--forest); margin-left: 8px; }
.btn-secondary:hover { background: var(--forest); color: white; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8e2a22; }

.product-detail {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.product-detail-img {
  width: 380px;
  max-width: 100%;
  border-radius: var(--radius);
}
.product-detail-info { flex: 1; min-width: 260px; }
.product-detail-info .price { font-size: 1.4rem; color: var(--amber-dark); font-weight: bold; }
.product-detail-info .description { color: var(--ink); margin: 16px 0; }
.stock { color: var(--forest); font-weight: 500; }
.stock.out { color: var(--danger); }
.shipping-note { color: var(--muted); font-size: 0.9rem; }

.qty-row { margin-bottom: 14px; }
.qty-row input { width: 60px; padding: 6px; border-radius: 6px; border: 1px solid #ccc; margin-left: 8px; }

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
}
.cart-table th, .cart-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.cart-table th { background: #efe9d8; }

.cart-row-name { display: flex; align-items: center; gap: 10px; }
.cart-row-name img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

.qty-input { width: 50px; padding: 4px; border-radius: 6px; border: 1px solid #ccc; }

.remove-item {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
}

.cart-empty { text-align: center; padding: 40px 0; color: var(--muted); }

.order-form {
  max-width: 400px;
  margin-left: auto;
  text-align: left;
}
.order-form label { display: block; margin: 12px 0 4px; font-weight: 500; }
.order-form input, .order-form select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 1rem;
}
.order-form-note { color: var(--muted); font-size: 0.85rem; margin: 12px 0; }
.order-form #request-btn { width: 100%; margin-top: 4px; }

.cart-summary { margin-top: 20px; text-align: right; }
.cart-total { font-size: 1.3rem; font-weight: bold; }

.checkout-error {
  background: #fbe4e1;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 10px 0;
  text-align: left;
}

.order-result { text-align: center; padding: 40px 0; }
.order-result.success h1 { color: var(--forest); }
.order-result.cancel h1 { color: var(--danger); }
.order-summary { max-width: 600px; margin: 20px auto; text-align: left; }

.site-footer {
  background: var(--forest-dark);
  color: #c9d3c6;
  padding: 20px 0;
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: #e8c98a; }

/* Admin */
.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
.admin-table th { background: #efe9d8; }
.admin-table img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.admin-actions { display: flex; gap: 8px; }
.order-table { margin-bottom: 0; }
.inline-form { display: inline; }

.order-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.status-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  text-transform: capitalize;
}
.order-card .cart-total { text-align: right; margin: 10px 0 0; }

.form-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  max-width: 500px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.form-card label { display: block; margin: 12px 0 4px; font-weight: 500; }
.form-card input, .form-card textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: inherit;
}
.form-card textarea { min-height: 100px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

.login-card {
  background: white;
  max-width: 360px;
  margin: 60px auto;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.login-card h1 { margin-top: 0; text-align: center; font-size: 1.3rem; }
.error-msg { color: var(--danger); margin-bottom: 10px; }

.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  background: #efe9d8;
  color: var(--ink);
}
.tabs a.active { background: var(--forest); color: white; }
