/* ============================================================
   CartLeaf — "morning market" design system
   Display: Fraunces · UI: Plus Jakarta Sans
   ============================================================ */

:root {
  /* leafy greens (brand) */
  --green-900: #0d3b24;
  --green-800: #114a2d;
  --green-700: #176b3a;
  --green-600: #1b8a4b; /* primary */
  --green-500: #22a35a;
  --green-100: #e7f4ec;
  --green-50: #f1f9f4;

  /* warm mango CTA */
  --cta: #ff7a1a;
  --cta-hover: #f06b06;
  --cta-soft: #fff1e4;

  /* organic accent (olive leaf) */
  --organic: #5a8f2a;
  --organic-dark: #487023;
  --organic-soft: #eef6e0;

  /* sale / discount */
  --berry: #e23744;

  /* neutrals */
  --bg: #fbfaf6;
  --surface: #ffffff;
  --ink: #16241c;
  --muted: #61716a;
  --faint: #8a978f;
  --line: #e9e7dd;
  --line-strong: #dddacd;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 28, 0.06), 0 2px 8px rgba(16, 40, 28, 0.04);
  --shadow-md: 0 6px 22px rgba(16, 40, 28, 0.1);
  --shadow-lg: 0 18px 50px rgba(16, 40, 28, 0.18);

  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  --maxw: 1180px;
  --nav-h: 64px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font-family: inherit;
  cursor: pointer;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}
.muted {
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ----------------------------- buttons ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: var(--green-600);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-700);
}
.btn-cta {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 122, 26, 0.32);
}
.btn-cta:hover {
  background: var(--cta-hover);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--green-600);
  color: var(--green-700);
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
}
.badge-organic {
  background: var(--organic-soft);
  color: var(--organic-dark);
}
.badge-sale {
  background: #fdecec;
  color: var(--berry);
}

/* ----------------------------- navbar ----------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-top {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--nav-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--green-500), var(--green-700));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  color: var(--green-800);
  letter-spacing: -0.02em;
}
.brand-name b {
  color: var(--cta);
  font-weight: 600;
}
.deliver-pill {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-800);
  background: var(--green-100);
  border-radius: 999px;
  padding: 6px 12px;
}
.deliver-pill svg {
  width: 15px;
  height: 15px;
}
.nav-search {
  flex: 1;
  position: relative;
  min-width: 0;
}
.nav-search input {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 0 16px 0 42px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.nav-search input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100);
}
.nav-search .si {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--faint);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--ink);
}
.icon-btn:hover {
  background: var(--green-50);
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}
.cart-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--cta);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}
.nav-auth {
  display: none;
  gap: 8px;
  align-items: center;
}
.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 10px;
}
.nav-link:hover {
  background: var(--green-50);
  color: var(--green-700);
}

/* category strip under nav */
.cat-strip {
  border-top: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar {
  display: none;
}
.cat-strip-inner {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.cat-chip {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.cat-chip:hover,
.cat-chip.active {
  background: var(--green-100);
  color: var(--green-800);
}

/* ----------------------------- hero ----------------------------- */
.hero {
  margin: 18px 0 8px;
}
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--green-700), var(--green-600) 60%, var(--green-500));
  color: #fff;
  padding: 30px 24px;
  box-shadow: var(--shadow-md);
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
}
.hero-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 46px);
  margin: 8px 0 10px;
  max-width: 16ch;
}
.hero p {
  margin: 0 0 18px;
  opacity: 0.92;
  max-width: 42ch;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero .btn-cta {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ----------------------------- sections ----------------------------- */
.section {
  margin: 30px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.section-head h2 {
  font-size: clamp(20px, 4vw, 27px);
}
.section-head .eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-600);
  display: block;
  margin-bottom: 3px;
}
.see-all {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-700);
  flex-shrink: 0;
}

/* category group block */
.cat-group + .cat-group {
  margin-top: 26px;
}
.cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-tile {
  flex: 1 1 130px;
  max-width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 10px 12px;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.cat-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-100);
}
.cat-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  font-size: 44px;
  line-height: 1;
  margin-bottom: 10px;
  background: var(--green-100, #f1f7f2);
  border-radius: 14px;
}
.cat-tile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 0 10px;
  display: block;
}
.cat-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

/* ----------------------------- product grid ----------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--green-50);
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-media img {
  transform: scale(1.05);
}
.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}
.card-body {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.card-cat {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green-600);
}
.card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.card-unit {
  font-size: 12px;
  color: var(--faint);
}
.card-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.price-now {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
.price-was {
  font-size: 12.5px;
  color: var(--faint);
  text-decoration: line-through;
}
.add-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--green-600);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  transition: background 0.15s, transform 0.08s;
}
.add-btn:hover {
  background: var(--green-700);
}
.add-btn:active {
  transform: scale(0.92);
}
.add-btn svg {
  width: 20px;
  height: 20px;
}
.add-btn.added {
  background: var(--cta);
}

/* loader for infinite scroll */
.scroll-loader {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--green-100);
  border-top-color: var(--green-600);
  border-radius: 50%;
  margin: 0 auto 8px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----------------------------- product detail ----------------------------- */
.pd {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 22px 0;
}
.pd-gallery {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pd-main-img {
  aspect-ratio: 1 / 1;
  background: var(--green-50);
}
.pd-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pd-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
}
.pd-thumbs img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
}
.pd-thumbs img.active {
  border-color: var(--green-500);
}
.pd-info h1 {
  font-size: clamp(24px, 5vw, 34px);
  margin-bottom: 6px;
}
.pd-cat {
  color: var(--green-600);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0;
}
.pd-price {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--ink);
}
.pd-mrp {
  font-size: 17px;
  color: var(--faint);
  text-decoration: line-through;
}
.pd-unit {
  font-size: 14px;
  color: var(--muted);
}
.pd-desc {
  color: var(--muted);
  line-height: 1.65;
  margin: 12px 0 18px;
}

/* the signature: regular / organic switch */
.variant-switch {
  margin: 18px 0;
}
.variant-switch-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.seg {
  display: inline-flex;
  background: var(--green-50);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  position: relative;
  gap: 2px;
}
.seg-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 9px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s;
}
.seg-btn .leaf {
  font-size: 15px;
}
.seg-btn[aria-pressed="true"] {
  color: #fff;
}
.seg-btn[data-variant="regular"][aria-pressed="true"] {
  background: var(--green-600);
}
.seg-btn[data-variant="organic"][aria-pressed="true"] {
  background: var(--organic);
}
.organic-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--organic-dark);
  background: var(--organic-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: none;
}
.organic-note.show {
  display: block;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.qty button {
  width: 40px;
  height: 44px;
  border: none;
  background: var(--surface);
  font-size: 20px;
  color: var(--green-700);
  font-weight: 700;
}
.qty button:hover {
  background: var(--green-50);
}
.qty span {
  min-width: 40px;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
}
.pd-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
}
.pd-meta {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
  display: grid;
  gap: 10px;
}
.pd-meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--muted);
}
.pd-meta-row svg {
  width: 18px;
  height: 18px;
  color: var(--green-600);
  flex-shrink: 0;
}

/* ----------------------------- sticky cart drawer ----------------------------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 30, 20, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
  z-index: 90;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 100%);
  background: var(--surface);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}
.drawer.open {
  transform: translateX(0);
}
/* Desktop: the open drawer docks beside the page instead of covering it —
   content shifts left so shoppers can keep adding products with the cart
   in view. Mobile keeps the bottom sheet + backdrop. */
@media (min-width: 641px) {
  body {
    transition: padding-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  body.drawer-open {
    padding-right: 420px;
  }
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 {
  font-size: 19px;
}
.drawer-close {
  background: var(--green-50);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
}
.drawer-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.drawer-empty .emoji {
  font-size: 46px;
  margin-bottom: 10px;
}
.cart-line {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--green-50);
  flex-shrink: 0;
}
.cart-line-info {
  flex: 1;
  min-width: 0;
}
.cart-line-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}
.cart-line-variant {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--organic-dark);
  text-transform: uppercase;
}
.cart-line-variant.reg {
  color: var(--green-600);
}
.cart-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.mini-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.mini-qty button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--green-700);
  font-weight: 700;
}
.mini-qty span {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}
.cart-line-price {
  font-weight: 800;
  font-size: 14px;
}
.line-remove {
  background: none;
  border: none;
  color: var(--faint);
  font-size: 12px;
  padding: 0;
  margin-top: 4px;
}
.line-remove:hover {
  color: var(--berry);
}
.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface);
}
.drawer-total {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  margin-bottom: 4px;
}
.drawer-total.grand {
  font-weight: 800;
  font-size: 18px;
  margin: 8px 0 14px;
}
.free-ship-hint {
  font-size: 12.5px;
  color: var(--organic-dark);
  background: var(--organic-soft);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

/* ----------------------------- add-to-cart toast (mobile) ----------------------------- */
.cart-toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 110;
  display: none;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: #fff;
  padding: 10px 10px 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.cart-toast-msg {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.cart-toast-action {
  background: var(--green-600);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ----------------------------- drawer -> bottom sheet (mobile) ----------------------------- */
.drawer-handle {
  display: none;
}
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
@media (max-width: 640px) {
  .cart-toast {
    display: flex;
  }
  .cart-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }
  .drawer {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 80dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .drawer.open {
    transform: translateY(0);
  }
  .drawer-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--line-strong);
    margin: 10px auto 0;
    flex-shrink: 0;
  }
}

/* ----------------------------- forms / auth ----------------------------- */
.auth-wrap {
  max-width: 420px;
  margin: 40px auto;
  padding: 0 16px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}
.auth-card h1 {
  font-size: 27px;
  margin-bottom: 4px;
}
.auth-card .sub {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 14px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100);
}
.field textarea {
  resize: vertical;
  min-height: 80px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-msg {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  display: none;
}
.form-msg.error[hidden],
.form-msg.success[hidden] {
  display: none;
}
.form-msg.error {
  display: block;
  background: #fdecec;
  color: var(--berry);
}
.form-msg.success {
  display: block;
  background: var(--green-100);
  color: var(--green-800);
}
.auth-alt {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.auth-alt a {
  color: var(--green-700);
  font-weight: 700;
}

/* flash toasts */
.flash-stack {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, 92vw);
}
.flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: flashIn 0.25s ease;
}
.flash.success {
  background: var(--green-700);
  color: #fff;
}
.flash.error {
  background: var(--berry);
  color: #fff;
}
@keyframes flashIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ----------------------------- cart / checkout pages ----------------------------- */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 22px 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.panel h2 {
  font-size: 20px;
  margin-bottom: 14px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 14.5px;
}
.summary-row.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 800;
  font-size: 18px;
}
.cart-page-line {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-page-line img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--green-50);
}

/* ----------------------------- static / legal pages ----------------------------- */
.doc {
  max-width: 760px;
  margin: 30px auto;
}
.doc h1 {
  font-size: clamp(28px, 6vw, 40px);
  margin-bottom: 6px;
}
.doc .updated {
  color: var(--faint);
  font-size: 13px;
  margin-bottom: 24px;
}
.doc h2 {
  font-size: 21px;
  margin: 26px 0 8px;
}
.doc p,
.doc li {
  color: var(--muted);
  line-height: 1.7;
}
.doc ul {
  padding-left: 20px;
}

/* ----------------------------- admin ----------------------------- */
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 18px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--green-800);
  margin-top: 4px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 600px;
}
table.data th {
  text-align: left;
  padding: 12px 14px;
  background: var(--green-50);
  color: var(--green-800);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:hover td {
  background: var(--green-50);
}
.thumb-sm {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}
.status-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  background: var(--green-100);
  color: var(--green-800);
}

/* ----------------------------- admin: order detail expand ----------------------------- */
.order-toggle {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-700);
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
.order-toggle:hover {
  border-color: var(--green-500);
  background: var(--green-50);
}
.order-detail-row td {
  background: var(--green-50);
  padding: 18px 20px;
}
.order-detail {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.order-detail h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-800);
  margin: 0 0 10px;
}
.order-item-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.order-item-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.order-item-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.order-detail-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  height: fit-content;
}
@media (max-width: 767px) {
  .order-detail {
    grid-template-columns: 1fr;
  }
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab.active {
  color: var(--green-700);
  border-bottom-color: var(--green-600);
}
.variant-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--green-50);
}
.variant-editor h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----------------------------- delivery slot picker ----------------------------- */
.delivery-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.delivery-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.delivery-slot:hover {
  border-color: var(--green-500);
}
.delivery-slot:has(input:checked) {
  border-color: var(--green-600);
  background: var(--green-50);
  box-shadow: 0 0 0 3px var(--green-100);
}
.delivery-slot input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--green-600);
}
.delivery-slot-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.delivery-slot-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
}
.delivery-slot-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.delivery-slot-price {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--ink);
  flex-shrink: 0;
}
.delivery-slot-price.free {
  color: var(--green-600);
}

/* ----------------------------- footer ----------------------------- */
.footer {
  background: var(--green-900);
  color: #d6e6db;
  margin-top: 50px;
  padding: 40px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 20px;
}
.footer h4 {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-weight: 800;
}
.footer a {
  display: block;
  color: #b9d0c1;
  font-size: 14px;
  padding: 4px 0;
}
.footer a:hover {
  color: #fff;
}
.footer-brand {
  grid-column: 1 / -1;
}
.footer-brand .brand-name {
  color: #fff;
}
.footer-brand p {
  color: #9fbcaa;
  font-size: 14px;
  max-width: 36ch;
  margin: 10px 0 0;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 28px;
  padding-top: 18px;
  font-size: 13px;
  color: #8fac9c;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* mobile bottom tab bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 14px;
  position: relative;
}
.tabbar a.active {
  color: var(--green-700);
}
.tabbar svg {
  width: 23px;
  height: 23px;
}
.tabbar .cart-count {
  top: -2px;
  right: 6px;
}
.body-pad {
  padding-bottom: 72px;
}

/* ----------------------------- responsive ----------------------------- */
@media (min-width: 560px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 768px) {
  .deliver-pill {
    display: inline-flex;
  }
  .nav-auth {
    display: flex;
  }
  .tabbar {
    display: none;
  }
  .body-pad {
    padding-bottom: 0;
  }
  .pd {
    grid-template-columns: 1.05fr 1fr;
    align-items: start;
  }
  .pd-gallery {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
  .checkout-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
  .footer-brand {
    grid-column: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
}
