:root {
  --green-dark: #1a472a;
  --green: #2d6a4f;
  --green-light: #40916c;
  --accent: #ffc107;
}

body { background: #f5f7f5; font-family: 'Segoe UI', sans-serif; }

/* ── Product Cards ── */
.product-card {
  border: none;
  border-radius: 12px;
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
  background: #fff;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.product-card .card-img-top {
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}
.product-card .no-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg,#e8f5e9,#f1f8e9);
  color: #a5d6a7;
}
.price-badge { font-size: 1.1rem; font-weight: 700; color: var(--green-dark); }
.price-wholesale { font-size: .85rem; color: #0d6efd; }
.unit-badge { font-size: .75rem; color: #888; }
.category-badge { font-size: .7rem; }

/* ── Category sidebar ── */
.cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  cursor: pointer; transition: background .15s;
  text-decoration: none; color: #333;
}
.cat-item:hover, .cat-item.active { background: #e8f5e9; color: var(--green-dark); font-weight: 600; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green-light));
  color: #fff;
  padding: 40px 0 30px;
}
.hero h1 { font-size: 2rem; font-weight: 800; }
.hero p { opacity: .85; }

/* ── AI Widget ── */
#aiWidget { position: fixed; bottom: 24px; right: 24px; z-index: 1050; }
#aiToggle { width: 60px; height: 60px; background: var(--green); border: none; }
#aiToggle:hover { background: var(--green-dark); }
.ai-chat {
  position: absolute; bottom: 70px; right: 0;
  width: 340px; border-radius: 16px; overflow: hidden;
  border: 1px solid #ddd; background: #fff;
}
.ai-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-light));
  color: #fff; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600;
}
.ai-messages { height: 280px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: .875rem; line-height: 1.4; }
.ai-msg-bot { background: #e8f5e9; color: #1a472a; align-self: flex-start; border-radius: 4px 12px 12px 12px; }
.ai-msg-user { background: var(--green); color: #fff; align-self: flex-end; border-radius: 12px 4px 12px 12px; }
.ai-msg-typing { color: #999; font-style: italic; }
.ai-input-area { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid #eee; background: #fafafa; }
.ai-input-area .form-control { border-radius: 20px; }

/* ── Search suggestions ── */
.search-suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #ddd; border-radius: 0 0 8px 8px;
  z-index: 100; max-height: 280px; overflow-y: auto;
}
.suggestion-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.suggestion-item:hover { background: #f5f5f5; }
#searchForm { position: relative; }

/* ── Dashboard cards ── */
.stat-card { border-radius: 12px; border: none; }
.stat-card .stat-icon { font-size: 2.5rem; opacity: .8; }

/* ── Status badges ── */
.badge-pending { background: #fff3cd; color: #856404; }
.badge-moderation { background: #cfe2ff; color: #084298; }
.badge-active { background: #d1e7dd; color: #0a3622; }
.badge-rejected { background: #f8d7da; color: #842029; }

/* ── Upload zone ── */
.upload-zone {
  border: 3px dashed #a8d5a2;
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #f9fdf9;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--green);
  background: #e8f5e9;
}
.upload-zone .upload-icon { font-size: 4rem; color: #a8d5a2; }

/* ── Moderation table ── */
.mod-img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }

/* ── Sidebar LK ── */
.lk-sidebar .nav-link { color: #444; border-radius: 8px; padding: 10px 14px; }
.lk-sidebar .nav-link:hover, .lk-sidebar .nav-link.active {
  background: #e8f5e9; color: var(--green-dark); font-weight: 600;
}

/* ── Buyer type badge ── */
.badge-wholesale { background: #0d6efd; color: #fff; font-size: .7rem; }
.badge-retail { background: #6c757d; color: #fff; font-size: .7rem; }

/* ── Promo slider ── */
.promo-slide { padding: 24px 0; }
.promo-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .8; margin-bottom: 4px; }
.promo-title { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.promo-sub { font-size: .85rem; opacity: .85; margin-top: 4px; }
.promo-emoji { font-size: 5rem; margin-left: auto; opacity: .35; user-select: none; }
@media (max-width: 576px) {
  .promo-title { font-size: 1.1rem; }
  .promo-emoji { font-size: 3rem; }
}

/* ── Category cards (homepage grid) ── */
.cat-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 12px; border-radius: 16px; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.07); text-align: center;
  transition: transform .18s, box-shadow .18s; cursor: pointer;
  border: 1.5px solid transparent; min-height: 120px;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.13); border-color: #a8d5a2; }
.cat-card-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 8px; }
.cat-card-name { font-size: .82rem; font-weight: 700; color: #1a472a; line-height: 1.2; }
.cat-card-count { font-size: .7rem; color: #999; margin-top: 4px; }
@media (max-width: 576px) {
  .cat-card { min-height: 90px; padding: 14px 8px; }
  .cat-card-icon { font-size: 1.8rem; }
  .cat-card-name { font-size: .75rem; }
}

/* ── Quick register cards ── */
.quick-card { border-radius: 16px; padding: 20px 24px; }

/* ── Category chips (horizontal scroll) ── */
.cat-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  white-space: nowrap; padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid #dde; background: #fff; color: #444;
  font-size: .82rem; font-weight: 500; text-decoration: none;
  transition: all .15s; flex-shrink: 0;
}
.cat-chip:hover { background: #e8f5e9; border-color: var(--green); color: var(--green-dark); }
.cat-chip.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ── Product name clamp ── */
.prod-name {
  font-size: .85rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.3em;
}

/* ── Add to cart button ── */
.add-cart-btn { font-size: .8rem; }

/* ── Favourite button hover ── */
.fav-btn:hover { background: #fff !important; }
.fav-btn .bi-heart-fill { color: #dc3545; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ai-chat { width: 300px; }
  .hero h1 { font-size: 1.4rem; }
  .product-card .card-img-top { height: 140px; }
  .product-card .no-image { height: 140px; font-size: 2.5rem; }
  .price-badge { font-size: .95rem; }
}
