/* ==========================================================================
   Basket, checkout, payment and sign-in — marketplace layout.
   White cards on the light page, a PRICE DETAILS card that stays in view,
   savings in green, one orange action. Mobile first.
   ========================================================================== */

.flow { padding-top: 14px; padding-bottom: 96px; }
.flow-grid { display: grid; gap: 12px; }
.flow-main { display: grid; gap: 12px; min-width: 0; align-content: start; }
.flow-side { display: grid; gap: 12px; align-content: start; }
@media (min-width: 960px) {
  .flow { padding-top: 18px; padding-bottom: 40px; }
  .flow-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
  .flow-side { position: sticky; top: 88px; }
}

.flow-card { background: var(--paper); border-radius: 4px; box-shadow: 0 1px 2px rgba(16,19,34,.08); }
@media (min-width: 640px) { .flow-card { border-radius: 8px; } }
.flow-green { color: var(--green-600); font-weight: 600; }
.flow-link { color: var(--blue-600); font-weight: 600; font-size: 13.5px; }
.flow-link:hover { text-decoration: underline; }
.flow-err { margin: 8px 0 0; color: var(--red-600); font-size: 13px; }

/* deliver-to strip */
.flow-deliver { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; }
.flow-deliver > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.flow-deliver-eta { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12.5px; }
.flow-deliver-eta svg { width: 15px; height: 15px; }
.flow-pin { display: flex; gap: 8px; }
.flow-pin .input { width: 120px; height: 38px; }
.flow-pin .btn { height: 38px; padding: 0 14px; color: var(--blue-600); font-weight: 700; }

/* offer nudge */
.flow-nudge { padding: 12px 16px; font-size: 14px; }
.flow-nudge-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.flow-nudge-top span { display: inline-flex; align-items: center; gap: 6px; }
.flow-nudge-top svg { width: 16px; height: 16px; color: var(--orange-500); }
.flow-bar { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.flow-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange-400), var(--orange-600)); border-radius: 6px; }

/* items */
.flow-items-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.flow-items-head h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: 0; }
.fitem { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 14px; padding: 16px; border-bottom: 1px solid var(--line-2); }
.fitem-left { display: grid; gap: 10px; justify-items: center; }
.fitem-img { width: 96px; height: 96px; display: grid; place-items: center; }
.fitem-img img { width: 100%; height: 100%; object-fit: contain; }
.fitem-body { min-width: 0; display: grid; gap: 4px; align-content: start; }
.fitem-name { font-size: 15px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fitem-name:hover { color: var(--blue-600); }
.fitem-opt { font-size: 13px; color: var(--ink-3); }
.fitem-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 4px; }
.fitem-price s { color: var(--ink-3); font-size: 14px; }
.fitem-price b { font-size: 18px; }
.fitem-off { color: var(--green-600); font-weight: 700; font-size: 14px; }
.fitem-bumpform { margin: 4px 0 0; }
.fitem-bump { display: inline-flex; align-items: center; gap: 5px; border: 1px dashed var(--blue-500); background: var(--blue-050); color: var(--blue-700); border-radius: 6px; padding: 5px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fitem-bump svg { width: 14px; height: 14px; }
.fitem-low { color: var(--red-600); font-size: 12.5px; font-weight: 600; }
.fitem-actions { display: flex; gap: 22px; margin-top: 8px; }
.fitem-act { border: 0; background: none; padding: 4px 0; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; letter-spacing: .01em; }
.fitem-act:hover { color: var(--blue-600); }
.fitem-eta { grid-column: 2; font-size: 12.5px; color: var(--ink-2); }
@media (min-width: 720px) {
  .fitem { grid-template-columns: 112px minmax(0, 1fr) 210px; }
  .fitem-img { width: 112px; height: 112px; }
  .fitem-eta { grid-column: 3; grid-row: 1; font-size: 13px; }
}

/* qty stepper */
.fqty { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.fqty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 17px; line-height: 1; cursor: pointer; color: var(--ink); display: grid; place-items: center; padding: 0; }
.fqty-btn:hover:not(:disabled) { border-color: var(--blue-600); color: var(--blue-600); }
.fqty-btn:disabled { opacity: .4; cursor: default; }
.fqty-num { width: 42px; height: 28px; border: 1px solid var(--line); border-radius: 3px; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.fqty-num::-webkit-outer-spin-button, .fqty-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* place-order bar under items (desktop) */
.flow-placebar { display: none; position: sticky; bottom: 0; justify-content: flex-end; padding: 14px 16px; background: #fff; border-top: 1px solid var(--line-2); box-shadow: 0 -2px 10px rgba(16,19,34,.08); border-radius: 0 0 8px 8px; }
.flow-place, .flow-cta { min-width: 220px; border-radius: 3px; font-weight: 700; letter-spacing: .02em; }
@media (min-width: 960px) { .flow-placebar { display: flex; } }

/* price details */
.flow-price { padding: 0 0 6px; }
.flow-price h2 { margin: 0; padding: 13px 18px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.fp-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 18px; font-size: 15px; }
.fp-total { margin: 6px 18px 0; padding: 14px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); font-size: 17px; font-weight: 700; }
.fp-save { margin: 10px 18px 6px; color: var(--green-600); font-weight: 700; font-size: 14.5px; }
.fp-tax { margin: 0 18px 8px; font-size: 12px; color: var(--ink-3); }

.flow-coupon { padding: 12px 16px; display: grid; gap: 8px; }
.flow-coupon label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.flow-coupon label svg { width: 16px; height: 16px; color: var(--orange-500); }
.flow-coupon-row { display: flex; gap: 8px; }
.flow-coupon-row .input { flex: 1; text-transform: uppercase; }
.flow-coupon-row .btn { color: var(--blue-600); font-weight: 700; }

.flow-trust { list-style: none; margin: 0; padding: 4px 6px; display: grid; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.flow-trust li { display: flex; gap: 8px; align-items: flex-start; }
.flow-trust svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--ink-3); }

/* phone bottom bar */
.flow-mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -2px 12px rgba(16,19,34,.12); }
.flow-mbar > div { display: grid; line-height: 1.2; }
.flow-mbar s { font-size: 12px; }
.flow-mbar b { font-size: 18px; }
.flow-mbar .flow-link { font-size: 12px; }
.flow-mbar .btn { min-width: 150px; border-radius: 3px; font-weight: 700; }
@media (min-width: 960px) { .flow-mbar { display: none; } }
body.flow-page .meter, body.flow-page .tabbar { display: none !important; }
body.flow-page { padding-bottom: 0 !important; }
body.flow-page .helpfab { bottom: 98px; }
@media (min-width: 960px) { body.flow-page .helpfab { bottom: 22px; } }

/* empty */
.flow-empty { text-align: center; padding: 48px 20px; max-width: 560px; margin: 20px auto; }
.flow-empty-ic { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--blue-050); color: var(--blue-600); margin-bottom: 14px; }
.flow-empty-ic svg { width: 40px; height: 40px; }
.flow-empty h1 { margin: 0 0 6px; font-size: 20px; }
.flow-empty p { margin: 0 0 18px; color: var(--ink-2); }
.flow-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------------------------------------------------------------- checkout steps */
.cstep { overflow: hidden; }
.cstep-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.cstep-num { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 3px; background: var(--wash); color: var(--blue-600); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.cstep-title { flex: 1; min-width: 0; }
.cstep-title b { display: flex; align-items: center; gap: 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); }
.cstep-title small { display: block; margin-top: 2px; color: var(--ink); font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cstep-title b svg { width: 16px; height: 16px; color: var(--blue-600); }
.cstep-change { border: 1px solid var(--line); background: #fff; color: var(--blue-600); font-weight: 700; font-size: 13px; padding: 7px 16px; border-radius: 3px; cursor: pointer; text-transform: uppercase; }
.cstep.is-open .cstep-head { background: var(--blue-600); }
.cstep.is-open .cstep-num { background: #fff; }
.cstep.is-open .cstep-title b { color: #fff; }
.cstep.is-open .cstep-change { display: none; }
.cstep.is-done .cstep-title b::after { content: "\2713"; color: var(--blue-600); font-size: 15px; }
.cstep-body { display: none; padding: 16px 18px 18px; }
.cstep.is-open .cstep-body { display: block; }
.cstep:not(.is-done):not(.is-open) .cstep-change { display: none; }

.c-login { display: grid; gap: 10px; font-size: 14px; }
.c-login .btn { justify-self: start; }

.addr-list { display: grid; gap: 0; margin: -16px -18px 12px; }
.addr { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.addr:has(input:checked) { background: var(--blue-050); }
.addr input { margin-top: 4px; accent-color: var(--blue-600); }
.addr-who { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-weight: 700; }
.addr-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; background: var(--wash); color: var(--ink-3); padding: 2px 6px; border-radius: 2px; }
.addr p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.addr-new { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 0; color: var(--blue-600); font-weight: 700; font-size: 14.5px; cursor: pointer; }
.addr-form { display: grid; gap: 12px; margin-top: 8px; padding: 14px; background: var(--blue-050); border-radius: 4px; }
.addr-form .field { margin: 0; }
.addr-form .g2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .addr-form .g2 { grid-template-columns: 1fr 1fr; } }
.c-deliver-btn { margin-top: 14px; }

.csum-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.csum-item:last-child { border-bottom: 0; }
.csum-item img { width: 72px; height: 72px; object-fit: contain; }
.csum-item .fitem-name { font-size: 14px; }
.csum-price { text-align: right; font-weight: 700; white-space: nowrap; }
.csum-price s { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.c-email { display: grid; gap: 12px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2); }
@media (min-width: 640px) { .c-email { grid-template-columns: 1fr 1fr; } }
.c-email .field { margin: 0; }

.paym { display: grid; gap: 0; margin: -16px -18px 0; }
.paym-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.paym-opt:has(input:checked) { background: var(--blue-050); }
.paym-opt input { margin-top: 4px; accent-color: var(--blue-600); }
.paym-opt b { display: block; font-size: 15px; }
.paym-opt small { color: var(--ink-3); font-size: 13px; }
.paym-logos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.paym-logos span { font-size: 11px; font-weight: 700; padding: 2px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink-2); background: #fff; }
.walletbox { display: flex; gap: 10px; padding: 12px 18px; margin: 0 -18px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.c-pay-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.c-pay-foot p { margin: 0; font-size: 12.5px; color: var(--ink-3); max-width: 380px; }
.c-notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 4px; background: var(--orange-050); color: var(--orange-600); font-weight: 600; font-size: 13.5px; }

/* ---------------------------------------------------------------- payment page */
.pay-wrap { max-width: 980px; }
.pay-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 18px; }
.pay-head h1 { margin: 0; font-size: 18px; }
.pay-timer { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--orange-600); background: var(--orange-050); padding: 5px 10px; border-radius: 20px; }
.pay-amount { padding: 4px 18px 18px; }
.pay-amount span { color: var(--ink-3); font-size: 13px; }
.pay-amount b { display: block; font-size: 30px; letter-spacing: -.02em; }
.pay-methods { display: grid; gap: 10px; padding: 0 18px 18px; }
@media (min-width: 640px) { .pay-methods { grid-template-columns: repeat(4, 1fr); } }
.pay-method { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 700; text-align: center; }
.pay-method svg { width: 22px; height: 22px; color: var(--blue-600); }
.pay-method small { font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.pay-btnrow { padding: 0 18px 18px; display: grid; gap: 8px; }
.pay-btnrow .btn { height: 52px; font-size: 16px; border-radius: 4px; font-weight: 700; }
.pay-msg { margin: 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.pay-msg.is-bad { color: var(--red-600); font-weight: 600; }
.pay-secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.pay-secure svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- confirmation */
.done-hero { text-align: center; padding: 28px 18px 22px; }
.done-tick { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--green-600); color: #fff; display: grid; place-items: center; font-size: 32px; box-shadow: 0 6px 20px rgba(14,138,82,.3); animation: donepop .4s ease-out; }
.done-tick.is-x { background: var(--ink-3); box-shadow: none; }
@keyframes donepop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-hero h1 { margin: 0 0 4px; font-size: 22px; }
.done-hero p { margin: 0; color: var(--ink-2); font-size: 14px; }
.done-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 18px 20px; font-size: 11.5px; text-align: center; color: var(--ink-3); }
.done-steps span { position: relative; padding-top: 20px; }
.done-steps span::before { content: ""; position: absolute; top: 4px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--line); }
.done-steps span::after { content: ""; position: absolute; top: 9px; left: calc(50% + 8px); right: calc(-50% + 8px); height: 2px; background: var(--line); }
.done-steps span:last-child::after { display: none; }
.done-steps span.on { color: var(--green-600); font-weight: 700; }
.done-steps span.on::before { background: var(--green-600); }
.done-meta { display: grid; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line-2); font-size: 14px; }
@media (min-width: 640px) { .done-meta { grid-template-columns: repeat(3, 1fr); } }
.done-meta span { display: block; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.done-actions { display: flex; gap: 10px; padding: 0 18px 18px; }
.done-actions .btn { flex: 1; }

/* ---------------------------------------------------------------- sign-in */
.lg-wrap { max-width: 860px; margin: 22px auto 40px; padding: 0 12px; }
.lg-card { display: grid; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 10px rgba(16,19,34,.1); min-height: 480px; }
@media (min-width: 760px) { .lg-card { grid-template-columns: 340px 1fr; } }
.lg-side { background: var(--blue-600); color: #fff; padding: 28px 30px; display: flex; flex-direction: column; gap: 14px; }
.lg-side h1 { margin: 0; font-size: 26px; color: #fff; }
.lg-side p { margin: 0; color: rgba(255,255,255,.85); font-size: 15.5px; line-height: 1.5; }
.lg-art { margin-top: auto; display: none; }
@media (min-width: 760px) { .lg-art { display: block; } }
.lg-main { padding: 28px 30px; display: flex; flex-direction: column; }
.lg-step[hidden] { display: none !important; }
.lg-step { display: grid; gap: 16px; }
.lg-field { position: relative; display: flex; align-items: center; border-bottom: 2px solid var(--line); padding: 6px 0; transition: border-color .15s; }
.lg-field:focus-within { border-color: var(--blue-600); }
.lg-field span { font-weight: 700; color: var(--ink-2); margin-right: 8px; }
.lg-field input { flex: 1; border: 0; outline: 0; font-size: 18px; padding: 6px 0; background: transparent; letter-spacing: .04em; }
.lg-label { font-size: 13px; color: var(--ink-3); }
.lg-btn { height: 50px; border-radius: 3px; font-size: 16px; font-weight: 700; }
.lg-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.lg-note a { color: var(--blue-600); }
.lg-err { min-height: 20px; margin: 0; color: var(--red-600); font-size: 13.5px; font-weight: 600; }
.lg-ok { color: var(--green-600); }
.lg-otp { display: flex; gap: 8px; justify-content: space-between; max-width: 360px; }
.lg-otp input { width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 700; border: 1px solid var(--line); border-radius: 6px; outline: 0; }
.lg-otp input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
@media (max-width: 380px) { .lg-otp input { width: 40px; height: 48px; } }
.lg-sent { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.lg-sent b { color: var(--ink); }
.lg-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; }
.lg-linkbtn { border: 0; background: none; padding: 0; color: var(--blue-600); font-weight: 700; cursor: pointer; font-size: 13.5px; }
.lg-linkbtn:disabled { color: var(--ink-3); cursor: default; font-weight: 600; }
.lg-alt { margin-top: auto; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 13.5px; }
.lg-legal { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }
.lg-legal a { color: var(--blue-600); }
.lg-pw { display: grid; gap: 12px; }
@media (max-width: 719px) {
  .fitem { grid-template-columns: 100px minmax(0, 1fr); padding: 14px 12px; }
  .fitem-img { width: 88px; height: 88px; }
  .fqty { gap: 4px; }
  .fqty-btn { width: 26px; height: 26px; font-size: 15px; }
  .fqty-num { width: 34px; height: 26px; font-size: 13px; }
  .fitem-actions { gap: 18px; }
  .fitem-act { font-size: 13px; }
  .fitem-eta { grid-column: 1 / -1; }
  .flow-deliver { padding: 10px 12px; }
  .flow-items-head { padding: 12px; }
}
.c-login .lg-linkbtn { justify-self: start; }
.addr-new { display: flex; width: 100%; }
