/* Customer pages (index.php, track.php). Shared parts are in base.css. Built for phones first. */
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }

/* ---------- Header with logo and tabs ---------- */
.site-head { background: var(--ink); color: #fff; }
.head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand chat" "tabs tabs";
  align-items: center;
  gap: 10px 12px;
  padding: 10px 0 12px;
}
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-decoration: none; }
.brand img { width: 52px; height: 52px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px #fff; background: #fff; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 1.22rem; line-height: 1.05; }
.head-chat {
  grid-area: chat; flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--wa); color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem;
}
.head-chat svg { width: 18px; height: 18px; flex: none; }
.head-chat:hover { background: var(--wa-dark); }
.tabs { grid-area: tabs; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, .1); }
.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent;
  color: #fff; font: inherit; font-weight: 700; font-size: 1.02rem; text-decoration: none; cursor: pointer;
}
.tab svg { width: 21px; height: 21px; flex: none; }
.tab:hover { background: rgba(255, 255, 255, .12); }
.tab[aria-selected="true"], .tab[aria-current="page"] { background: var(--yellow); color: var(--ink); }
.site-head :focus-visible { outline-color: #fff; }
@media (max-width: 359px) {
  .head-chat { padding: 9px; }
  .head-chat span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 860px) {
  .head { grid-template-columns: auto 1fr auto; grid-template-areas: "brand tabs chat"; padding: 10px 0; }
  .tabs { justify-self: center; width: 400px; }
}
.noscript { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 66px 0 30px;
  background: linear-gradient(165deg, #FFB43C 0%, #FF8F22 48%, #F46A1E 100%);
}
/* Prayer flags across the top: Om Mani Padme Hum in blue, white, red, green and yellow */
.bunting {
  position: absolute; top: 0; left: 0; right: 0; height: 54px;
  background: url(../prayer-flags.svg?v=1) repeat-x left top / auto 100%;
}
.hero-grid { display: grid; gap: 24px; }
.hero h1 {
  margin: 8px 0 10px;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.05rem, 8vw, 3.5rem); line-height: 1.02; letter-spacing: -.01em;
  color: var(--ink);
}
/* One sentence per line block, so the headline breaks at the full stop. */
.hero h1 span { display: block; text-wrap: balance; }
.lede { margin: 0 0 18px; max-width: 44ch; font-size: 1.08rem; font-weight: 500; line-height: 1.45; color: #4A2600; }
.hero-art { display: none; }
@media (min-width: 960px) {
  .hero { padding: 84px 0 56px; }
  .bunting { height: 64px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: center; gap: 56px; }
  .hero-copy { max-width: 640px; }
  .hero-art { display: grid; place-items: center; }
  .hero-art img { width: 320px; height: 320px; transform: rotate(-5deg); filter: drop-shadow(0 26px 34px rgba(122, 42, 0, .38)); }
}

/* ---------- Link box ---------- */
.paste-card {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 22px 44px -22px rgba(122, 42, 0, .6);
}
.label-title { display: block; margin-bottom: 6px; font-weight: 700; color: var(--ink); }
.paste-card textarea {
  display: block; width: 100%; min-height: 66px; resize: vertical;
  padding: 12px 14px;
  border: 2px solid #F4CC9F; border-radius: 14px; background: #FFFBF4;
  font: inherit; font-size: 1.05rem; line-height: 1.4; color: var(--text);
}
.paste-card textarea::placeholder { color: #A08867; }
.paste-card textarea:focus { outline: none; border-color: var(--ink-soft); background: #fff; box-shadow: 0 0 0 3px rgba(29, 75, 168, .2); }
.paste-actions { display: flex; gap: 10px; margin-top: 10px; }
.paste-actions .btn-red { flex: 1; }
.stores { margin-top: 16px; }
.stores-title { margin: 0 0 7px; font-size: .86rem; font-weight: 700; color: var(--muted); }
.store-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.store-list .store-tag { padding: 4px 12px; font-size: .88rem; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 16px;
  border-top: 2px dashed #F3D9B9;
}
.help-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 8px; border: 0; border-radius: 999px;
  background: #E8EFFF; color: var(--ink);
  font: inherit; font-size: .95rem; font-weight: 700; line-height: 1.2; text-align: left; cursor: pointer;
}
.help-btn svg { width: 26px; height: 26px; flex: none; color: var(--ink-soft); }
.help-btn:hover { background: #DCE6FF; }

/* The delivery stamp */
.stamp {
  flex: none;
  display: grid; justify-items: center;
  padding: 8px 12px 7px;
  border: 2.5px solid currentColor; border-radius: 12px;
  box-shadow: inset 0 0 0 2.5px var(--paper), inset 0 0 0 4px currentColor;
  color: var(--crimson);
  transform: rotate(-6deg);
  text-align: center; line-height: 1.05;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  3.2 0 0 0 -0.35'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  3.2 0 0 0 -0.35'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.stamp-big { margin: 1px 0; font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: -.01em; }
.stamp-small { font-size: .8rem; font-weight: 700; }
.stamp-tiny { margin-top: 3px; padding-top: 3px; border-top: 1.5px solid currentColor; font-size: .74rem; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 50px; padding: 12px 20px;
  border: 0; border-radius: 14px;
  font: inherit; font-size: 1.05rem; font-weight: 700; line-height: 1.1; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn svg { width: 21px; height: 21px; flex: none; }
.btn:active { transform: translateY(2px); }
.btn-red { background: var(--crimson); color: #fff; box-shadow: 0 4px 0 #9A0E1F; }
.btn-red:hover { background: #C3152A; }
.btn-red:active { box-shadow: 0 2px 0 #9A0E1F; }
.btn-yellow { background: var(--yellow); color: #3B2600; box-shadow: 0 4px 0 #D9A400; }
.btn-yellow:hover { background: #FFC300; }
.btn-yellow:active { box-shadow: 0 2px 0 #D9A400; }
.btn-blue { background: var(--ink); color: #fff; box-shadow: 0 4px 0 #051A47; }
.btn-blue:hover { background: #0A2763; }
.btn-blue:active { box-shadow: 0 2px 0 #051A47; }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 4px 0 #0A5025; }
.btn-wa:hover { background: var(--wa-dark); }
.btn-wa:active { box-shadow: 0 2px 0 #0A5025; }
.btn-wa-soft { background: #E3F4E9; color: #0D5A2B; }
.btn-wa-soft:hover { background: #D3EEDD; }
.btn-block { width: 100%; }
.btn-small { min-height: 46px; padding: 8px 14px; font-size: .98rem; }
.btn[disabled] { opacity: .65; cursor: progress; }

/* ---------- Order slip ---------- */
.shop-grid { display: grid; gap: 30px; padding: 26px 0 44px; }
@media (min-width: 960px) {
  .shop-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 40px; padding: 40px 0 64px; }
}
.slip {
  position: relative;
  padding: 26px 18px 26px;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 24px 48px -30px rgba(122, 42, 0, .45);
}
.slip::before, .slip::after {
  content: ""; position: absolute; left: 0; right: 0; height: 8px;
  background: radial-gradient(circle at 7px 0, var(--bg) 5.5px, transparent 6px) repeat-x;
  background-size: 14px 8px;
}
.slip::before { top: 0; }
.slip::after { bottom: 0; transform: scaleY(-1); }
.slip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.slip-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.75rem; line-height: 1.1; color: var(--ink); }
.empty { margin: 4px 0 6px; color: var(--muted); }
.tear { position: relative; margin: 20px -18px 18px; border-top: 2px dashed var(--rule); }
.tear::before, .tear::after { content: ""; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); }
.tear::before { left: -9px; }
.tear::after { right: -9px; }
.fine { margin: 10px 0 0; font-size: .86rem; color: var(--muted); }

/* ---------- Customer details ---------- */
.details { margin-top: 24px; }
.details h3 { margin: 0 0 12px; font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--ink); }
.phone { display: flex; }
.phone-cc {
  display: grid; place-items: center; padding: 0 12px;
  border: 1.5px solid var(--field-line); border-right: 0; border-radius: 10px 0 0 10px;
  background: #FFF0DC; color: #7A4B12; font-weight: 700;
}
.phone input { border-radius: 0 10px 10px 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#order-msg { margin-bottom: 10px; }

/* ---------- After sending ---------- */
.done { margin-top: 18px; text-align: center; }
.done:focus { outline: none; }
.done-icon { display: grid; place-items: center; margin-bottom: 6px; color: var(--wa); }
.done-icon svg { width: 64px; height: 64px; }
.done-code { margin: 0 0 6px; font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.15; color: var(--ink); }
.done p { margin: 0 0 14px; }
.done-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 16px; }

/* ---------- Steps ---------- */
.steps h2 { margin: 0 0 14px; font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--ink); }
.steps ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start;
  padding: 14px; border-radius: 16px; background: var(--paper);
}
.steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: #fff;
}
.step-1::before { background: var(--ink-soft); }
.step-2::before { background: var(--crimson); }
.step-3::before { background: var(--orange-deep); }
.step-4::before { background: var(--wa); }
.steps p { margin: 0; font-size: .97rem; color: var(--muted); }
.steps strong { display: block; font-size: 1.04rem; color: var(--ink); }

/* ---------- Track order tab ---------- */
.track-view { display: grid; gap: 26px; max-width: 640px; padding: 26px 0 48px; }
.track-card {
  padding: 20px 16px 18px;
  border-top: 6px solid var(--orange);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 22px 44px -28px rgba(122, 42, 0, .5);
}
.track-card h1 { margin: 0 0 4px; font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1.1; color: var(--ink); }
.track-card > p { margin: 0 0 16px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.input-row .btn { flex: none; }
.recent h2 { margin: 0 0 12px; font-family: var(--display); font-weight: 800; font-size: 1.45rem; color: var(--ink); }
.recent-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.recent-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  padding: 14px 16px; border: 1.5px solid var(--rule); border-radius: 16px;
  background: var(--paper); color: inherit; text-decoration: none;
}
.recent-item:hover { border-color: var(--orange); }
.ro-code { font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.1; color: var(--ink); }
.ro-meta { grid-column: 1; font-size: .9rem; color: var(--muted); }
.ro-side { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: end; gap: 6px; }
.ro-view { font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: #EEF0F5; color: #3B4256; }
.status-pill[data-status="new"] { background: #FFE9C7; color: #7A4300; }
.status-pill[data-status="confirmed"] { background: #DDE8FF; color: #183D8F; }
.status-pill[data-status="paid"] { background: #D7F1EA; color: #0B5E52; }
.status-pill[data-status="ordered"] { background: #ECE2FF; color: #5426A6; }
.status-pill[data-status="shipped"] { background: #FFE2D8; color: #932A10; }
.status-pill[data-status="delivered"] { background: #DDF2E3; color: #17602E; }
.status-pill[data-status="cancelled"] { background: #ECEEF2; color: #50586A; }

/* ---------- Sticky total (phones) ---------- */
.sticky-total {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff;
  box-shadow: 0 -10px 30px -16px rgba(0, 0, 0, .5);
}
.sticky-sum { display: grid; line-height: 1.15; }
.sticky-amount { font-family: var(--display); font-weight: 800; font-size: 1.4rem; color: var(--yellow); }
.sticky-count { font-size: .85rem; opacity: .9; }
.sticky-total .btn { min-height: 46px; padding: 10px 24px; }
.sticky-total :focus-visible { outline-color: #fff; }
@media (min-width: 960px) { .sticky-total { display: none !important; } }

/* ---------- How to copy a link (dialog) ---------- */
.howto {
  width: min(540px, calc(100% - 32px)); max-height: 90vh;
  padding: 0; border: 0; border-radius: 24px;
  background: var(--paper); color: var(--text);
  box-shadow: 0 30px 80px rgba(8, 20, 50, .4);
}
.howto::backdrop { background: rgba(8, 20, 50, .55); }
.howto-inner { display: grid; gap: 14px; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
.howto-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.howto-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.15; color: var(--ink); }
.howto-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #F1F2F6; color: var(--ink); cursor: pointer; }
.howto-close svg { width: 20px; height: 20px; }
.howto-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: hstep; }
.howto-steps li { counter-increment: hstep; display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.howto-steps li::before {
  content: counter(hstep);
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  font-family: var(--display); font-weight: 800; color: #fff;
}
.howto-steps strong { display: block; color: var(--ink); font-size: 1.03rem; }
.howto-steps p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.share-icons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.share-icons span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 12px; background: #FFF1DF; font-size: .88rem; font-weight: 700; color: #6B3D00; }
.share-icons svg { width: 26px; height: 26px; color: var(--ink); }
.howto-tip { margin: 0; padding: 10px 12px; border-radius: 12px; background: #EEF3FF; font-size: .92rem; color: var(--ink); }
@media (max-width: 600px) {
  .howto { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
}

/* ---------- Footer ---------- */
.site-foot { padding: 26px 0; background: var(--ink); color: #D9E1F5; font-size: .95rem; }
body.has-sticky .site-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { body.has-sticky .site-foot { padding-bottom: 26px; } }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; background: #fff; }
.foot-name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: #fff; line-height: 1.1; }
.site-foot p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { color: #fff; font-weight: 600; }
.site-foot :focus-visible { outline-color: #fff; }

/* ---------- Order page (track.php) ---------- */
.order-page { display: grid; gap: 22px; max-width: 760px; padding: 26px 0 56px; }
.order-page h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 6vw, 2.6rem); line-height: 1.05; color: var(--ink); }
.order-meta { margin: 6px 0 0; color: var(--muted); }
.progress { display: grid; margin: 0; padding: 18px 18px 4px; border-radius: 20px; background: var(--paper); list-style: none; }
.progress li { position: relative; padding: 0 0 18px 34px; color: var(--muted); }
.progress li::before {
  content: ""; position: absolute; left: 4px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--field-line); background: var(--paper);
}
.progress li::after { content: ""; position: absolute; left: 11px; top: 23px; bottom: 0; width: 2px; background: var(--rule); }
.progress li:last-child::after { display: none; }
.progress li.is-done { color: var(--text); }
.progress li.is-done::before { background: var(--wa); border-color: var(--wa); }
.progress li.is-done::after { background: var(--wa); }
.progress li.is-now { color: var(--ink); font-weight: 700; }
.progress li.is-now::before { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 5px rgba(255, 138, 31, .25); }
.progress time { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); }
.cancelled-note { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.order-page .slip h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--ink); }
.order-page .item { grid-template-columns: 60px minmax(0, 1fr); }
.order-page .item-media { width: 60px; height: 60px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Note under the delivery stamp: heavier parcels cost extra */
.ship-extra {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0 0; padding: 8px 12px;
  border-radius: 10px; background: #FFF4E0; color: #6B3A00;
  font-size: .9rem; font-weight: 600; line-height: 1.3;
}
.ship-extra svg { width: 22px; height: 22px; flex: none; color: var(--crimson); }
