:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  --background: #f3f4f6;
  --card: #ffffff;
  --foreground: #1a1d29;
  --muted: #6b7280;
  --border: #e5e7eb;
  --destructive: #dc2626;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --success: #16a34a;
  --whatsapp: #25d366;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.brand-name {
  font-weight: 800;
  font-size: 19px;
}

.cart-toggle {
  position: relative;
  background: none;
  border: none;
  color: var(--foreground);
  padding: 8px;
  border-radius: 10px;
}

.cart-toggle:hover {
  background: var(--background);
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--destructive);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Hero */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 20px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  margin: 0 0 8px;
}

.hero p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* Controls */
.controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 18px;
}

.search-box input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 15px;
  background: none;
  color: var(--foreground);
}

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.chip {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Product grid */
.product-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.status-message {
  max-width: 1100px;
  margin: 40px auto;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 0 20px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.product-image {
  aspect-ratio: 1 / 1;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd0d8;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image img.lazy-img {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.product-image img.lazy-img.loaded {
  opacity: 1;
}

.out-of-stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.product-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.product-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  min-height: 38px;
}

.product-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.product-stock {
  font-size: 12px;
  font-weight: 600;
}

.product-stock.low {
  color: var(--warning);
}

.product-stock.in {
  color: var(--success);
}

.product-stock.out {
  color: var(--destructive);
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--background);
  border-radius: 8px;
}

.qty-stepper button {
  width: 30px;
  height: 32px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
  border-radius: 8px;
}

.qty-stepper button:disabled {
  color: var(--border);
  cursor: not-allowed;
}

.qty-stepper span {
  width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.add-btn {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

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

.add-btn:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

/* Cart bar */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  z-index: 30;
}

.cart-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cart-summary {
  display: flex;
  flex-direction: column;
}

#cart-summary-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.cart-summary-total {
  font-size: 19px;
  font-weight: 800;
  color: var(--foreground);
}

.whatsapp-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--whatsapp);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 700;
}

.whatsapp-btn:hover {
  filter: brightness(0.95);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--foreground);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 40;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
