* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Times New Roman", Times, serif;
  --blue: #2a55e5;
  --link: #2a55e5;
  --yellow: #ffc200;
  --orange: #fb641b;
  --green: #108934;
  --red: #ff4b4b;
  --text: #212121;
  --muted: #717478;
  --line: #e9eaeb;
  --gap: #f1f2f4;
}

html { background: #e4e6ea; }
body {
  font-family: var(--sans);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; font-size: 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sm { font-size: 12.5px; }
.green { color: var(--green); }
.red { color: var(--red); }
.serif { font-family: var(--serif); font-size: 16px; color: var(--text); }

.app {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: var(--gap); position: relative; padding-bottom: 80px;
}

/* Header */
.topwrap { position: sticky; top: 0; z-index: 20; background: #fff; }
.top {
  display: flex; align-items: center; gap: 20px; padding: 0 12px 0 4px; height: 56px;
}
.back { display: flex; padding: 4px; }
.top-t { flex: 1; min-width: 0; }
.top h1 { font-size: 17.5px; font-weight: 400; letter-spacing: -.1px; }
.step-of, .secure-pill, .pay-sum { display: none; }

/* Payments header */
body.pay-mode .stepper, body.pay-mode .bottom { display: none; }
body.pay-mode .app { padding-bottom: 24px; background: #fff; }
body.pay-mode .topwrap { border-radius: 0 0 18px 18px; box-shadow: 0 4px 14px rgba(0,0,0,.08); padding-bottom: 18px; }
body.pay-mode .top { height: auto; padding: 14px 18px 10px 12px; gap: 16px; }
body.pay-mode .step-of { display: block; font-size: 12.5px; line-height: 18px; }
body.pay-mode .top h1 { font-size: 17.5px; font-weight: 600; line-height: 26px; }
body.pay-mode .secure-pill {
  display: inline-flex; align-items: center; gap: 4px; background: #f0f0f0; color: #424242;
  font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 4px; align-self: flex-end; margin-bottom: 2px;
}
body.pay-mode .pay-sum {
  display: flex; justify-content: space-between; align-items: center; margin: 4px 18px 0;
  background: #f0f5ff; border-radius: 10px; padding: 0 16px; height: 60px;
}
.ta-btn { color: var(--blue); font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.ta-btn .chev { transition: transform .2s; }
.ta-btn.open .chev { transform: rotate(180deg); }
.pay-sum b { color: var(--blue); font-size: 18.5px; font-weight: 700; }
.ta-break { margin: 8px 18px 0; padding: 4px 16px; border-radius: 10px; background: #f7f9ff; font-size: 13px; }
body:not(.pay-mode) .ta-break { display: none; }
.ta-break div { display: flex; justify-content: space-between; padding: 6px 0; }
.ta-break .tb-total { border-top: 1px dashed #c9d4f0; font-weight: 600; }

/* Stepper */
.stepper {
  background: #fff; display: flex; align-items: flex-start; padding: 8px 52px 12px;
  margin-bottom: 8px; box-shadow: 0 1px 0 var(--line);
}
.st { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 28px; position: relative; }
.dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; border: 1.5px solid #c7c9cc; color: #9a9ca0; background: #fff; flex-shrink: 0;
}
.lbl { font-size: 14px; color: #9a9ca0; white-space: nowrap; position: relative; }
.line { flex: 1; height: 2px; background: #e0e0e0; margin: 13px 4px 0; }
.line.done { background: var(--blue); }
.st.done .dot { border-color: var(--blue); color: var(--blue); font-size: 0; }
.st.done .dot::after {
  content: ""; width: 10px; height: 6px; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg) translate(1px, -1px);
}
.st.done .lbl { color: var(--muted); }
.st.active .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.st.active .lbl { color: var(--text); font-weight: 600; }

/* Views */
.view { display: none; }
.view.show { display: block; }
.card { background: #fff; padding: 16px 12px; margin-bottom: 8px; }

/* Buttons */
.btn-outline {
  border: 1px solid #d0d3d6; border-radius: 4px; padding: 0 20px; height: 42px;
  color: var(--link); font-family: var(--serif); font-size: 16px; background: #fff;
}
.btn-yellow {
  background: var(--yellow); color: var(--text); font-family: var(--serif);
  font-size: 16.5px; border-radius: 4px; height: 50px; padding: 0 20px; min-width: 216px;
}
.btn-yellow:disabled { opacity: .5; cursor: not-allowed; }
.btn-orange { background: var(--orange); color: #fff; border-radius: 4px; padding: 12px 20px; font-weight: 600; }
.btn-ghost { color: var(--link); font-weight: 600; padding: 12px 16px; }

/* Address list */
.add-addr {
  width: 100%; background: #fff; text-align: left; color: var(--link); font-weight: 600;
  padding: 16px 12px; display: flex; gap: 12px; align-items: center; margin-bottom: 8px;
}
.add-addr .plus { font-size: 19.5px; line-height: 1; }
.addr {
  display: flex; gap: 12px; background: #fff; padding: 16px 12px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.addr input { accent-color: var(--blue); width: 20px; height: 20px; margin-top: 3px; flex-shrink: 0; }
.addr .nm { font-family: var(--serif); font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--sans); background: #f0f0f0; color: #616161; font-size: 12.5px; font-weight: 600;
  padding: 1px 8px; border-radius: 4px; letter-spacing: .2px;
}
.addr .ad { margin-top: 8px; font-size: 14px; color: var(--text); }
.addr .ph { margin-top: 6px; font-size: 14px; }
.addr .actions { display: none; margin-top: 10px; gap: 10px; }
.addr.sel .actions { display: flex; }
.addr.sel { background: #f5f8ff; }
.addr .edit { color: var(--link); font-weight: 600; font-size: 12.5px; padding: 6px 0; }

/* Address form */
.addr-form .form-h { font-weight: 600; font-size: 16px; margin-bottom: 14px; }
.fld { position: relative; display: block; margin-bottom: 14px; }
.fld input {
  width: 100%; border: 1px solid #c7c9cc; border-radius: 6px; padding: 22px 12px 6px; outline: none; background: #fff;
}
.fld input:focus { border-color: var(--blue); }
.fld span { position: absolute; left: 12px; right: 8px; top: 14px; color: var(--muted); pointer-events: none; transition: .15s; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fld input:focus + span, .fld input:not(:placeholder-shown) + span { top: 4px; font-size: 10.5px; }
.fld input:focus + span { color: var(--blue); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }
.chip-radio input { display: none; }
.chip-radio span { border: 1px solid #c7c9cc; border-radius: 20px; padding: 6px 14px; font-size: 12.5px; cursor: pointer; display: inline-block; }
.chip-radio input:checked + span { border-color: var(--blue); color: var(--blue); background: #f0f4ff; }
.form-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* Deliver to */
.deliver { padding-top: 20px; }
.deliver-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.deliver .nm { font-family: var(--serif); font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.deliver .ad { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--text); }
.deliver .ph { margin-top: 8px; font-size: 15px; }

/* Checkbox (square, Flipkart style) */
.coins-row input, .gst input {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; flex-shrink: 0;
  border: 2px solid #9e9e9e; border-radius: 2px; background: #fff; cursor: pointer; position: relative;
}
.coins-row input:checked, .gst input:checked { background: var(--blue); border-color: var(--blue); }
.coins-row input:checked::after, .gst input:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 12px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* SuperCoins */
.coins { background: linear-gradient(100deg, #fff 35%, #eaf0ff 100%); padding: 16px 12px 22px; }
.coins-row { display: flex; gap: 10px; cursor: pointer; align-items: flex-start; }
.coins-title { color: var(--link); font-family: var(--serif); font-size: 16px; line-height: 24px; }
.coins-bal { font-size: 14px; margin-top: 2px; }
#coin-exp { font-size: 14px; }
.coin {
  display: inline-block; width: 15px; height: 15px; border-radius: 50%; vertical-align: -2px;
  background: #ffcc00 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 2L4 9h3.5L6.5 14 12 6.5H8.5z' fill='%23fff'/%3E%3C/svg%3E") center/11px no-repeat;
  box-shadow: inset 0 0 0 1px #f2b600;
}
.coins-save { color: var(--green); font-family: var(--serif); font-size: 14px; margin-top: 24px; }

/* Items */
.items { padding: 0; margin-bottom: 0; }
.item { display: flex; gap: 20px; padding: 20px 12px 18px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.it-left { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 94px; flex-shrink: 0; }
.it-img { width: 80px; height: 80px; object-fit: contain; }
.it-ph { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.qty-sel {
  appearance: none; -webkit-appearance: none;
  border: 1px solid #c7c9cc; border-radius: 2px; height: 40px; padding: 0 30px 0 10px;
  font-family: var(--serif); font-size: 15px; color: var(--text); width: 94px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M0 0h12L6 7z' fill='%23212121'/%3E%3C/svg%3E") right 10px center/12px no-repeat;
}
.it-info { flex: 1; min-width: 0; }
.it-name { font-size: 16px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-var { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.it-rate { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 1px; }
.stars svg { display: block; }
.rate-n { color: var(--green); font-size: 12.5px; margin-left: 4px; }
.rate-c { color: var(--muted); font-size: 12.5px; }
.assured { display: inline-flex; align-items: center; gap: 1px; margin-left: 2px; }
.assured em { color: var(--link); font-style: italic; font-weight: 700; font-size: 12.5px; letter-spacing: -.2px; }
.it-price { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.it-off { color: var(--green); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; gap: 3px; }
.it-mrp { color: #878787; text-decoration: line-through; font-size: 16px; font-weight: 500; }
.it-sp { font-weight: 700; font-size: 17.5px; }
.it-fee { font-size: 12.5px; color: var(--text); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

.info {
  display: inline-block; width: 15px; height: 15px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23717478' stroke-width='1.2'/%3E%3Cpath d='M8 7v4.5' stroke='%23717478' stroke-width='1.4'/%3E%3Ccircle cx='8' cy='4.8' r='.9' fill='%23717478'/%3E%3C/svg%3E") center/contain no-repeat;
}

.save-banner {
  background: #e7f6ea; color: var(--green); text-align: center; padding: 8px 12px; font-size: 15px;
  margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.save-banner b { font-weight: 700; }
.save-banner::before {
  content: ""; width: 20px; height: 20px; flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0l2.4 2 3.1-.3.8 3 2.8 1.5-1 3 1 2.9-2.8 1.5-.8 3-3.1-.3L10 20l-2.4-2-3.1.3-.8-3L.9 13.8l1-2.9-1-3L3.7 6.4l.8-3 3.1.3z' fill='%23108934'/%3E%3Cpath d='M6.5 13.5l7-7' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='7.3' cy='7.3' r='1.4' fill='%23fff'/%3E%3Ccircle cx='12.7' cy='12.7' r='1.4' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
}

.gst { padding: 18px 12px; }
.gst label { display: flex; align-items: center; gap: 20px; font-size: 16.5px; cursor: pointer; }

.openbox { padding-top: 18px; }
.ob-head { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ob-ic { flex-shrink: 0; }
.openbox p { font-size: 15px; line-height: 26px; }
.why { color: var(--link); font-family: var(--serif); text-decoration: none; font-size: 15px; }

.donate { padding: 0; }
.don-top { display: flex; justify-content: space-between; align-items: center; padding-left: 18px; border-bottom: 1px solid var(--line); overflow: hidden; }
.don-title { font-size: 14px; line-height: 22px; }
.don-top .sm { font-size: 12.5px; line-height: 20px; }
.don-img {
  width: 160px; height: 84px; object-fit: cover; object-position: right bottom; display: block; flex-shrink: 0;
  transform: scale(1.12); transform-origin: left bottom;
}
.don-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 18px; border-bottom: 1px solid var(--line); }
.don-chips button { border: 1px solid #d0d3d6; border-radius: 24px; height: 46px; font-size: 14px; background: #fff; }
.don-chips button.on { border-color: var(--blue); background: #eef3ff; color: var(--blue); font-weight: 600; }
.note { padding: 12px 18px 14px; font-size: 12.5px; }

/* Prices */
.prices { padding: 22px 18px 18px; }
.prices h3 { font-size: 17.5px; font-weight: 600; margin-bottom: 16px; color: #333; }
.price-box { background: #f5f5f6; border-radius: 12px; padding: 4px 20px; }
.pr { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 15px; }
.pr.bt { border-top: 1px dashed #d4d4d4; }
.dotted { text-decoration: underline dotted #555; text-underline-offset: 5px; }
.toggle { cursor: pointer; user-select: none; }
.toggle > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.chev { transition: transform .2s; }
.toggle.open .chev { transform: rotate(180deg); }
.sub { font-size: 12.5px; color: var(--muted); padding: 0 0 10px; }
.sub div { display: flex; justify-content: space-between; padding: 3px 0; }
.pr.total { border-top: 1px solid #d4d4d4; font-family: var(--serif); font-size: 14px; padding: 14px 0 12px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.save-line { color: var(--green); font-weight: 600; text-align: center; margin-top: 16px; font-size: 13px; }
.safe { display: flex; gap: 10px; align-items: center; padding: 16px 12px; color: var(--muted); font-size: 11.5px; font-weight: 500; }

/* Payment */
.pay-wrap { padding: 22px 18px 8px; background: #fff; }
.offer-banner {
  background: #e7f8ec; border-radius: 10px; padding: 14px 16px; margin-bottom: 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.ob-t { color: var(--green); font-weight: 700; font-size: 15px; line-height: 24px; }
.ob-s { color: var(--green); font-size: 13px; }
.ob-icons { display: flex; }
.oi {
  width: 40px; height: 40px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
  margin-left: -4px; box-shadow: 0 0 0 1px #e3efe6; font-weight: 700; font-size: 13px;
}
.oi-sq { background: #0b5ed7; color: #fff; font-size: 7px; font-weight: 700; border-radius: 4px; padding: 5px 3px; }
.oi-more { color: var(--text); }

.acc { border: 1px solid #e0e0e0; border-radius: 12px; margin-bottom: 16px; background: #fff; overflow: hidden; }
.acc-h { width: 100%; display: flex; align-items: flex-start; gap: 18px; padding: 22px 20px; text-align: left; }
.acc-ic { flex-shrink: 0; margin-top: -1px; }
.acc-t { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.acc-t b { font-size: 15px; font-weight: 600; line-height: 24px; }
.acc-t small { font-size: 12.5px; color: var(--muted); }
.acc-t small.g { color: var(--green); }
.acc-h .chev { flex-shrink: 0; margin-top: 3px; transition: transform .2s; }
.acc.open .acc-h .chev { transform: rotate(180deg); }
.acc-b { display: none; padding: 0 20px 20px 64px; }
.acc.open .acc-b { display: block; }
.plus-ic { flex-shrink: 0; }

.acc.rec { background: #f5f5f5; }
.acc.rec .acc-b { padding: 0 12px 12px; }
.rec-card { background: #fff; border-radius: 10px; padding: 24px 28px 28px; }
.rc-t { font-size: 15px; margin-bottom: 6px; }
.rc-d { font-size: 13px; color: var(--muted); line-height: 22px; margin-bottom: 22px; padding-left: 4px; }
.btn-place {
  width: 100%; height: 48px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--text);
  background: linear-gradient(90deg, #ffe11b, #ffc700);
}
.btn-place:disabled { opacity: .6; cursor: wait; }
.acc-b .btn-place { margin-top: 10px; }
.acc-empty { color: var(--muted); font-size: 13px; }
.opt-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; cursor: pointer; }
.opt-row input { accent-color: var(--blue); width: 18px; height: 18px; }
.sel { width: 100%; padding: 12px; border: 1px solid #c7c9cc; border-radius: 6px; background: #fff; font-size: 14px; }
.btn-outline-blue { border: 1px solid var(--blue); color: var(--blue); border-radius: 8px; padding: 10px 24px; font-weight: 600; }

.happy { text-align: center; padding: 30px 20px 10px; color: #a0a0a0; }
.happy p { font-size: 17.5px; font-weight: 700; line-height: 30px; margin-bottom: 10px; padding: 0 40px; }

/* Bottom bar */
.bottom {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 8px; box-shadow: 0 -1px 6px rgba(0,0,0,.08);
}
.bt-price { cursor: pointer; line-height: 1.15; font-family: var(--serif); }
.bt-price s { color: var(--muted); font-size: 13px; display: block; }
.bt-price b { font-weight: 400; font-size: 20px; }
.bt-price .info { margin-left: 4px; vertical-align: 0; }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); background: #fff; }

.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(30px); opacity: 0;
  background: #323232; color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 12.5px;
  transition: .25s; z-index: 60; max-width: 90%; text-align: center; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
