/* Checkout, accounts, orders, and policies for every design. Designs restyle these through the --cx-* tokens. */
:root {
  --cx-bg: #fff;
  --cx-surface: #f4f4f4;
  --cx-text: #111;
  --cx-muted: #666;
  --cx-line: #ccc;
  --cx-accent: #111;
  --cx-on-accent: #fff;
  --cx-danger: #b00020;
  --cx-success: #146c2e;
  --cx-radius: 6px;
  --cx-font: system-ui, sans-serif;
  --cx-head-font: var(--cx-font);
  --cx-head-weight: 600;
}

.cx { box-sizing: border-box; width: min(100%, 560px); margin: 0 auto; background: var(--cx-bg); padding: clamp(32px, 6vw, 64px) 16px; color: var(--cx-text); font-family: var(--cx-font); line-height: 1.5; }
.cx *, .cx *::before { box-sizing: border-box; }
.cx-wide { width: min(100%, 1120px); }
.cx h1, .cx h2 { margin: 0 0 12px; font-family: var(--cx-head-font); font-weight: var(--cx-head-weight); line-height: 1.15; color: var(--cx-text); }
.cx h1 { font-size: clamp(2rem, 5vw, 3rem); }
.cx h2 { font-size: 1.375rem; }
.cx a { color: inherit; text-underline-offset: 3px; }
.cx-head { margin-bottom: 24px; }
.cx-head p { margin: 0; color: var(--cx-muted); }
.cx-muted { color: var(--cx-muted); }
.cx-small { font-size: 0.875rem; }
.cx-or { margin-top: 32px !important; }

.cx-form { display: flex; flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 16px; }
.cx-field { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.cx-field small { color: var(--cx-muted); font-weight: 400; }
.cx-field input, .cx-field select, .cx-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--cx-text); background: var(--cx-bg); border: 1px solid var(--cx-muted); border-radius: var(--cx-radius); }
.cx-field input:focus-visible, .cx-field select:focus-visible, .cx-field textarea:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 1px; }
.cx-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.cx-check input { width: 20px; height: 20px; accent-color: var(--cx-accent); }

.cx-btn { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; min-height: 46px; padding: 10px 22px; font: inherit; font-weight: 600; text-decoration: none; color: var(--cx-on-accent) !important; background: var(--cx-accent); border: 1px solid var(--cx-accent); border-radius: var(--cx-radius); cursor: pointer; }
.cx-btn:hover { filter: brightness(1.12); }
.cx-btn[disabled] { opacity: 0.6; cursor: progress; }
.cx-btn:focus-visible, .cx-link:focus-visible, .cx-wish:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 2px; }
.cx-btn-quiet { color: var(--cx-text) !important; background: transparent; border-color: var(--cx-text); }
.cx-btn-full { display: flex; width: 100%; align-self: stretch; }
.cx-link { padding: 6px 0; font: inherit; color: var(--cx-text); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; align-self: flex-start; }
.cx-wish { min-height: 46px; padding: 10px 18px; font: inherit; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: var(--cx-radius); cursor: pointer; }
.cx-wish[aria-pressed='true'] { font-weight: 700; }

.cx-error { margin: 0 0 12px; padding: 12px; color: var(--cx-danger); background: color-mix(in srgb, var(--cx-danger) 10%, var(--cx-bg)); border: 1px solid var(--cx-danger); border-radius: var(--cx-radius); }
.cx-ok { margin: 0 0 16px; padding: 12px; color: var(--cx-success); background: color-mix(in srgb, var(--cx-success) 10%, var(--cx-bg)); border: 1px solid var(--cx-success); border-radius: var(--cx-radius); }
.cx-panel { margin-bottom: 16px; padding: 20px; background: var(--cx-surface); border-radius: var(--cx-radius); }
.cx-panel p { margin: 0 0 8px; }
.cx-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px; align-items: start; }
.cx-split-wide { grid-template-columns: minmax(0, 3fr) minmax(min(100%, 280px), 2fr); }

.cx-steps { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 28px; padding: 0; list-style: none; color: var(--cx-muted); font-size: 0.9375rem; }
.cx-steps .is-now { color: var(--cx-text); font-weight: 700; }
.cx-steps .is-done { color: var(--cx-text); }

.cx-choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); cursor: pointer; }
.cx-choice:has(input:checked) { border-color: var(--cx-accent); box-shadow: inset 0 0 0 1px var(--cx-accent); }
.cx-choice input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--cx-accent); }
.cx-choice-wide > span { flex: 1; }
.cx-logo { height: 28px; width: auto; max-width: 72px; object-fit: contain; }
.cx-inline { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 16px; }
.cx-inline .cx-field { flex: 1; }

.cx-lines { margin: 0 0 16px; padding: 0; list-style: none; }
.cx-lines li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--cx-line); }
.cx-lines img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: var(--cx-radius); }
.cx-totals { margin-bottom: 16px; }
.cx-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.cx-total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--cx-text); font-size: 1.25rem; font-weight: 700; }
.cx-pay-frame { width: 100%; min-height: 560px; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); }

.cx-tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 28px; border-bottom: 1px solid var(--cx-line); }
.cx-tabs a { padding: 10px 0; text-decoration: none; }
.cx-tabs a[aria-current] { font-weight: 700; border-bottom: 3px solid var(--cx-accent); }
.cx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.cx-cards li { padding: 16px; background: var(--cx-surface); border-radius: var(--cx-radius); }
.cx-cards a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.cx-cards img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: var(--cx-radius); }
.cx-plain { margin: 0 0 16px; padding: 0; list-style: none; }
.cx-plain li { padding: 12px 0; border-bottom: 1px solid var(--cx-line); }
.cx-plain p { margin: 4px 0 0; }
.cx-facts { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 0 0 28px; }
.cx-facts dt { color: var(--cx-muted); font-size: 0.875rem; }
.cx-facts dd { margin: 0; font-weight: 700; }
.cx-prose { max-width: 66ch; }
.cx-social { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.cx-social .cx-btn { width: 100%; align-self: stretch; }
.cx-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Catalog controls and product extras, inside the design's own pages */
.cx-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 0 0 28px; font-family: var(--cx-font); color: var(--cx-text); }
.cx-toolbar .cx-field { flex: 1 1 180px; }
.cx-more { display: flex; justify-content: center; margin-top: 40px; }
.cx-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cx-thumbs button { width: 64px; height: 64px; padding: 2px; background: #fff; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); cursor: pointer; }
.cx-thumbs button[aria-pressed='true'] { border: 2px solid var(--cx-accent); }
.cx-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.cx-extras { display: flex; flex-direction: column; gap: 40px; padding-top: 16px; }
.cx-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 20px; }
.cx-foot { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 16px; font-family: var(--cx-font); }
.cx-foot a { color: inherit; }

/* Sensible defaults for shared product and bag views. Designs override any of it. */
.state { padding: clamp(64px, 12vw, 140px) 16px; text-align: center; font-family: var(--cx-font); color: var(--cx-text); }
.card { position: relative; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.card-photo { display: block; aspect-ratio: 1; overflow: hidden; background: #fff; }
.card-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-chip { position: absolute; top: 8px; left: 8px; padding: 2px 8px; background: var(--cx-accent); color: var(--cx-on-accent); font-size: 0.8125rem; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); max-width: 1240px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) 16px 32px; align-items: start; }
.pdp-photo { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.pdp h1 { margin: 8px 0 0; overflow-wrap: break-word; }
.pdp-back { color: inherit; }
.pdp-price { margin: 12px 0 0; font-size: 1.375rem; }
.pdp-price s { font-size: 1rem; opacity: 0.65; }
.pdp fieldset { margin: 24px 0 0; padding: 0; border: 0; }
.pdp legend { margin-bottom: 8px; padding: 0; font-weight: 700; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 44px; padding: 8px 14px; font: inherit; color: inherit; background: transparent; border: 1px solid currentColor; cursor: pointer; }
.opt[aria-pressed='true'] { background: var(--cx-accent); color: var(--cx-on-accent); border-color: var(--cx-accent); }
.pdp-stock { margin: 16px 0; }
.pdp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pdp-add { min-height: 46px; padding: 10px 24px; font: inherit; font-weight: 600; color: var(--cx-on-accent); background: var(--cx-accent); border: 1px solid var(--cx-accent); cursor: pointer; }
.pdp-add[disabled] { opacity: 0.5; cursor: not-allowed; }
.pdp-notice { min-height: 1.5em; margin: 12px 0 0; }
.pdp-notice a { color: inherit; }
.pdp-desc { margin-top: 24px; max-width: 62ch; }
.pdp-desc p { margin: 0 0 12px; }
.bag { width: min(100%, 860px); margin: 0 auto; padding: clamp(32px, 6vw, 72px) 16px; }
.bag-empty { text-align: center; }
.bag h1 { margin: 0 0 24px; }
.bag a { color: inherit; }
.bag-lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid currentColor; }
.bag-lines li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid currentColor; }
.bag-lines img { width: 96px; height: 96px; object-fit: contain; background: #fff; }
.bag-option { opacity: 0.75; }
.qty { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.qty button { width: 44px; height: 44px; font: inherit; font-weight: 700; color: inherit; background: none; border: 1px solid currentColor; cursor: pointer; }
.qty button[disabled] { opacity: 0.4; cursor: not-allowed; }
.qty span { min-width: 2.5ch; text-align: center; }
.bag-total { display: flex; justify-content: space-between; margin-top: 20px; font-size: 1.375rem; font-weight: 700; }
.bag-note { margin: 4px 0 16px; opacity: 0.75; }

@media (max-width: 760px) {
  .pdp { grid-template-columns: minmax(0, 1fr); }
  .cx-split-wide { grid-template-columns: minmax(0, 1fr); }
  .bag-lines li { grid-template-columns: 72px minmax(0, 1fr); }
  .bag-lines img { width: 72px; height: 72px; }
  .bag-price { grid-column: 2; }
}
