/* commerce.css — cart drawer, buy-box controls, cart page, checkout, forms, toast. Shared by every store.
   Load BEFORE your own style.css and map the four palette roles onto these variables in YOUR :root:
     --cx-bg (page background) · --cx-ink (headlines + main text) · --cx-acc (buttons/links, the accent)
     --cx-hi (small highlight) · --cx-soft (tinted panels: mix --cx-acc into --cx-bg ~10%) · --cx-line (borders)
   Your own CSS then only has to style the look: header, hero, sections, product cards. */
:root {
  --cx-bg: #fff; --cx-ink: #14264a; --cx-acc: #1558d6; --cx-acc-dark: #0f46b0; --cx-hi: #ffc93c;
  --cx-soft: #f2f6fd; --cx-line: #d9e4f5; --cx-muted: #566a8c; --cx-ok: #178a5b; --cx-danger: #c2412d;
  --cx-radius: 18px; --cx-pill: 999px; --cx-ease: cubic-bezier(.22,.8,.26,1);
  --cx-shadow: 0 1px 2px rgba(0,0,0,.06), 0 16px 40px -22px rgba(0,0,0,.35);
}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
.icon{width:1.25em;height:1.25em;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.small { font-size: 14px; color: var(--cx-muted); }
.tiny { font-size: 12.5px; color: var(--cx-muted); line-height: 1.5; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 14px 32px;
  border-radius: var(--cx-pill); background: var(--cx-acc); color: #fff; border: 1.5px solid transparent;
  font-size: 14.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  transition: background .2s, transform .2s var(--cx-ease), box-shadow .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--cx-acc-dark); transform: translateY(-1px); box-shadow: 0 14px 28px -16px rgba(21, 88, 214, .8); }
.btn:active { transform: none; }
.btn--block { width: 100%; }
.btn--lg { min-height: 60px; padding-inline: 38px; font-size: 15px; }
.btn--white { background: #fff; color: var(--cx-ink); }
.btn--white:hover { background: var(--cx-soft); box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .5); }
.btn--outline { background: transparent; color: var(--cx-ink); border-color: var(--cx-ink); }
.btn--outline:hover { background: var(--cx-ink); color: #fff; box-shadow: none; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn--outline-light:hover { background: #fff; color: var(--cx-ink); box-shadow: none; }
.btn .icon { width: 1.1em; height: 1.1em; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; transition: background .2s; }
.icon-btn:hover { background: var(--cx-soft); }
.icon-btn .icon { width: 24px; height: 24px; }
.gallery { position: sticky; top: 108px; }
.gallery__stage { position: relative; border-radius: var(--cx-radius); overflow: hidden; background: #fff; border: 1px solid var(--cx-line); aspect-ratio: 1; }
.gallery__stage img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.gallery__stage.is-fading img { opacity: .15; }
.gallery__tag { position: absolute; left: 18px; top: 18px; z-index: 2; background: var(--cx-hi); color: var(--cx-ink); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 7px 14px; border-radius: var(--cx-pill); }
.gallery__nav { position: absolute; top: 50%; z-index: 2; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; background: #fff; box-shadow: var(--cx-shadow); display: grid; place-items: center; transition: transform .2s var(--cx-ease); }
.gallery__nav:hover { transform: scale(1.08); }
.gallery__nav--prev { left: 14px; }
.gallery__nav--next { right: 14px; }
.gallery__nav .icon { width: 20px; height: 20px; }
.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding: 3px; scrollbar-width: none; }
.gallery__thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: 1 1 0; min-width: 60px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 2px solid transparent; opacity: .7; transition: opacity .2s, border-color .2s; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb[aria-selected="true"] { border-color: var(--cx-acc); opacity: 1; }
.group-label { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.group-label b { font-size: 19px; color: var(--cx-ink); font-weight: 700; letter-spacing: -.01em; }
.group-label span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cx-acc); }
.mode { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; gap: 4px; background: var(--cx-soft); border-radius: var(--cx-pill); position: relative; }
.mode button { position: relative; z-index: 1; padding: 11px 10px; border-radius: var(--cx-pill); font-weight: 700; font-size: 14.5px; color: var(--cx-muted); transition: color .2s; line-height: 1.25; }
.mode button small { display: block; font-size: 12px; font-weight: 600; color: var(--cx-acc); }
.mode button[aria-checked="true"] { color: var(--cx-ink); }
.mode__slider { position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 7px); background: #fff; border-radius: var(--cx-pill); box-shadow: 0 2px 10px -4px rgba(10, 42, 102, .35); transition: transform .35s var(--cx-ease); }
.mode[data-mode="sub"] .mode__slider { transform: translateX(calc(100% + 2px)); }
.supply { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 20px 22px; border: 1.5px solid var(--cx-line); border-radius: var(--cx-radius); background: #fff; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.supply:hover { border-color: #aebfdc; }
.supply input { position: absolute; opacity: 0; pointer-events: none; }
.supply__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b5c4de; display: grid; place-items: center; transition: border-color .2s; }
.supply__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cx-acc); transform: scale(0); transition: transform .2s var(--cx-ease); }
.supply:has(input:checked) { border-color: var(--cx-acc); background: var(--cx-soft); box-shadow: 0 0 0 1px var(--cx-acc); }
.supply:has(input:checked) .supply__dot { border-color: var(--cx-acc); }
.supply:has(input:checked) .supply__dot::after { transform: scale(1); }
.supply input:focus-visible ~ .supply__dot { outline: 3px solid var(--cx-acc); outline-offset: 3px; }
.supply__tag { position: absolute; top: -11px; right: 20px; background: var(--cx-ink); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 11px; border-radius: var(--cx-pill); }
.supply__tag--sun { background: var(--cx-hi); color: var(--cx-ink); }
.supply__name { display: block; font-size: 18px; font-weight: 700; color: var(--cx-ink); line-height: 1.2; }
.supply__meta { display: block; font-size: 13.5px; color: var(--cx-muted); margin-top: 3px; }
.supply__per { display: block; font-size: 13px; font-weight: 700; color: var(--cx-acc); margin-top: 3px; }
.supply__price { text-align: right; font-size: 21px; font-weight: 800; color: var(--cx-ink); white-space: nowrap; letter-spacing: -.02em; }
.supply__price s { display: block; font-size: 13px; font-weight: 500; color: var(--cx-muted); letter-spacing: 0; }
.supply__save { display: block; font-size: 12px; font-weight: 800; color: var(--cx-ok); letter-spacing: 0; }
.supplies { display: grid; gap: 14px; }
.sub-note { display: none; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 13px 16px; border-radius: calc(var(--cx-radius) * .7); background: var(--cx-soft); color: var(--cx-ink); font-size: 14px; line-height: 1.5; }
.sub-note.is-on { display: flex; }
.sub-note .icon { width: 20px; height: 20px; color: var(--cx-acc); margin-top: 1px; }
.qty-row { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; margin-top: 22px; }
.qty { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; height: 60px; border: 1.5px solid var(--cx-line); border-radius: var(--cx-pill); background: #fff; }
.qty button { height: 100%; display: grid; place-items: center; border-radius: var(--cx-pill); color: var(--cx-ink); }
.qty button:hover { background: var(--cx-soft); }
.qty .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.qty input { width: 100%; text-align: center; border: 0; background: none; font-weight: 700; font-size: 16px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.overlay { position: fixed; inset: 0; z-index: 250; background: rgba(6, 26, 66, .5); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.overlay.is-open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 260; width: min(470px, 100%); background: #fff; display: flex; flex-direction: column; transform: translateX(104%); transition: transform .42s var(--cx-ease); box-shadow: -30px 0 60px -40px rgba(0, 0, 0, .5); }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--cx-line); }
.drawer__head h2 { font-size: 24px; }
.drawer__head h2 small { font-size: 14px; font-weight: 500; color: var(--cx-muted); margin-left: 8px; letter-spacing: 0; }
.drawer__ship { padding: 14px 24px; background: var(--cx-soft); font-size: 14px; color: var(--cx-ink); }
.drawer__bar { height: 6px; border-radius: 6px; background: rgba(10, 42, 102, .12); margin-top: 9px; overflow: hidden; }
.drawer__bar i { display: block; height: 100%; background: var(--cx-acc); width: 0; transition: width .5s var(--cx-ease); border-radius: 6px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 4px 24px; }
.drawer__empty { text-align: center; padding: 64px 12px; }
.drawer__empty .icon { width: 46px; height: 46px; margin: 0 auto 16px; color: var(--cx-muted); }
.drawer__empty p { color: var(--cx-muted); }
.line { display: grid; grid-template-columns: 88px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--cx-line); }
.line__img { border-radius: 14px; overflow: hidden; background: var(--cx-soft); aspect-ratio: 1; border: 1px solid var(--cx-line); }
.line__img img { width: 100%; height: 100%; object-fit: cover; }
.line__title { font-weight: 700; color: var(--cx-ink); font-size: 15.5px; line-height: 1.3; }
.line__meta { font-size: 13px; color: var(--cx-muted); margin-top: 3px; line-height: 1.45; }
.line__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.line .qty { height: 38px; grid-template-columns: 32px 34px 32px; border-width: 1px; }
.line .qty .icon { width: 13px; height: 13px; }
.line .qty input { font-size: 14px; }
.line__price { font-weight: 800; color: var(--cx-ink); }
.line__remove { font-size: 12.5px; color: var(--cx-muted); text-decoration: underline; text-underline-offset: 3px; }
.line__remove:hover { color: var(--cx-danger); }
.drawer__foot { padding: 20px 24px 26px; border-top: 1px solid var(--cx-line); }
.drawer__total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; margin-bottom: 4px; }
.drawer__total b { font-size: 26px; color: var(--cx-ink); letter-spacing: -.02em; }
.drawer__foot .tiny { margin-bottom: 14px; }
.drawer__more { display: block; text-align: center; margin-top: 12px; font-size: 14px; color: var(--cx-muted); text-decoration: underline; text-underline-offset: 3px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 300; transform: translate(-50%, 20px); background: var(--cx-ink); color: #fff; padding: 14px 24px; border-radius: var(--cx-pill); font-size: 14.5px; font-weight: 600; opacity: 0; visibility: hidden; transition: all .35s var(--cx-ease); display: flex; gap: 10px; align-items: center; box-shadow: var(--cx-shadow); }
.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast .icon { color: var(--cx-hi); width: 18px; height: 18px; stroke-width: 3; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 700; color: var(--cx-ink); }
.field input, .field select, .field textarea { width: 100%; padding: 15px 18px; border-radius: 14px; border: 1.5px solid var(--cx-line); background: #fff; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cx-acc); box-shadow: 0 0 0 4px rgba(21, 88, 214, .14); }
.field textarea { min-height: 150px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--cx-danger); }
.field__err { display: none; font-size: 13px; color: var(--cx-danger); }
.field--error .field__err { display: block; }
.side-card { background: var(--cx-soft); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 28px; margin-bottom: 16px; }
.side-card h3 { font-size: 21px; margin-bottom: 14px; }
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--cx-line); font-size: 15px; }
.rows > div:last-child { border-bottom: 0; }
.rows b { color: var(--cx-ink); text-align: right; }
.box-result { margin-top: 16px; padding: 18px 20px; border-radius: var(--cx-radius); background: #fff; border: 1px solid var(--cx-line); font-size: 15px; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.cart-items { border: 1px solid var(--cx-line); border-radius: var(--cx-radius); overflow: hidden; background: #fff; }
.cart-items .line { padding: 24px; grid-template-columns: 112px 1fr; }
.cart-items .line:last-child { border-bottom: 0; }
.summary { position: sticky; top: 110px; background: var(--cx-soft); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: clamp(24px, 3vw, 34px); }
.summary h2 { font-size: 26px; margin-bottom: 16px; }
.srow { display: flex; justify-content: space-between; padding: 9px 0; font-size: 15.5px; }
.srow--total { border-top: 1px solid var(--cx-line); margin-top: 8px; padding-top: 16px; font-weight: 800; font-size: 18px; color: var(--cx-ink); }
.srow--total span:last-child { font-size: 28px; letter-spacing: -.02em; }
.free { color: var(--cx-ok); font-weight: 800; }
.summary .btn { margin-top: 18px; }
.cart-empty { text-align: center; padding: 90px 20px; border-radius: var(--cx-radius); background: var(--cx-soft); border: 1px solid var(--cx-line); }
.cart-empty .icon { width: 52px; height: 52px; margin: 0 auto 16px; color: var(--cx-muted); }
.checkout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-height: 100vh; }
.checkout__main { padding: clamp(24px, 4vw, 52px) clamp(20px, 5vw, 80px) 80px; }
.checkout__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(24px, 4vw, 40px); max-width: 640px; margin-inline: auto; }
.checkout__bar img { height: 52px; width: auto; }
.secure { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--cx-muted); }
.secure .icon { width: 16px; height: 16px; }
.co-steps { display: flex; gap: 12px; max-width: 640px; margin: 0 auto 28px; }
.co-step { flex: 1; padding-top: 12px; border-top: 3px solid var(--cx-line); font-size: 12.5px; color: var(--cx-muted); transition: border-color .3s; }
.co-step b { display: block; font-size: 13.5px; color: var(--cx-muted); }
.co-step.is-active { border-color: var(--cx-acc); }
.co-step.is-active b, .co-step.is-done b { color: var(--cx-ink); }
.co-step.is-done { border-color: var(--cx-ink); }
.co-form { max-width: 640px; margin: 0 auto; }
.co-panel { display: none; background: #fff; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: clamp(22px, 3vw, 34px); }
.co-panel.is-active { display: block; animation: rise .4s var(--cx-ease); }
.co-panel h2 { font-size: 28px; margin-bottom: 6px; }
.co-panel hr { border: 0; border-top: 1px solid var(--cx-line); margin: 6px 0; }
.co-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.co-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--cx-muted); }
.co-back:hover { color: var(--cx-acc); }
.co-back .icon { width: 16px; height: 16px; transform: rotate(180deg); }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1.5px solid var(--cx-line); border-radius: var(--cx-radius); margin-bottom: 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.opt:has(input:checked) { border-color: var(--cx-acc); background: var(--cx-soft); }
.opt input { accent-color: var(--cx-acc); width: 18px; height: 18px; }
.opt b { display: block; color: var(--cx-ink); font-size: 15.5px; }
.opt small { color: var(--cx-muted); font-size: 13.5px; }
.opt .p { font-weight: 800; color: var(--cx-ink); }
.paytabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.paytab { padding: 14px; border: 1.5px solid var(--cx-line); border-radius: var(--cx-radius); font-weight: 700; background: #fff; }
.paytab[aria-selected="true"] { border-color: var(--cx-acc); background: var(--cx-soft); color: var(--cx-ink); }
.cardviz { background: linear-gradient(135deg, #0d3a8f, #061a42 70%); color: #fff; border-radius: 18px; padding: 22px 24px; margin-bottom: 20px; max-width: 350px; aspect-ratio: 1.6; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--cx-shadow); }
.cardviz__chip { width: 42px; height: 31px; border-radius: 7px; background: linear-gradient(135deg, #ffe08a, #e0a824); }
.cardviz__num { font-size: 20px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.cardviz__row { display: flex; justify-content: space-between; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.co-summary { background: var(--cx-soft); border-left: 1px solid var(--cx-line); padding: clamp(24px, 4vw, 52px) clamp(20px, 5vw, 64px); }
.co-summary[hidden] { display: none !important; }
.co-summary__in { max-width: 440px; position: sticky; top: 36px; }
.co-summary h3 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--cx-muted); margin-bottom: 14px; }
.co-lines { background: #fff; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 0 16px; }
.co-lines .line { grid-template-columns: 72px 1fr auto; align-items: center; padding: 16px 0; }
.co-lines .line:last-child { border-bottom: 0; }
.disc { display: flex; gap: 8px; margin: 18px 0 6px; }
.disc input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--cx-line); background: #fff; font-size: 15px; outline: none; }
.disc input:focus { border-color: var(--cx-acc); }
.disc .btn { min-height: 48px; padding: 8px 22px; font-size: 13px; }
.done { text-align: center; max-width: 600px; margin: 24px auto 0; }
.done__tick { width: 80px; height: 80px; border-radius: 50%; background: var(--cx-soft); color: var(--cx-acc); display: grid; place-items: center; margin: 0 auto 24px; }
.done__tick .icon { width: 38px; height: 38px; stroke-width: 2.6; }
.done h2 { font-size: clamp(32px, 4vw, 46px); margin-bottom: 10px; }
.receipt { margin-top: 26px; text-align: left; background: #fff; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 26px; font-size: 15px; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; }
.receipt dt { color: var(--cx-muted); }
.receipt dd { margin: 0; font-weight: 700; text-align: right; color: var(--cx-ink); }
.demo-flag { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--cx-ink); background: var(--cx-soft); padding: 8px 14px; border-radius: var(--cx-pill); margin-bottom: 18px; }
.demo-flag .icon { width: 15px; height: 15px; }
.checkout:has(.done:not([hidden])) { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 960px) {
  .cart-layout, .contact-grid { grid-template-columns: minmax(0,1fr); }
  .summary { position: static; }
  .checkout { grid-template-columns: minmax(0,1fr); }
  .co-summary { border-left: 0; border-bottom: 1px solid var(--cx-line); order: -1; }
  .co-summary__in { position: static; max-width: none; }
  .co-steps { display: none; }
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .cart-items .line { grid-template-columns: 84px 1fr; padding: 18px; }
  .co-lines .line { grid-template-columns: 60px 1fr auto; }
  .co-actions { flex-direction: column-reverse; align-items: stretch; }
  .co-actions .btn { width: 100%; padding-inline: 18px; }
  .co-back { justify-content: center; padding: 10px 0; }
}
