:root {
  --primary: #E87722;
  --primary-dark: #C45E0A;
  --primary-light: #F5A05A;
  --secondary: #2E7D32;
  --secondary-light: #8BC34A;
  --accent: #FDD835;
  --bg: #FAFAF7;
  --text: #1A1A1A;
  --text-muted: #666666;
  --border: #E0E0E0;
  --card-bg: #FFFFFF;
  --danger: #D32F2F;
  --success: #388E3C;
  --warning: #F57C00;
  --info: #1565C0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 28px rgba(232,119,34,0.18);
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  background: var(--card-bg);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.navbar-logo img { height: 44px; width: auto; }

.navbar-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.navbar-logo-text span { color: var(--secondary); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.nav-link:hover { background: var(--bg); color: var(--primary); }
.nav-link.active { color: var(--primary); }

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 0.5rem;
}
.lang-btn {
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.lang-btn:hover, .lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.cart-btn {
  position: relative;
  padding: 0.45rem 0.9rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cart-btn:hover { background: var(--primary-dark); }
.cart-badge {
  background: var(--accent);
  color: #333;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Hero ──────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #C45E0A 60%, var(--secondary) 100%);
  color: white;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-logo { width: 100px; height: 100px; object-fit: contain; margin-bottom: 1rem; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25)); }
.hero h1 { font-size: 2.4rem; font-weight: 900; margin: 0 0 0.5rem; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.hero p { font-size: 1.1rem; opacity: 0.92; margin: 0 auto; max-width: 500px; }

/* ── Category Filter ──────────────────────────────── */
.categories {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1.5rem 0 0.5rem;
}
.cat-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.cat-btn:hover, .cat-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* ── Product Grid ─────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0 2rem;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0ede8;
}
.product-card .product-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #f5ece0, #fdf6ec);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}
.product-info { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 1.05rem; font-weight: 800; margin: 0 0 0.35rem; color: var(--text); }
.product-desc { font-size: 0.86rem; color: var(--text-muted); margin: 0 0 1rem; flex: 1; line-height: 1.5; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.product-price { font-size: 1.25rem; font-weight: 900; color: var(--primary); }
.product-unit { font-size: 0.82rem; color: var(--text-muted); }
.btn-add-cart {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.btn-add-cart:hover { background: var(--primary-dark); }
.btn-add-cart:active { transform: scale(0.97); }
.btn-add-cart.added { background: var(--success); }

/* ── Container ─────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 2rem 0; }

/* ── Cart / Forms ─────────────────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  background: var(--bg);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cart-table td { padding: 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.qty-input {
  width: 70px;
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  text-align: center;
  font-family: inherit;
}
.qty-input:focus { outline: none; border-color: var(--primary); }
.btn-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.2s;
}
.btn-remove:hover { background: #fde8e8; }

.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-weight: 700; font-size: 0.88rem; color: var(--text); margin-bottom: 0.4rem; }
.form-label .required { color: var(--danger); }
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
  color: var(--text);
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-input::placeholder { color: #aaa; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #2d7a2f; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b71c1c; }
.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #256428; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.83rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 1rem; color: var(--text); }

/* ── Status Badges ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-pending { background: #FFF8E1; color: #F57C00; }
.badge-confirmed { background: #E3F2FD; color: var(--info); }
.badge-locked { background: #FFF3E0; color: #E65100; }
.badge-delivered { background: #E8F5E9; color: var(--success); }
.badge-cancelled { background: #FFEBEE; color: var(--danger); }

/* ── Notice Box ────────────────────────────────────── */
.notice {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.notice-warning { background: #FFF8E1; border-left: 4px solid var(--warning); color: #7c4d00; }
.notice-success { background: #E8F5E9; border-left: 4px solid var(--success); color: #1b5e20; }
.notice-danger  { background: #FFEBEE; border-left: 4px solid var(--danger); color: #7f0000; }
.notice-info    { background: #E3F2FD; border-left: 4px solid var(--info); color: #0d47a1; }

/* ── Totals row ────────────────────────────────────── */
.total-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; }
.total-row.grand { font-size: 1.2rem; font-weight: 900; color: var(--primary); border-top: 2px solid var(--border); padding-top: 0.9rem; margin-top: 0.4rem; }

/* ── Footer ─────────────────────────────────────────── */
footer {
  background: #1A1A1A;
  color: #ccc;
  padding: 2rem 1.5rem;
  margin-top: auto;
  font-size: 0.88rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
}
footer a { color: var(--primary-light); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-brand { font-weight: 800; font-size: 1.1rem; color: var(--primary); }

/* ── Admin ─────────────────────────────────────────── */
.admin-sidebar {
  width: 240px;
  min-height: calc(100vh - 60px);
  background: #1a1a2e;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}
.admin-sidebar .logo { color: var(--primary); font-weight: 900; font-size: 1.1rem; padding: 0.5rem; margin-bottom: 1.5rem; display: block; text-decoration: none; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  color: #aaa;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(232,119,34,0.12); color: var(--primary); }
.admin-main { flex: 1; overflow: auto; }
.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.admin-layout { display: flex; min-height: 100vh; }
.admin-content { padding: 1.5rem; max-width: 100%; }

.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.75rem; font-weight: 900; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th {
  background: var(--bg);
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: #fafafa; }
.action-btns { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.action-btn {
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
  background: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}
.action-btn:hover { background: var(--bg); color: var(--text); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.7rem; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
  .admin-sidebar { display: none; }
  .admin-layout { flex-direction: column; }
  .navbar-inner { padding: 0.6rem 1rem; }
  .cart-table { font-size: 0.85rem; }
  .stat-card { padding: 1rem; }
}

/* ── Utilities ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.page-title { font-size: 1.6rem; font-weight: 900; margin: 0 0 0.25rem; }
.page-sub { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 1.5rem; }

/* ── Checkbox ──────────────────────────────────────── */
.checkbox-group { display: flex; align-items: flex-start; gap: 0.6rem; }
.checkbox-group input[type="checkbox"] { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Select ────────────────────────────────────────── */
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; padding-right: 2.2rem; }

/* ── Payment notice ─────────────────────────────────── */
.payment-notice {
  background: linear-gradient(135deg, #FFF8E1, #FFFDE7);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  color: #5d4037;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── Success page ───────────────────────────────────── */
.success-icon {
  width: 80px; height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
  color: white;
}

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.35s ease forwards; }

/* ── Hidden ─────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal h3 { margin: 0 0 0.75rem; font-size: 1.2rem; font-weight: 800; }
.modal p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ── Admin filter bar ───────────────────────────────── */
.filter-bar {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}
.filter-bar .form-group { margin-bottom: 0; min-width: 140px; }
.filter-bar .form-input { padding: 0.5rem 0.75rem; font-size: 0.88rem; }
.filter-bar .form-label { font-size: 0.8rem; }
