/* Cart, checkout, order path, account, login (owner: shop). Tokens come from app.css. */

.d-block { display: block; }
.center { text-align: center; }

/* main + sticky summary column */
.buy-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1024px) {
  .buy-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
  .buy-side { position: sticky; top: 84px; }
}
@media (min-width: 1600px) {
  .buy-layout { grid-template-columns: minmax(0, 1fr) 420px; }
}
.page-cart .buy-layout > .card, .page-checkout .buy-layout > .stack { min-width: 0; }

.sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.sumrow--total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; }
.sumrow--total strong { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.card > .sumrow--total:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.kp-btn { margin-top: 10px; }

.mini-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 320px; overflow: auto; font-size: 13px; }
.mini-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.mini-items__name { grid-column: 1 / -1; color: var(--ink); line-height: 1.35; }
.mini-items__qty { color: var(--muted); }
.mini-items__sum { text-align: right; font-weight: 600; white-space: nowrap; }

.choice-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) {
  .page-checkout .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-checkout .form-grid__full { grid-column: 1 / -1; }
}

.inn-row { display: flex; gap: 8px; align-items: flex-end; }
.inn-row .field { flex: 1 1 auto; min-width: 0; }
.inn-card { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--success-soft, #BBF7D0); border-radius: var(--radius-sm); background: var(--success-soft, #F0FDF4); font-size: 13px; line-height: 1.45; }
.inn-card b { display: block; font-size: 15px; color: var(--ink); }
.inn-card--warn { border-color: var(--warning-soft, #FDE68A); background: var(--warning-soft, #FFFBEB); }

.paynote { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.paynote svg { flex: none; color: var(--primary); margin-top: 1px; }

/* thank-you box */
.thanks { display: flex; gap: 14px; align-items: flex-start; border-color: var(--success-ink, #15803D); }
.thanks > svg { flex: none; width: 44px; height: 44px; padding: 8px; border-radius: 50%; background: var(--success-soft, #DCFCE7); color: var(--success-ink, #15803D); }

/* order path: vertical on phones, horizontal on desktop */
.opath { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.opath__step { position: relative; display: flex; gap: 12px; padding: 0 0 18px; }
.opath__step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.opath__step:last-child::before { display: none; }
.opath__step.is-done::before { background: var(--primary); }
.opath__dot { flex: none; position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; }
.opath__step.is-done .opath__dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.opath__step.is-current .opath__dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft, rgba(37, 99, 235, .15)); }
.opath__step.is-cancelled .opath__dot { border-color: var(--danger-ink, #B91C1C); background: var(--danger-ink, #B91C1C); color: #fff; }
.opath__body { display: grid; gap: 2px; padding-top: 3px; }
.opath__label { font-weight: 700; color: var(--ink); }
.opath__step.is-todo .opath__label { color: var(--muted); font-weight: 600; }
.opath__at { color: var(--muted); font-size: 12px; }
.opath__hint { color: var(--ink-2); font-size: 13px; }
@media (min-width: 1024px) {
  .opath { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .opath__step { flex-direction: column; align-items: center; text-align: center; padding: 0 6px; }
  .opath__step::before { left: calc(50% + 18px); right: calc(-50% + 18px); top: 13px; bottom: auto; width: auto; height: 2px; }
  .opath__body { justify-items: center; }
}

/* account order list */
.olist { display: grid; gap: 10px; }
.olist__row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "num date sum" "step bar items"; gap: 6px 14px; align-items: center; padding: 14px 16px; color: var(--ink); }
.olist__row:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow-sm); }
.olist__num { grid-area: num; font-weight: 700; }
.olist__date { grid-area: date; }
.olist__sum { grid-area: sum; text-align: right; font-weight: 700; white-space: nowrap; }
.olist__step { grid-area: step; justify-self: start; }
.olist__bar { grid-area: bar; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.olist__bar i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.olist__items { grid-area: items; text-align: right; white-space: nowrap; }

/* login page + auth modal */
.auth-page { max-width: 460px; margin: 24px auto; }
.authf { display: grid; gap: 14px; }
.authf__lead { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.authf__sent { color: var(--ink-2); font-size: 14px; }
.authf__demo { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-soft, #FEF3C7); color: var(--warning-ink, #92400E); font-size: 13px; font-weight: 600; }
.authf__links { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.authf__links button { padding: 0; border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; }
.authf__links button:disabled { color: var(--muted); cursor: default; }
.authf__kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.authf__kind { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.authf__kind:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.authf__error { color: var(--danger-ink); font-size: 13px; font-weight: 600; }
.authf__agree { color: var(--muted); font-size: 12px; }
.authf input.authf__code { letter-spacing: .4em; font-size: 22px; font-weight: 700; text-align: center; }
