/* ============================================================
   Components — cards, chips, sheets, toasts, forms
   ============================================================ */

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.card-p { padding: 14px; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap;
}
.chip.active { background: var(--maroon); color: white; border-color: var(--maroon); }
.chip.saffron { background: var(--saffron-100); color: var(--maroon-700); border-color: var(--saffron-100); }
.chip.veg::before { content:''; width:10px; height:10px; border:1.5px solid var(--pistachio); display:inline-block; position:relative; }
.chip.veg::before { border-radius: 2px; }
.chip.veg::after  { content:''; width:5px; height:5px; background: var(--pistachio); border-radius:50%; display:inline-block; margin-left:-8px; }

/* Category horizontal */
.hstack-scroll {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 8px; margin: 0 -2px;
}
.hstack-scroll::-webkit-scrollbar { display: none; }
.hstack-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* Category card */
.cat-card {
  width: 88px; text-align: center; color: var(--ink);
}
.cat-card .thumb {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(180deg, var(--saffron-100), var(--cream-2));
  display: grid; place-items: center; overflow: hidden;
  box-shadow: var(--sh-1);
  border: 2px solid var(--surface);
  transition: transform .25s var(--ease);
}
.cat-card:hover .thumb, .cat-card:active .thumb { transform: scale(1.05) rotate(-2deg); }
.cat-card img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .thumb .letter {
  font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--maroon);
}
.cat-card .name { font-size: 12px; font-weight: 600; margin-top: 6px; line-height: 1.2; }

/* Product card (list style like Zomato) */
.prod-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 12px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--sh-1);
  margin-bottom: 12px;
  position: relative;
  transition: transform .12s var(--ease);
}
.prod-card:active { transform: scale(.99); }
.prod-card .thumb {
  width: 96px; height: 96px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2);
  display: grid; place-items: center;
}
.prod-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-card .thumb .placeholder {
  font-family: var(--font-display); font-weight: 800; color: var(--maroon); font-size: 30px;
}
.prod-card h3 { font-size: 16px; }
.prod-card .desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-card .price { margin-top: 6px; font-weight: 800; color: var(--ink); font-size: 15px; }
.prod-card .price .mrp { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: 12px; margin-left: 6px; }
.prod-card .meta { margin-top: 6px; font-size: 11px; color: var(--muted); display: flex; gap: 8px; }
.prod-card .add-btn {
  position: absolute; right: 14px; bottom: 14px;
  background: var(--surface); color: var(--maroon-700);
  border: 1px solid var(--maroon); font-weight: 800;
  padding: 6px 18px; border-radius: var(--r-pill);
  text-transform: uppercase; font-size: 12px; letter-spacing: .05em;
  box-shadow: var(--sh-1);
}
.prod-card .add-btn:active { transform: translateY(1px); }

/* Banner */
.banner {
  border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, var(--maroon), #a11c30);
  color: white; padding: 18px; position: relative;
  min-height: 132px;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--sh-2);
}
.banner::before {
  content: ""; position: absolute; right: -30px; top: -30px; width: 160px; height: 160px;
  background: radial-gradient(circle, var(--saffron) 0%, transparent 65%);
  opacity: .35;
}
.banner h3 { color: white; font-size: 22px; }
.banner p { margin-top: 4px; opacity: .9; font-size: 13px; }
.banner .badge {
  display: inline-block; margin-top: 10px; padding: 6px 12px;
  background: var(--saffron); color: var(--maroon-700); font-weight: 800;
  border-radius: var(--r-pill); font-size: 12px;
}

/* Shipping banner variant */
.banner.shipping {
  background: linear-gradient(135deg, #5f0e1c, var(--saffron-600));
}

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.1s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-line { height: 12px; margin: 6px 0; }
.skel-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: var(--surface);
  padding: 12px; border-radius: var(--r-md); margin-bottom: 12px; box-shadow: var(--sh-1); }
.skel-thumb { width: 96px; height: 96px; }

/* Empty state */
.empty {
  padding: 60px 20px; text-align: center; color: var(--muted);
}
.empty .emoji { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: var(--maroon); margin-bottom: 10px; }
.empty h3 { color: var(--ink); font-family: var(--font-display); font-size: 20px; }
.empty p { margin-top: 6px; }

/* ------------------------------------------------------------
   Bottom sheet
   ------------------------------------------------------------ */
.sheet-backdrop {
  position: fixed; inset: 0; background: var(--overlay);
  z-index: 90; opacity: 0; transition: opacity .25s var(--ease);
}
.sheet-backdrop.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  background: var(--surface); border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl);
  padding: 8px 0 calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .35s var(--ease);
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
.sheet.on { transform: translateY(0); }
.sheet-handle {
  width: 40px; height: 4px; background: var(--line);
  border-radius: 4px; margin: 8px auto 12px;
}
.sheet-header {
  padding: 4px 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.sheet-header h2 { font-family: var(--font-display); }
.sheet-body { padding: 12px 20px; }
.sheet-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center;
}
.sheet-close svg { width: 18px; height: 18px; }

/* Toasts */
.toast-host {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: var(--ink); color: var(--cream);
  padding: 10px 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--sh-2);
  animation: toastIn .25s var(--ease);
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } }

/* Sticky bottom cart bar */
.sticky-bar {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding: 12px 14px;
  z-index: 45;
  pointer-events: none;
}
.sticky-bar .inner {
  pointer-events: auto;
  max-width: var(--max-w); margin: 0 auto;
  background: var(--maroon); color: white;
  border-radius: var(--r-pill);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--sh-3);
}
.sticky-bar .count { font-weight: 700; }
.sticky-bar .cta { font-weight: 800; display: flex; align-items: center; gap: 4px; }

/* Forms */
.field {
  display: block; margin: 10px 0;
}
.field label { display:block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px;
  transition: border-color .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--maroon);
}
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.otp-inputs input {
  width: 44px; height: 54px; text-align: center; font-size: 22px; font-weight: 700;
  font-family: var(--font-display);
}

/* Row list */
.row-list .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.row-list .row:last-child { border-bottom: 0; }

/* Address item */
.addr-item {
  padding: 14px; border-radius: var(--r-md);
  background: var(--surface-2); margin-bottom: 10px;
  border: 2px solid transparent;
}
.addr-item.current { border-color: var(--maroon); background: var(--surface); }
.addr-item .label {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; color: var(--ink);
}
.addr-item .full { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.addr-item .status { color: var(--maroon); font-size: 12px; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.addr-item .actions { display: flex; gap: 6px; margin-top: 10px; }
.addr-item .actions button { font-size: 12px; padding: 6px 12px; }

/* Map container */
#map { height: 340px; width: 100%; border-radius: var(--r-md); overflow: hidden; }

/* Sticky Add To Cart on product details */
.sticky-add {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 60; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
}
.sticky-add .inner {
  max-width: var(--max-w); margin: 0 auto;
  background: var(--surface); border-radius: var(--r-pill); padding: 8px 8px 8px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: var(--sh-3);
}

/* Qty stepper */
.stepper {
  display: inline-flex; align-items: center; gap: 0;
  background: var(--surface); border: 1px solid var(--maroon);
  border-radius: var(--r-pill); overflow: hidden;
}
.stepper button {
  width: 36px; height: 36px; color: var(--maroon); font-weight: 800; font-size: 18px;
}
.stepper .val { min-width: 28px; text-align: center; font-weight: 800; color: var(--ink); }

/* Order status timeline */
.timeline { padding: 6px 4px; }
.timeline .step {
  display: flex; gap: 12px; padding: 8px 0; position: relative;
}
.timeline .step::before {
  content:''; position: absolute; left: 11px; top: 24px; bottom: -8px;
  width: 2px; background: var(--line);
}
.timeline .step:last-child::before { display: none; }
.timeline .dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line);
  display: grid; place-items: center; flex-shrink: 0; margin-top: 2px;
}
.timeline .step.done .dot { background: var(--pistachio); border-color: var(--pistachio); }
.timeline .step.done .dot::after { content:''; width: 8px; height: 8px; border-radius: 50%; background: white; }
.timeline .step.current .dot { background: var(--saffron); border-color: var(--saffron); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(242,160,61,.25); } }
.timeline .step .title { font-weight: 700; }
.timeline .step .time  { color: var(--muted); font-size: 12px; }


/* ------------------------------------------------------------
   Floating Cart — sits INSIDE .bottom-container above the nav.
   Uses max-height animation so it smoothly pushes the nav down.
   ------------------------------------------------------------ */
.floating-cart {
  position: relative;
  margin: 0 10px 6px 10px;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-700));
  color: white;
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(122, 22, 38, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;

  /* Collapsed state */
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 18px;
  padding-right: 14px;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition:
    max-height .3s var(--ease),
    padding .3s var(--ease),
    opacity .25s var(--ease),
    margin-bottom .3s var(--ease),
    transform .3s var(--ease);
}
.floating-cart.visible {
  max-height: 76px;
  padding-top: 12px;
  padding-bottom: 12px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 6px;
}
.floating-cart:active {
  transform: translateY(0) scale(0.99);
}

.fc-left {
  flex: 1;
  min-width: 0;
}
.fc-branch {
  font-size: 13px;
  font-weight: 700;
  opacity: .92;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-info {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.fc-dot { opacity: .55; }
.fc-total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--saffron);
}

.fc-cta {
  background: white;
  color: var(--maroon-700);
  font-weight: 800;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: transform .12s var(--ease);
}
.fc-cta svg { width: 14px; height: 14px; }
.fc-cta:active { transform: scale(0.96); }
