:root {
  --header-bg: #16283f;
  --header-bg-light: #263c58;
  --accent: #f0a202;
  --accent-dark: #d18c00;
  --text-dark: #0f1111;
  --bg: #eaeded;
  --card-bg: #ffffff;
  --link: #0a6cbf;
  --success: #067d62;
  --border: #d5d9d9;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ---- Top bar ---- */
.topbar {
  background: var(--header-bg);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.logo span { color: var(--accent); }
.search-bar {
  flex: 1;
  display: flex;
  min-width: 200px;
  border-radius: 4px;
  overflow: hidden;
}
.search-bar input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: 14px;
}
.search-bar button {
  background: var(--accent);
  border: none;
  padding: 0 16px;
  cursor: pointer;
  font-weight: bold;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  white-space: nowrap;
}
.nav-links a, .nav-links span { color: #fff; cursor: pointer; }
.cart-icon { position: relative; font-size: 20px; }
.cart-count {
  position: absolute;
  top: -8px; right: -10px;
  background: var(--accent);
  color: var(--header-bg);
  font-size: 11px;
  font-weight: bold;
  border-radius: 50%;
  padding: 1px 6px;
}
.subnav {
  background: var(--header-bg-light);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  gap: 16px;
  font-size: 13px;
  overflow-x: auto;
}
.subnav a { white-space: nowrap; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.hero {
  background: linear-gradient(135deg, var(--header-bg), var(--header-bg-light));
  color: #fff;
  padding: 40px 16px;
  text-align: center;
}
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero p { opacity: 0.85; margin: 0; }

.section-title { font-size: 20px; margin: 24px 0 12px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.product-card img {
  height: 160px;
  object-fit: contain;
  margin-bottom: 8px;
  background: #fafafa;
}
.product-title {
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.price-row { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; }
.price { font-size: 18px; font-weight: 700; }
.price-old { text-decoration: line-through; color: #777; font-size: 13px; }
.shop-name { font-size: 12px; color: #555; margin-bottom: 6px; }
.rating { font-size: 12px; color: var(--accent-dark); margin-bottom: 6px; }

.btn {
  display: inline-block;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); }
.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
}
.btn-block { width: 100%; }
.btn-secondary { background: var(--header-bg); color: #fff; border-color: var(--header-bg); }

/* ---- Forms ---- */
.form-card {
  max-width: 420px;
  margin: 40px auto;
  background: var(--card-bg);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.form-card h2 { margin-top: 0; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #888;
  border-radius: 4px;
  font-size: 14px;
}
.error-msg { color: #c40000; font-size: 13px; margin: 8px 0; }
.success-msg { color: var(--success); font-size: 13px; margin: 8px 0; }

/* ---- Cart / Checkout ---- */
.cart-item {
  display: flex;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  align-items: center;
}
.cart-item img { width: 80px; height: 80px; object-fit: contain; }
.cart-item .info { flex: 1; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; cursor: pointer;
}
.summary-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.summary-total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 10px; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Dashboard ---- */
.dash-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.dash-tabs button {
  padding: 8px 14px; border-radius: 4px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 13px;
}
.dash-tabs button.active { background: var(--header-bg); color: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
th { background: #f6f6f6; }
.badge { padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-paid, .badge-active, .badge-delivered { background: #d4edda; color: #155724; }
.badge-processing, .badge-shipped { background: #cce5ff; color: #004085; }
.badge-cancelled, .badge-failed { background: #f8d7da; color: #721c24; }

footer {
  background: var(--header-bg);
  color: #ccc;
  text-align: center;
  padding: 24px;
  margin-top: 40px;
  font-size: 13px;
}
