:root {
  --ink: #191714;
  --muted: #6d665f;
  --paper: #fdf6e8;
  --surface: #fffdf7;
  --line: #e6d9c0;
  --green: #0d4f38;
  --green-dark: #0a3d2b;
  --red: #c44631;
  --blue: #2f63b7;
  --yellow: #f0b84f;
  --shadow: 0 20px 60px rgba(36, 20, 8, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(200, 169, 110, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(200, 169, 110, 0.12) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(253, 246, 232, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
}

.icon-box {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-links a,
.cart-button,
.quick-prompts button,
.category-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 94px;
  padding: 0 12px;
  font-weight: 800;
}

.cart-button strong {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 13px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 120px);
  padding: 44px 0 24px;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(253, 246, 232, 0.96), rgba(253, 246, 232, 0.80)),
    repeating-linear-gradient(90deg, rgba(240, 184, 79, 0.28) 0 16px, rgba(13, 79, 56, 0.14) 16px 32px, rgba(200, 169, 110, 0.18) 32px 48px);
  box-shadow: var(--shadow);
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.intro-copy p:not(.eyebrow) {
  max-width: 590px;
  color: #3e3933;
  font-size: 18px;
  line-height: 1.65;
}

.finder-panel,
.cart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.finder-panel {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: 22px;
}

.finder-head,
.section-title,
.cart-header,
.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #e5f4ec;
  font-size: 12px;
  font-weight: 800;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 22px 0 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 12px 14px;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(21, 122, 91, 0.12);
}

.search-box button,
.place-order,
.product-card button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.search-box button {
  min-width: 86px;
  min-height: 48px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompts button,
.category-tabs button {
  padding: 0 12px;
  color: #403a34;
  background: #fffaf0;
  font-size: 13px;
  font-weight: 700;
}

.nav-links a:hover,
.cart-button:hover,
.quick-prompts button:hover,
.category-tabs button:hover {
  transform: translateY(-1px);
  border-color: var(--green);
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
  max-height: 360px;
  margin-top: 16px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f5ef;
}

.message {
  width: min(92%, 520px);
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.5;
}

.message p {
  margin: 5px 0 0;
}

.message.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--blue);
}

.suggestion-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.suggestion button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.shop-tools {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 18px;
  align-items: end;
  padding: 30px 0 18px;
}

.search-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.category-tabs button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.catalog-section {
  padding: 18px 0 38px;
}

.section-title {
  margin-bottom: 18px;
}

.section-title p:last-child {
  color: var(--muted);
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  grid-template-rows: 150px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(36, 28, 18, 0.08);
}

.product-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--card-color, var(--green));
}

.product-visual .cat-icon {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}

.product-body {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 14px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-body h3 {
  min-height: 44px;
  line-height: 1.25;
}

.product-body p {
  flex: 1;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.price-row strong {
  font-size: 20px;
}

.product-card button {
  min-height: 42px;
  padding: 0 12px;
}

.trust-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 0 56px;
}

.trust-band article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trust-band p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  background: rgba(25, 23, 20, 0);
  transition: visibility 160ms ease, background 160ms ease;
}

.cart-drawer.open {
  visibility: visible;
  background: rgba(25, 23, 20, 0.46);
}

.cart-panel {
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  height: 100%;
  padding: 20px;
  overflow: auto;
  border-radius: 0;
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.cart-drawer.open .cart-panel {
  transform: translateX(0);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.cart-line h4 {
  margin: 0 0 5px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}

.cart-empty {
  display: none;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.cart-empty.show {
  display: block;
}

.checkout-form {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.checkout-form label,
.checkout-form legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkout-form fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checkout-form fieldset label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 600;
}

.checkout-form input[type="radio"] {
  width: auto;
  min-height: 0;
}

.cart-total {
  margin-top: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.cart-total strong {
  font-size: 24px;
}

.place-order {
  min-height: 50px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* ─── Unit label & stock badge ───────────────────────────────────────────── */

.unit-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.stock-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5f4ec;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
}

/* ─── Chat extras ─────────────────────────────────────────────────────────── */

.kit-total {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--green-dark);
}

.add-all-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

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

/* ─── Order confirmation overlay ──────────────────────────────────────────── */

.order-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(25, 23, 20, 0.58);
  padding: 20px;
  animation: fadeIn 160ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.order-modal {
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
  padding: 32px 28px;
  box-shadow: 0 32px 80px rgba(25, 23, 20, 0.22);
  text-align: center;
  animation: slideUp 180ms ease;
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.order-success-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: #e5f4ec;
  color: var(--green-dark);
  font-size: 28px;
  font-weight: 900;
  margin: 0 auto 16px;
}

.order-id {
  color: var(--muted);
  font-size: 13px;
}

.payment-section {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f5ef;
}

.payment-section h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.upi-id-box {
  display: inline-block;
  padding: 8px 16px;
  margin: 10px 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.upi-qr {
  display: block;
  margin: 12px auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.pay-amount {
  font-size: 18px;
  margin: 6px 0 4px;
}

.pay-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 13px 22px;
  border-radius: 10px;
  background: #25d366;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  transition: background 160ms ease;
}

.whatsapp-btn:hover {
  background: #1ebe5c;
}

.close-order-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.close-order-btn:hover {
  background: #f8f5ef;
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  max-width: min(420px, calc(100% - 28px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .command-center,
  .shop-tools,
  .trust-band {
    grid-template-columns: 1fr;
  }

  .command-center {
    min-height: auto;
  }

  .intro-copy,
  .finder-panel {
    min-height: auto;
  }

  .category-tabs {
    justify-content: flex-start;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    padding: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand strong {
    display: block;
    max-width: 168px;
  }

  .command-center {
    padding-top: 22px;
  }

  h1 {
    font-size: 38px;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .section-title,
  .finder-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-rows: 132px auto;
  }
}
