/* ============================================================
   Pages — home, product details, cart, checkout, orders, profile
   ============================================================ */

/* Checkout page: hide the top delivery headers (they're already shown
   inside the address card on the Checkout page). Applied only when
   the router-set data-route attribute equals "checkout" so all other
   pages keep the top address / delivering-from bars visible. */
html[data-route="checkout"] #appbar,
html[data-route="checkout"] #delivering-from {
  display: none !important;
}


/* Home hero greeting */
.hero-strip {
  padding: 8px 4px 4px;
}
.hero-strip .hi {
  font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink);
}
.hero-strip .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Search bar on home */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 14px;
  margin: 14px 2px;
  box-shadow: var(--sh-1);
}
.search-bar svg { color: var(--muted); width: 20px; height: 20px; flex-shrink: 0; }
.search-bar input { flex: 1; border: 0; background: transparent; outline: 0; font: inherit; color: var(--ink); }

/* Grid of small circles for offers */
.offer-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px;
}
.offer-card {
  padding: 14px; border-radius: var(--r-md); color: white;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-700));
  min-height: 96px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--sh-1);
}
.offer-card.saffron { background: linear-gradient(135deg, var(--saffron-600), var(--saffron)); color: var(--maroon-700); }
.offer-card .title { font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.15; }
.offer-card .sub { font-size: 12px; opacity: .9; }

/* Product details */
.pd-hero { position: relative; }
.pd-hero img { width: 100%; height: 280px; object-fit: cover; border-radius: var(--r-lg); }
.pd-hero .placeholder {
  width: 100%; height: 280px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--saffron-100), var(--cream-2));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 60px; color: var(--maroon);
}
.pd-back {
  position: absolute; left: 14px; top: 14px;
  background: var(--surface); border-radius: 50%; width: 40px; height: 40px;
  display: grid; place-items: center; box-shadow: var(--sh-1);
}
.pd-title { margin-top: 16px; }
.pd-title h1 { font-size: 26px; }
.pd-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pd-desc { color: var(--ink-2); margin-top: 10px; font-size: 14px; }

.pd-group {
  margin-top: 20px; padding: 14px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--sh-1);
}
.pd-group h3 { margin-bottom: 8px; }
.opt-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.opt-row:last-child { border-bottom: 0; }
.opt-row label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.opt-row .price { font-weight: 700; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--maroon); width: 18px; height: 18px; }

/* Cart summary */
.summary { padding: 14px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--ink-2); }
.summary .row.total { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 6px; font-weight: 800; color: var(--ink); font-size: 16px; }
.summary .row.saved { color: var(--success); font-weight: 600; }

/* Cart item */
.ci {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 12px;
  padding: 12px; border-radius: var(--r-md); background: var(--surface);
  margin-bottom: 10px; box-shadow: var(--sh-1);
  align-items: center;
}
.ci .thumb { width: 60px; height: 60px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.ci .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ci .name { font-weight: 700; font-size: 14px; }
.ci .variant { font-size: 12px; color: var(--muted); }
.ci .line-total { font-weight: 800; color: var(--ink); font-size: 14px; margin-top: 4px; }

/* Offer coupon input row */
.coupon-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.coupon-row input { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; text-transform: uppercase; }

/* Payment method */
.pay-choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0;
}
.pay-choice label {
  padding: 14px; border-radius: var(--r-md); border: 2px solid var(--line);
  background: var(--surface); text-align: center; font-weight: 700; cursor: pointer;
  transition: all .2s var(--ease);
}
.pay-choice label.on { border-color: var(--maroon); background: var(--surface-2); }
.pay-choice input { display: none; }

/* Order card in list */
.order-card {
  padding: 14px; border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--sh-1); margin-bottom: 10px;
}
.order-card .top { display: flex; justify-content: space-between; align-items: center; }
.order-card .code { font-family: var(--font-display); font-weight: 700; }
.order-card .status {
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  background: var(--saffron-100); color: var(--maroon-700);
}
.order-card .status.done { background: #dceee2; color: var(--success); }
.order-card .status.cancel { background: #fadbd6; color: var(--danger); }
.order-card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.order-card .amount { font-weight: 800; margin-top: 8px; }

/* Profile menu */
.profile-hero {
  padding: 24px 14px 16px; text-align: center;
  background: linear-gradient(180deg, var(--maroon), var(--maroon-700));
  color: white; margin: -12px -14px 12px;
  border-bottom-left-radius: var(--r-xl); border-bottom-right-radius: var(--r-xl);
}
.profile-hero .name { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.profile-hero .phone { opacity: .8; font-size: 13px; }
.profile-hero .points-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; background: var(--saffron); color: var(--maroon-700);
  padding: 6px 14px; border-radius: var(--r-pill); font-weight: 800; font-size: 13px;
}

.menu-list .item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--surface); margin-bottom: 8px; box-shadow: var(--sh-1);
}
.menu-list .item svg { width: 20px; height: 20px; color: var(--maroon); }
.menu-list .item .caret { margin-left: auto; color: var(--muted); }

/* Category page filter chips row */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px; margin: 8px 0; }
.filter-chips::-webkit-scrollbar { display: none; }

/* ============================================================
   Checkout — premium redesign (UI only)
   ============================================================ */
.ck-page { animation: ck-fade .3s var(--ease); }
.ck-title { font-size: 28px; margin: 6px 2px 4px; }

.ck-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 18px;
  margin-top: 16px;
  width: 100%;
  text-align: left;
  display: block;
}
.ck-card-head { display: flex; align-items: center; gap: 10px; }
.ck-ic {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--maroon-100); color: var(--maroon);
}
.ck-ic svg { width: 19px; height: 19px; }
.ck-ic-success { background: rgba(46,125,79,.12); color: var(--success); }
.ck-card-label { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }

.ck-change {
  margin-left: auto; color: var(--maroon); font-weight: 700; font-size: 13px;
  padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--maroon-100);
  transition: background .2s var(--ease);
}
.ck-change:active { background: var(--maroon-100); }

.ck-addr-name { font-weight: 700; margin: 12px 0 2px; font-size: 15px; }
.ck-addr-text { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.ck-addr-branch {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
  color: var(--maroon); font-weight: 700; font-size: 13px;
}
.ck-branch-ic { width: 20px; height: 20px; display: grid; place-items: center; color: var(--maroon); }
.ck-branch-ic svg { width: 18px; height: 18px; }
.ck-dot { color: var(--muted); }
.ck-eta { color: var(--ink-2); font-weight: 600; }

/* Coupon */
.ck-coupon { display: flex; align-items: center; gap: 12px; }
.ck-tap { cursor: pointer; transition: transform .12s var(--ease), box-shadow .2s var(--ease); }
.ck-tap:active { transform: scale(.99); box-shadow: var(--sh-2); }
.ck-coupon-main { flex: 1; }
.ck-coupon-title { font-weight: 700; font-size: 15px; }
.ck-coupon-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ck-coupon.applied { border-color: rgba(46,125,79,.35); background: rgba(46,125,79,.05); animation: ck-pop .32s var(--ease); }
.ck-chev { color: var(--muted); display: grid; place-items: center; }
.ck-chev svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ck-remove { margin-left: auto; color: var(--danger); font-weight: 700; font-size: 13px; padding: 6px 10px; }

/* Reward */
.ck-reward-avail { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--saffron-600); background: var(--saffron-100); padding: 4px 10px; border-radius: var(--r-pill); }
.ck-reward-row { display: flex; gap: 10px; margin-top: 14px; }
.ck-reward-row input {
  flex: 1; min-width: 0; padding: 12px 14px; font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  transition: border-color .2s var(--ease);
}
.ck-reward-row input:focus { outline: none; border-color: var(--maroon); }
.ck-max { flex: none; padding: 10px 16px; }
.ck-reward-applied { margin-top: 10px; color: var(--success); font-weight: 700; font-size: 13.5px; animation: ck-pop .32s var(--ease); }
.ck-reward-hint { margin-top: 10px; color: var(--muted); font-size: 12.5px; }

/* Payment */
.ck-pay {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin-top: 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease);
}
.ck-pay input { display: none; }
.ck-pay-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; position: relative; transition: border-color .2s var(--ease); }
.ck-pay.on { border-color: var(--maroon); background: var(--maroon-100); }
.ck-pay.on .ck-pay-dot { border-color: var(--maroon); }
.ck-pay.on .ck-pay-dot::after { content:''; position: absolute; inset: 3px; border-radius: 50%; background: var(--maroon); animation: ck-pop .25s var(--ease); }
.ck-pay-main { display: flex; flex-direction: column; }
.ck-pay-title { font-weight: 700; font-size: 14.5px; }
.ck-pay-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.ck-pay-reason { color: var(--danger); font-size: 12px; margin-top: 2px; font-weight: 600; }
.ck-pay.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Bill details */
.ck-bill { margin-top: 14px; }
.ck-bill-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--ink-2); padding: 7px 0; }
.ck-bill-row.ck-saved span:last-child { color: var(--success); font-weight: 700; }
.ck-free { color: var(--success); font-weight: 800; letter-spacing: .04em; }
.ck-bill-sep { height: 1px; background: var(--line); margin: 8px 0; border-top: 1px dashed var(--line); }
.ck-bill-total { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.ck-bill-total span:first-child { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--ink); }
.ck-bill-total span:last-child { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--maroon); }

.ck-notice {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(197,63,46,.08); border: 1px solid rgba(197,63,46,.3);
  color: var(--danger); font-weight: 600; font-size: 13.5px;
}

/* Sticky bottom action */
.ck-sticky-spacer { height: 96px; }
.ck-sticky {
  position: fixed; left: 0; right: 0;
  bottom: 0;
  z-index: 60;
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(34,25,19,.10);
  animation: ck-slide-up .32s var(--ease);
}
.ck-sticky-total { display: flex; flex-direction: column; line-height: 1.2; }
.ck-sticky-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ck-sticky-amt { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink); }
.ck-place { flex: 1; padding: 15px 20px; font-size: 16px; }
.ck-place[disabled] { opacity: .5; box-shadow: none; filter: grayscale(.3); }
.ck-place-arrow { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.ck-place:active .ck-place-arrow { transform: translateX(3px); }
.ck-place.loading { pointer-events: none; }

/* Coupon sheet */
.cp-sheet { padding-bottom: 8px; }
.cp-row { display: flex; gap: 10px; }
.cp-row input {
  flex: 1; min-width: 0; padding: 13px 14px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  text-transform: uppercase;
}
.cp-row input:focus { outline: none; border-color: var(--maroon); }
.cp-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.cp-offer { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border: 1px dashed var(--maroon-100); border-radius: var(--r-md); background: var(--surface); transition: background .2s var(--ease); }
.cp-offer:active { background: var(--maroon-100); }
.cp-offer-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--saffron-100); color: var(--saffron-600); }
.cp-offer-ic svg { width: 18px; height: 18px; }
.cp-offer-main { flex: 1; }
.cp-offer-code { font-weight: 800; font-size: 14px; letter-spacing: .03em; }
.cp-offer-title { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.cp-offer-apply { color: var(--maroon); font-weight: 800; font-size: 12px; }
.cp-empty { color: var(--muted); text-align: center; padding: 16px; }

/* Staggered card entrance + micro animations */
.ck-anim { animation: ck-rise .38s var(--ease) both; }
.ck-anim:nth-child(1) { animation-delay: .02s; }
.ck-anim:nth-child(2) { animation-delay: .06s; }
.ck-anim:nth-child(3) { animation-delay: .10s; }
.ck-anim:nth-child(4) { animation-delay: .14s; }
.ck-anim:nth-child(5) { animation-delay: .18s; }
@keyframes ck-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ck-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ck-pop  { from { transform: scale(.8); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes ck-slide-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ck-anim, .ck-page, .ck-sticky { animation: none !important; }
}
