html { scroll-behavior: smooth; scroll-padding-top: 9rem; }
body { -webkit-font-smoothing: antialiased; }

/* Hide scrollbars on horizontal strips */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== Trust pills ===== */
.trust-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 500; color: #4b5563;
  background: #f7f8f9; border: 1px solid #e7e9ec;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  white-space: nowrap;
}
.trust-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #1f6f4f; }

/* ===== Category nav ===== */
#cat-nav li { display: inline-block; }
#cat-nav button {
  padding: 0.65rem 0.85rem;
  color: #374151;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  font-size: 0.83rem;
}
#cat-nav button:hover { color: #175c41; }
#cat-nav button.active { color: #114a35; border-bottom-color: #1f6f4f; font-weight: 600; }

/* ===== Category tiles ===== */
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid #e7e9ec;
  border-radius: 0.5rem;
  background: white;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.cat-tile:hover { border-color: #1f6f4f; background: #f7faf8; }
.cat-tile .ico {
  width: 48px; height: 48px;
  border-radius: 0.5rem;
  background: #eff5f1;
  color: #114a35;
  display: grid; place-items: center;
}
.cat-tile .nm { font-size: 0.78rem; font-weight: 600; color: #1f2937; line-height: 1.1; }

/* ===== Shelves ===== */
.shelf { background: white; border: 1px solid #e7e9ec; border-radius: 0.5rem; padding: 1rem; }
.shelf-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.shelf-head h2 { font-size: 1.05rem; font-weight: 700; color: #111827; }
.shelf-link {
  font-size: 0.78rem; color: #175c41; font-weight: 600;
}
.shelf-link:hover { text-decoration: underline; }
.shelf-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}
.shelf-track::-webkit-scrollbar { height: 8px; }
.shelf-track::-webkit-scrollbar-thumb { background: #d3d7dd; border-radius: 8px; }
.shelf-track > * { scroll-snap-align: start; }
@media (min-width: 640px) { .shelf-track { grid-auto-columns: 240px; } }

/* ===== Product card ===== */
.prod-card {
  position: relative;
  background: white;
  border: 1px solid #e7e9ec;
  border-radius: 0.5rem;
  padding: 0.7rem;
  display: flex; flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.prod-card:hover { border-color: #aab0b8; box-shadow: 0 4px 12px -6px rgba(17,24,39,.12); }

.prod-img {
  position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  background: #fafafa;
  border-radius: 0.4rem;
  display: grid; place-items: center;
  overflow: hidden;
}
.prod-img svg { max-width: 78%; max-height: 78%; }
.prod-img .prod-photo {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 8%;
}

.prod-tags {
  position: absolute; top: 6px; left: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.tag {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.18rem 0.4rem; border-radius: 0.25rem;
  background: #fff7e6; color: #92400e; border: 1px solid #fde3a7;
}
.tag.green { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.tag.blue  { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.prod-brand { font-size: 0.68rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.prod-name {
  font-size: 0.86rem; font-weight: 600; color: #111827;
  line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.15rem;
}
.prod-meta { font-size: 0.72rem; color: #6b7280; }
.prod-price { font-size: 1rem; font-weight: 800; color: #114a35; line-height: 1; }
.prod-price-unit { font-size: 0.7rem; font-weight: 500; color: #6b7280; }

/* Pack size pills */
.pack-row {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
}
.pack-btn {
  font-size: 0.72rem; font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  border: 1px solid #d3d7dd;
  background: white; color: #374151;
  cursor: pointer;
  transition: all .12s;
}
.pack-btn:hover { border-color: #1f6f4f; }
.pack-btn.active { background: #114a35; color: white; border-color: #114a35; }

/* Quantity stepper */
.qty {
  display: inline-flex; align-items: center;
  border: 1px solid #d3d7dd; border-radius: 0.3rem;
  background: white; height: 32px;
}
.qty button {
  width: 28px; height: 100%;
  display: grid; place-items: center;
  font-weight: 700; color: #374151;
  background: transparent;
}
.qty button:hover { background: #f7f8f9; color: #114a35; }
.qty input {
  width: 36px; height: 100%;
  border: 0; background: transparent;
  text-align: center; font-weight: 600;
  font-size: 0.85rem; color: #111827;
  outline: none; -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.add-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  height: 32px;
  background: #f0a839;
  color: #0a2e21;
  font-size: 0.78rem; font-weight: 700;
  border-radius: 0.3rem;
  transition: background .12s;
}
.add-btn:hover { background: #d68a1d; }
.add-btn.in-cart { background: #1f6f4f; color: white; }
.add-btn.in-cart:hover { background: #175c41; }

/* Bottom action row of card */
.prod-actions { display: flex; align-items: center; gap: 0.4rem; }

/* Pricing note */
.pricing-note { font-size: 0.65rem; color: #6b7280; font-style: italic; }

/* ===== Filter chips (for All Products) ===== */
.chip {
  font-size: 0.78rem; font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #d3d7dd;
  background: white; color: #4b5563;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { border-color: #1f6f4f; color: #114a35; }
.chip.active {
  background: #114a35; border-color: #114a35; color: white;
}

/* ===== Form fields ===== */
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label {
  font-size: 0.78rem; font-weight: 600;
  color: #1f2937;
}
.field input, .field textarea {
  width: 100%;
  background: white;
  border: 1px solid #d3d7dd;
  border-radius: 0.375rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  color: #111827;
  outline: none;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.field input::placeholder, .field textarea::placeholder { color: #9ca3af; }
.field input:focus, .field textarea:focus {
  border-color: #1f6f4f;
  box-shadow: 0 0 0 3px rgba(31,111,79,0.15);
}
.field.invalid input, .field.invalid textarea {
  border-color: #dc2626; background: #fef2f2;
}
.field .error { display: none; font-size: 0.72rem; color: #dc2626; font-weight: 500; }
.field.invalid .error { display: block; }

/* ===== How it works ===== */
.step-card {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid #e7e9ec;
  border-radius: 0.5rem;
}
.step-num {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #114a35; color: white;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700;
}

/* ===== Drawer / modal helpers ===== */
#basket-drawer.open { transform: translateX(0); }
#basket-overlay.open, #pdp-overlay.open { opacity: 1; }
#pdp-modal.open { display: flex; }
#pdp-card.open { opacity: 1; transform: scale(1); }

#basket-empty.show { display: flex; }

/* ===== Toast ===== */
#toast.show { display: block; animation: rise .2s ease-out; }
@keyframes rise {
  from { transform: translate(-50%, 8px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

body.no-scroll { overflow: hidden; }

/* ===== Product detail modal ===== */
.pdp-grid { display: grid; gap: 1.5rem; padding: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .pdp-grid { grid-template-columns: 1fr 1fr; padding: 2rem; } }
.pdp-img {
  background: #fafafa; border-radius: 0.5rem;
  aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid #e7e9ec;
}
.pdp-img svg { max-width: 70%; max-height: 70%; }
.pdp-img .prod-photo { width: 100%; height: 100%; object-fit: contain; padding: 6%; }

/* Basket row */
.basket-row {
  display: flex; gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e7e9ec;
  border-radius: 0.5rem;
  background: white;
}
.basket-row .b-img {
  flex: none;
  width: 56px; height: 56px;
  border-radius: 0.375rem;
  background: #fafafa;
  display: grid; place-items: center;
  border: 1px solid #e7e9ec;
}
.basket-row .b-img svg { max-width: 80%; max-height: 80%; }
.basket-row .b-img .prod-photo { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* Mobile: bottom padding so sticky basket button doesn't overlap content */
@media (max-width: 767px) {
  body { padding-bottom: 5rem; }
}
