/*
 * Celonix Storefront — the commerce pages (cart, checkout, order, pay,
 * track). Linked after sf.css only by pages whose Kind starts with "x-"
 * (the layout's hook); builds on sf.css's variables and primitives
 * (.sfv-panel, .sfv-btn, .sfv-input, .sfv-dl …). Scoped to html[data-sf]
 * pages; every class here is prefixed sfx-. Mobile first: one column, the
 * order summary under the form; two columns from 1024px with a sticky
 * summary beside it. No style attributes anywhere (the store CSP forbids them).
 */

/* ---- page frame ---- */
.sfx-head{padding-top:18px;padding-bottom:14px;display:grid;gap:6px}
.sfx-eyebrow{font-size:13px;font-weight:650;color:var(--sf-muted);letter-spacing:.02em}
.sfx-small{font-size:13px;line-height:1.5}
.sfx-opt{font-weight:500;color:var(--sf-muted)}
.sfx-mono{font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:.95em;overflow-wrap:anywhere}
.sfx-help{text-align:center;font-size:14px;color:var(--sf-muted)}
.sfx-grid{display:grid;gap:16px;align-items:start}
.sfx-main{display:grid;gap:16px;min-width:0}
@media (min-width:1024px){
  .sfx-grid{grid-template-columns:minmax(0, 1fr) 380px;gap:24px}
  .sfx-summary{position:sticky;top:132px}
}
.sfx-cart{padding-bottom:8px;min-width:0}
.sfx-notice{display:grid;gap:12px;justify-items:center;text-align:center;padding:32px 22px}
.sfx-loading{display:flex;align-items:center;justify-content:center;gap:10px;padding:28px 12px;color:var(--sf-muted);font-size:14px}
.sfx-spinner{width:20px;height:20px;border-radius:50%;border:2.5px solid var(--sf-border);border-top-color:var(--sf-brand-ink);animation:sfx-spin .8s linear infinite}
@keyframes sfx-spin{to{transform:rotate(360deg)}}
.sfx-problem-list{display:grid;gap:4px;padding-left:1.1em;list-style:disc}
.sfx-problem{display:block;color:var(--sf-bad);font-size:13px;font-weight:600}
.sfx-row{display:flex;gap:8px;align-items:stretch}
.sfx-row .sfv-input{flex:1;min-width:0}
.sfx-row .sfv-btn{flex:none}

/* ---- checkout steps ---- */
.sfx-steps{display:flex;flex-wrap:wrap;gap:6px;font-size:13px;color:var(--sf-muted);font-weight:600}
.sfx-steps li{display:flex;align-items:center;gap:6px}
.sfx-steps li + li::before{content:"";width:18px;height:1px;background:var(--sf-border)}
.sfx-steps a{color:var(--sf-brand-ink);text-decoration:underline;text-underline-offset:3px}
.sfx-steps [aria-current]{color:var(--sf-fg)}

/* ---- cart lines (built by sf-checkout.js) ---- */
.sfx-lines{display:grid;gap:12px}
.sfx-line{display:grid;grid-template-columns:72px minmax(0, 1fr);gap:12px 14px;padding:14px;background:var(--sf-card);border:1px solid var(--sf-border);border-radius:var(--sf-radius);box-shadow:var(--sf-shadow)}
.sfx-line[data-problem]{border-color:var(--sf-warn)}
.sfx-line-media{grid-row:span 2;width:72px;height:72px;border-radius:var(--sf-radius-sm);background:var(--sf-surface);border:1px solid var(--sf-line);display:grid;place-items:center;overflow:hidden;color:var(--sf-border)}
.sfx-line-img{width:100%;height:100%;object-fit:contain;padding:4px}
.sfx-line-noimg{display:grid;place-items:center}
.sfx-line-body{display:grid;gap:2px;min-width:0}
.sfx-line-title{font-weight:620;font-size:15px;line-height:1.35;overflow-wrap:anywhere}
.sfx-line-label{font-size:13px;color:var(--sf-muted)}
.sfx-line-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px;font-size:14px}
.sfx-line-side{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.sfx-line-total{font-weight:750;font-variant-numeric:tabular-nums;margin-left:auto}
.sfx-line-remove{border:0;background:transparent;color:var(--sf-muted);font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:8px 4px;min-height:44px}
.sfx-line-remove:hover{color:var(--sf-bad)}
.sfx-line .sfv-qty-btn{font-size:18px;font-weight:700}
@media (min-width:640px){
  .sfx-line{grid-template-columns:88px minmax(0, 1fr) auto;align-items:center}
  .sfx-line-media{width:88px;height:88px;grid-row:auto}
  .sfx-line-side{justify-content:flex-end}
}

/* ---- summary and totals ---- */
.sfx-summary{display:grid;gap:14px}
.sfx-totals{display:grid;gap:0;font-size:14px}
.sfx-totals > div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--sf-line)}
.sfx-totals dt{color:var(--sf-muted)}
.sfx-totals dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums;text-align:right}
.sfx-totals > .sfx-total{border-bottom:0;padding-top:12px;font-size:17px}
.sfx-totals > .sfx-total dt{color:var(--sf-fg);font-weight:700}
.sfx-totals > .sfx-total dd{font-weight:800}
.sfx-code{display:inline-block;padding:1px 8px;border-radius:var(--sf-pill);background:var(--sf-brand-tint);color:var(--sf-brand-ink);font-size:12px;font-weight:700;letter-spacing:.04em}
.sfx-code:empty{display:none}
.sfx-save{color:var(--sf-ok)}
.sfx-continue{justify-self:center;font-size:14px}
.sfx-sum-lines{display:grid;gap:12px}
.sfx-sum-lines:empty{display:none}
.sfx-sum-line{display:grid;grid-template-columns:56px minmax(0, 1fr) auto;gap:12px;align-items:center}
.sfx-sum-media{position:relative;width:56px;height:56px;border-radius:var(--sf-radius-sm);border:1px solid var(--sf-line);background:var(--sf-surface);display:grid;place-items:center;color:var(--sf-border)}
.sfx-sum-img{width:100%;height:100%;object-fit:contain;padding:3px;border-radius:inherit}
.sfx-sum-qty{position:absolute;top:-7px;right:-7px;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--sf-fg);color:var(--sf-surface);font-size:11px;font-weight:750;line-height:20px;text-align:center}
.sfx-sum-text{display:grid;gap:1px;min-width:0;font-size:13.5px}
.sfx-sum-title{font-weight:600;line-height:1.35;overflow-wrap:anywhere}
.sfx-sum-price{font-weight:650;font-size:14px;font-variant-numeric:tabular-nums}
.sfx-sum-line[data-problem] .sfx-sum-title{color:var(--sf-muted)}
.sfx-place{margin-top:2px}
@media (max-width:1023px){
  .sfx-checkout .sfx-summary{order:2}
}

/* ---- checkout form ---- */
.sfx-checkout{margin-bottom:8px}
.sfx-section{display:grid;gap:14px;align-content:start}
.sfx-section-h{display:flex;align-items:center;gap:10px;font-size:1.05rem;font-weight:700}
.sfx-num{width:28px;height:28px;flex:none;border-radius:50%;display:grid;place-items:center;background:var(--sf-brand);color:var(--sf-brand-fg);font-size:14px;font-weight:800}
.sfx-fields{display:grid;gap:14px}
@media (min-width:640px){.sfx-fields{grid-template-columns:1fr 1fr} .sfx-wide{grid-column:1 / -1}}
.sfx-field{display:grid;gap:0;min-width:0}
.sfx-hint{font-size:12.5px;color:var(--sf-muted);margin-top:4px}
.sfx-note{min-height:84px;resize:vertical}
.sfx-choices{border:0;margin:0;padding:0;display:grid;gap:10px;min-width:0}
.sfx-choice{position:relative;display:block;cursor:pointer}
.sfx-choice-input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.sfx-choice-box{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1.5px solid var(--sf-border);border-radius:var(--sf-radius-sm);background:var(--sf-surface);transition:border-color .15s,background-color .15s}
.sfx-choice-box > .sfv-i{color:var(--sf-brand-ink);margin-top:1px}
.sfx-choice:hover .sfx-choice-box{border-color:var(--sf-muted)}
.sfx-choice-input:checked + .sfx-choice-box{border-color:var(--sf-brand-ink);background:var(--sf-brand-tint)}
.sfx-choice-input:focus-visible + .sfx-choice-box{outline:2px solid var(--sf-brand-ink);outline-offset:2px}
.sfx-choice-input:disabled + .sfx-choice-box{opacity:.55;cursor:not-allowed;border-style:dashed}
.sfx-choice-text{display:grid;gap:2px;min-width:0}
.sfx-choice-title{font-weight:650;font-size:15px}
.sfx-choice-sub{font-size:13px;color:var(--sf-muted);overflow-wrap:anywhere}
.sfx-choice-off{font-size:12.5px;font-weight:650;color:var(--sf-warn)}
.sfx-linkbtn{justify-self:start;border:0;background:transparent;padding:6px 0;min-height:44px;color:var(--sf-brand-ink);font-weight:600;font-size:14px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.sfx-address{display:grid;gap:10px;padding-top:4px;border-top:1px dashed var(--sf-border)}
.sfx-coupon{display:grid;gap:0}
.sfx-coupon-msg{font-size:13px;font-weight:600;padding-top:6px}
.sfx-coupon-msg:empty{display:none}
.sfx-coupon-msg[data-ok="1"]{color:var(--sf-ok)}
.sfx-coupon-msg[data-ok="0"]{color:var(--sf-bad)}

/* ---- order page ---- */
.sfx-order{display:grid;gap:16px;padding-top:8px}
.sfx-thanks{display:grid;justify-items:center;gap:8px;text-align:center;padding:28px 18px 8px}
.sfx-thanks-icon{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;background:var(--sf-brand-tint);color:var(--sf-ok)}
.sfx-status{gap:12px}
.sfx-status-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.sfx-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:var(--sf-pill);background:var(--sf-soft);color:var(--sf-fg);font-size:13px;font-weight:700}
.sfx-badge::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;opacity:.8}
.sfx-badge[data-state="pending"],.sfx-badge[data-state="awaiting_payment"],.sfx-badge[data-state="return_requested"]{color:var(--sf-warn)}
.sfx-badge[data-state="confirmed"],.sfx-badge[data-state="processing"],.sfx-badge[data-state="ready_for_pickup"],.sfx-badge[data-state="shipped"]{color:var(--sf-brand-ink);background:var(--sf-brand-tint)}
.sfx-badge[data-state="delivered"]{color:var(--sf-ok)}
.sfx-badge[data-state="cancelled"],.sfx-badge[data-state="failed"],.sfx-badge[data-state="returned"]{color:var(--sf-bad)}
.sfx-meta{margin-top:2px}
.sfx-upi{display:grid;gap:12px;padding:16px;border-radius:var(--sf-radius-sm);background:var(--sf-soft)}
.sfx-upi-title{font-weight:700}
.sfx-copy{display:inline-flex;align-items:center;gap:4px;margin-left:6px;padding:4px 10px;min-height:32px;border:1px solid var(--sf-border);border-radius:var(--sf-pill);background:var(--sf-surface);font-size:12.5px;font-weight:650;cursor:pointer;vertical-align:middle}
.sfx-copy:hover{border-color:var(--sf-muted)}
@media (hover:hover) and (pointer:fine){.sfx-upi-app{display:none}}
.sfx-addr{font-style:normal;display:grid;gap:2px;font-size:15px}
.sfx-actions{display:flex;flex-wrap:wrap;gap:8px}
.sfx-actions:empty{display:none}
.sfx-timeline{display:grid;gap:0;position:relative}
.sfx-step{position:relative;display:grid;gap:1px;padding:0 0 14px 26px;font-size:14px}
.sfx-step::before{content:"";position:absolute;left:5px;top:6px;width:10px;height:10px;border-radius:50%;background:var(--sf-border)}
.sfx-step::after{content:"";position:absolute;left:9px;top:18px;bottom:0;width:2px;background:var(--sf-line)}
.sfx-step:last-child{padding-bottom:0}
.sfx-step:last-child::after{display:none}
.sfx-step[aria-current]::before{background:var(--sf-brand);box-shadow:0 0 0 4px var(--sf-brand-tint)}
.sfx-step-label{font-weight:650}
.sfx-details{border:1px solid var(--sf-border);border-radius:var(--sf-radius-sm);background:var(--sf-surface)}
.sfx-details + .sfx-details{margin-top:-4px}
.sfx-details-sum{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;cursor:pointer;font-weight:650;list-style:none;min-height:48px}
.sfx-details-sum::-webkit-details-marker{display:none}
.sfx-details-sum::after{content:"";width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-top:-4px;transition:transform .15s}
.sfx-details[open] .sfx-details-sum::after{transform:rotate(225deg);margin-top:4px}
.sfx-details-body{display:grid;gap:12px;padding:0 16px 16px}
.sfx-btn-danger{background:var(--sf-bad);color:#fff;justify-self:start}
.sfx-btn-danger:hover{filter:brightness(1.05)}

/* ---- pay and track ---- */
.sfx-pay{display:grid;gap:12px;justify-items:center;padding:32px 22px;max-width:520px;margin:0 auto}
.sfx-pay .sfv-alert{width:100%;margin:0;text-align:left}
.sfx-pay-start{width:100%}
.sfx-track{display:grid;gap:16px}

/* the floating WhatsApp button stays clear of "Place order" */
@media (max-width:1023px){html[data-sf] body[data-sfv-page="x-checkout"] .sfv-wa-float{bottom:calc(84px + env(safe-area-inset-bottom))}}

@media (prefers-reduced-motion:reduce){.sfx-spinner{animation-duration:2.4s}}
@media print{.sfx-actions,.sfx-details,.sfx-copy,.sfx-place{display:none !important}}
