:root {
  --primary: #1a5d3a;
  --primary-dark: #124228;
  --accent: #d97706;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --white: #ffffff;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--text); font-weight: 500; }
.cart-link { position: relative; }
.cart-count {
  background: var(--accent); color: var(--white); border-radius: 999px;
  font-size: 0.75rem; padding: 1px 7px; margin-left: 4px;
}

.page { padding: 30px 20px 60px; min-height: 60vh; }

/* Product grid */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px; margin-top: 20px;
}
.product-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.product-card img { width: 100%; height: 180px; object-fit: cover; background: #eee; }
.product-card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { margin: 0; font-size: 1rem; }
.price { font-weight: 700; color: var(--primary-dark); }
.price .old { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-right: 6px; }
.btn {
  display: inline-block; background: var(--primary); color: var(--white);
  border: none; padding: 10px 16px; border-radius: 6px; cursor: pointer;
  font-size: 0.95rem; text-align: center;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: var(--muted); }
.btn-danger { background: var(--danger); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }

/* Single product */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product-detail img { width: 100%; border-radius: 10px; background: #eee; }
@media (max-width: 700px) { .product-detail { grid-template-columns: 1fr; } }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 1rem; font-family: inherit;
}
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
.radio-option {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  margin-bottom: 10px; cursor: pointer; display: block;
}
.radio-option input { margin-right: 8px; }

/* Table (cart + admin) */
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: #f3f4f6; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* Cart summary box */
.summary-box {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; max-width: 400px; margin-left: auto;
}
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-row.total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }

.qr-box { text-align: center; padding: 20px; background: var(--white); border: 1px dashed var(--border); border-radius: 10px; }
.qr-box img { max-width: 240px; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-processing { background: #fef9c3; color: #854d0e; }
.badge-shipped { background: #e0e7ff; color: #3730a3; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef3c7; color: #92400e; }

/* Footer */
.site-footer { background: var(--white); border-top: 1px solid var(--border); padding: 20px 0; margin-top: 40px; color: var(--muted); font-size: 0.9rem; }

/* Admin */
.admin-body { background: #f1f5f9; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #111827; color: #fff; flex-shrink: 0; }
.admin-sidebar a { display: block; color: #d1d5db; padding: 12px 20px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #1f2937; color: #fff; text-decoration: none; }
.admin-sidebar .brand { color: #fff; font-weight: 700; padding: 18px 20px; font-size: 1.1rem; border-bottom: 1px solid #1f2937; }
.admin-content { flex: 1; padding: 30px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--white); border-radius: 10px; padding: 18px; border: 1px solid var(--border); }
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { color: var(--muted); font-size: 0.9rem; }
.login-box { max-width: 380px; margin: 80px auto; background: var(--white); padding: 30px; border-radius: 10px; border: 1px solid var(--border); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; background: #eee; }
