:root {
  --brand-yellow: #FFC72C;
  --brand-black: #1a1a1a;
  --brand-dark: #212121;
  --brand-green: #1a7a3c;
  --brand-red: #d32f2f;
  --bg-light: #f7f7f8;
  --border-color: #e5e5e5;
  --text-muted: #6b6b6b;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--brand-dark);
  background: #fff;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

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

/* ---------- Top strip ---------- */
.top-strip {
  background: var(--brand-black);
  color: #fff;
  text-align: center;
  font-size: 13px;
  padding: 6px 10px;
}

/* ---------- Header ---------- */
header.site-header {
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  max-width: 1240px;
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  white-space: nowrap;
}
.logo .logo-badge {
  background: var(--brand-yellow);
  color: var(--brand-black);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
}
.nav-search {
  flex: 1;
  display: flex;
}
.nav-search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 14px;
}
.nav-search button {
  padding: 0 18px;
  border: none;
  background: var(--brand-yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 700;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}
.header-actions a { display: flex; align-items: center; gap: 6px; }
.cart-count {
  background: var(--brand-red);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

nav.category-nav {
  background: var(--brand-black);
}
.category-nav ul {
  display: flex;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
  overflow-x: auto;
}
.category-nav a {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.category-nav a:hover { color: var(--brand-yellow); }

/* ---------- Hero banner ---------- */
.hero {
  background: linear-gradient(120deg, #fff7e0, #fff);
  padding: 50px 0;
}
.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.hero h1 {
  font-size: 36px;
  margin: 0 0 12px;
  max-width: 560px;
}
.hero p { color: var(--text-muted); max-width: 500px; margin-bottom: 20px; }
.btn {
  display: inline-block;
  background: var(--brand-yellow);
  color: var(--brand-black);
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  border: none;
  font-size: 15px;
}
.btn:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand-black);
  color: var(--brand-black);
}
.btn-block { width: 100%; text-align: center; }
.btn-danger { background: var(--brand-red); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- Trust badges ---------- */
.badges {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
  padding: 26px 20px;
  background: var(--bg-light);
  text-align: center;
}
.badges .badge { max-width: 160px; font-size: 13px; font-weight: 600; }
.badges .badge .icon { font-size: 26px; margin-bottom: 6px; }

/* ---------- Section headings ---------- */
.section { padding: 40px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 24px; margin: 0; }
.section-head a { font-size: 14px; font-weight: 700; color: var(--brand-red); }

/* ---------- Category grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.category-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  transition: box-shadow .15s;
}
.category-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.category-card .thumb {
  width: 64px; height: 64px; margin: 0 auto 10px;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  overflow: hidden;
}
.category-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.category-card span { font-size: 13px; font-weight: 600; }

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.product-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
}
.product-card .badge-off {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--brand-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 2;
}
.product-card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--bg-light);
  overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .name {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  min-height: 38px;
}
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; }
.product-card .price { font-size: 16px; font-weight: 800; }
.product-card .compare { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.product-card .add-row { margin-top: auto; }
.add-btn {
  width: 100%;
  padding: 9px;
  background: #fff;
  border: 1.5px solid var(--brand-green);
  color: var(--brand-green);
  font-weight: 700;
  border-radius: 6px;
}
.add-btn:hover { background: var(--brand-green); color: #fff; }

.qty-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--brand-green);
  border-radius: 6px;
  overflow: hidden;
}
.qty-stepper button {
  background: var(--brand-green);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 700;
}
.qty-stepper .qty-val {
  flex: 1;
  text-align: center;
  font-weight: 700;
}

/* ---------- Product detail page ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px 0; }
.product-gallery img { border-radius: var(--radius); border: 1px solid var(--border-color); width: 100%; }
.product-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.product-thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); cursor: pointer; }
.product-info h1 { font-size: 26px; margin: 0 0 10px; }
.product-info .price-row { display: flex; align-items: baseline; gap: 12px; margin: 14px 0; }
.product-info .price { font-size: 28px; font-weight: 800; }
.product-info .compare { font-size: 16px; color: var(--text-muted); text-decoration: line-through; }
.product-info .off-tag { color: var(--brand-green); font-weight: 700; }
.product-info .desc { color: var(--text-muted); line-height: 1.6; margin: 18px 0; }

/* ---------- Forms ---------- */
.form-page { max-width: 460px; margin: 50px auto; padding: 0 20px; }
.form-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 30px;
}
.form-card h1 { font-size: 22px; margin: 0 0 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-foot { margin-top: 16px; font-size: 13px; text-align: center; color: var(--text-muted); }
.alert { padding: 12px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fdecea; color: var(--brand-red); border: 1px solid #f5c6cb; }
.alert-success { background: #eaf7ee; color: var(--brand-green); border: 1px solid #b6e2c2; }

/* ---------- Cart page ---------- */
.cart-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; padding: 40px 0; align-items: start; }
.cart-row {
  display: grid;
  grid-template-columns: 70px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}
.cart-row img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); }
.cart-summary {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}
.summary-line { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.summary-total { font-weight: 800; font-size: 17px; border-top: 1px solid var(--border-color); padding-top: 12px; margin-top: 6px; }
.remove-link { color: var(--brand-red); font-size: 13px; font-weight: 600; }

/* ---------- Tables (admin/orders) ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th, table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); text-align: left; }
table.data-table th { background: var(--bg-light); font-weight: 700; }
table.data-table img.thumb-sm { width: 46px; height: 46px; object-fit: cover; border-radius: 4px; }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--brand-black); color: #ddd; margin-top: 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  padding: 50px 20px 20px;
  max-width: 1240px;
  margin: 0 auto;
}
.footer-grid h3 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.footer-grid li { margin-bottom: 8px; font-size: 13px; }
.footer-grid a:hover { color: var(--brand-yellow); }
.footer-bottom {
  text-align: center;
  padding: 18px 20px;
  font-size: 12px;
  border-top: 1px solid #333;
  color: #999;
}

/* ---------- Admin layout ---------- */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: var(--brand-black);
  color: #fff;
  padding: 20px 0;
  flex-shrink: 0;
}
.admin-sidebar .brand { padding: 0 20px 20px; font-weight: 800; font-size: 18px; border-bottom: 1px solid #333; margin-bottom: 10px; }
.admin-sidebar a { display: block; padding: 12px 20px; font-size: 14px; font-weight: 600; color: #ccc; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--brand-yellow); color: var(--brand-black); }
.admin-main { flex: 1; padding: 30px; background: var(--bg-light); }
.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(180px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--border-color); }
.stat-card .num { font-size: 26px; font-weight: 800; }
.stat-card .label { font-size: 13px; color: var(--text-muted); }
.admin-card { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 24px; }
.current-image-preview { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); margin-bottom: 10px; }

@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .nav-search { display: none; }
  .admin-wrap { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}
