/* Full-page checkout overlay — Shopify-style 2-column.
   Left: form (contact / delivery / shipping / payment).
   Right: sticky order summary. */

.checkout-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  background-color: var(--bg-primary);
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.checkout-page[hidden] { display: none; }
.checkout-page[aria-hidden="false"] { opacity: 1; }

.checkout-page__header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.checkout-page__header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.checkout-page__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.checkout-page__logo-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
}
.checkout-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.checkout-page__back:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.checkout-page__grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 3rem;
  align-items: start;
  padding: 2rem 1.5rem 3rem;
}
@media (max-width: 920px) {
  .checkout-page__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem 1rem 2rem;
  }
}

/* Form side */
.checkout-page__form { min-width: 0; }
.co-section {
  margin-bottom: 2rem;
}
.co-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.co-section__header h2 {
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.co-section__header small {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Express checkout (PayPal at top) */
.co-express {
  padding: 1rem 1rem 1.2rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.co-express__label {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}
#paypal-express-container,
#paypal-button-container {
  min-height: 45px;
}
.co-or {
  position: relative;
  text-align: center;
  margin: 1.25rem 0;
}
.co-or::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--border);
}
.co-or span {
  position: relative;
  background-color: var(--bg-primary);
  padding: 0 0.8rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Fields */
.co-field {
  display: block;
  margin-bottom: 1rem;
  position: relative;
}
.co-field label,
.co-field > span.co-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.co-field input,
.co-field select,
.co-field textarea {
  width: 100%;
  padding: 0.85rem 2.4rem 0.85rem 0.95rem;  /* extra right padding for ✓/✕ icon slot */
  min-height: 48px;                          /* mobile-friendly tap target */
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;                           /* ≥16px prevents iOS zoom-on-focus */
  font-family: inherit;
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Selects don't need the icon-slot padding; native chevron handles it */
.co-field select { padding-right: 2.4rem; }
.co-field textarea { resize: vertical; min-height: 84px; padding-right: 0.95rem; }
.co-field input:focus,
.co-field select:focus,
.co-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Validation visuals — only paint once the field has been "touched"
   (blurred at least once OR submit attempted). A pristine form stays
   neutral so first-character typing doesn't flash red. */
.co-field.is-touched.has-err input,
.co-field.is-touched.has-err select,
.co-field.is-touched.has-err textarea {
  border-color: var(--accent);
  background-color: rgba(229, 57, 53, 0.04);
}
.co-field.is-touched.is-valid input,
.co-field.is-touched.is-valid select,
.co-field.is-touched.is-valid textarea {
  border-color: rgba(76, 175, 80, 0.55);
}

/* ✓ / ✕ status icon slotted in the right padding of inputs. Hidden
   for textareas + selects (would clash with the resize handle / native
   chevron). Drawn with currentColor + masked SVGs so palette tokens
   carry through. */
.co-field.is-touched::after {
  content: '';
  position: absolute;
  right: 0.95rem;
  top: 1.95rem;            /* sits inside the input vertical centre */
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: 18px 18px;
          mask-size: 18px 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.co-field.is-touched.has-err::after  {
  opacity: 1;
  color: var(--accent);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'><circle cx='12' cy='12' r='10'/><line x1='15' y1='9' x2='9' y2='15'/><line x1='9' y1='9' x2='15' y2='15'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'><circle cx='12' cy='12' r='10'/><line x1='15' y1='9' x2='9' y2='15'/><line x1='9' y1='9' x2='15' y2='15'/></svg>");
}
.co-field.is-touched.is-valid::after {
  opacity: 1;
  color: var(--success, #4caf50);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}
/* Hide the icon for fields that don't have an <input> (selects keep
   the native chevron, textareas keep their resize grip). */
.co-field:has(select)::after,
.co-field:has(textarea)::after { display: none; }

/* Error message — slides in from the top with a soft fade. */
.co-field .co-err {
  display: block;
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 0.35rem;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-2px);
  transition: max-height 0.22s ease, opacity 0.22s ease, transform 0.22s ease, margin-top 0.22s ease;
}
.co-field.is-touched.has-err .co-err {
  max-height: 60px;
  opacity: 1;
  transform: translateY(0);
}
.co-field .co-err:empty { margin-top: 0; }

.co-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.co-row--three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 520px) {
  .co-row,
  .co-row--three { grid-template-columns: 1fr; }
}

.co-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}
.co-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Radio blocks (shipping method + payment) */
.co-radio-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-secondary);
}
.co-radio-block + .co-radio-block {
  border-top: 1px solid var(--border);
}
.co-radio-pill {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.co-radio-pill:hover { background-color: var(--bg-elevated); }
.co-radio-pill input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
.co-radio-pill__label {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.co-radio-pill__price {
  font-weight: 600;
  color: var(--text-primary);
}
.co-radio-pill__icon {
  width: 28px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.co-radio-block {
  background-color: var(--bg-secondary);
}
.co-radio-block.is-selected {
  background-color: var(--bg-elevated);
}
.co-radio-block.is-selected .co-radio-pill__label {
  color: var(--text-primary);
}
.co-radio-details {
  padding: 1rem;
  border-top: 1px dashed var(--border);
  display: none;
}
.co-radio-block.is-selected .co-radio-details { display: block; }

/* Pay button */
.co-pay-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0.5rem;
}
.co-pay-btn[hidden] { display: none !important; }
.co-small {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.8rem 0 0;
}

/* Summary side */
.checkout-page__summary { min-width: 0; }
.co-summary-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: sticky;
  top: 5rem;
}
@media (max-width: 920px) {
  .co-summary-box { position: static; }
}

.co-summary-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.co-summary-line__visual {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-primary));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}
.co-summary-line__tube {
  width: 12px;
  height: 36px;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
}
.co-summary-line__qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--text-secondary);
  color: var(--bg-primary);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
}
.co-summary-line__info {
  min-width: 0;
}
.co-summary-line__name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.co-summary-line__variant {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.co-summary-line__price {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.co-summary-discount {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.co-summary-discount input {
  flex: 1;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.88rem;
}
.co-summary-discount button {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.co-summary-discount button:hover:not(:disabled) {
  color: var(--text-primary);
  background-color: var(--accent-soft);
}
.co-summary-discount button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.co-summary-totals {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.co-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.co-summary-row.co-summary-total {
  font-size: 1rem;
  color: var(--text-primary);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.co-summary-row.co-summary-total strong {
  font-size: 1.35rem;
  font-weight: 700;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
.co-summary-row.co-summary-total .co-currency {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
/* Plain-language description right under the Shipping row so the
   customer understands the tier before they hit the PayPal button. */
.co-shipping-note {
  margin: -0.15rem 0 0.25rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}
/* Minimum-order banner — sits below the totals; only visible when the
   cart is non-empty AND below the 3-piece minimum. */
.co-min-order {
  margin: 1rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background-color: rgba(229, 57, 53, 0.12);
  border: 1px solid rgba(229, 57, 53, 0.35);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.45;
}

/* Success screen */
.co-success {
  max-width: 520px;
  margin: 4rem auto;
  padding: 2.5rem 2rem;
  text-align: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: coSuccessIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes coSuccessIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.co-success svg {
  color: #22c55e;
  margin-bottom: 1rem;
}
.co-success h3 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.co-success p { margin: 0.4rem 0; color: var(--text-secondary); }
.co-success p strong { color: var(--text-primary); }
.co-success .btn { margin-top: 1.2rem; }

/* Form errors / empty cart */
.co-empty-notice {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.co-empty-notice h3 { color: var(--text-primary); margin-bottom: 0.5rem; }

/* Shipping info card (fixed Express Shipping) */
.co-ship-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background-color: var(--accent-soft);
}
.co-ship-info__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background-color: var(--bg-elevated);
  color: var(--accent);
}
.co-ship-info__label {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.3;
}
.co-ship-info__price {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .co-ship-info { gap: 0.6rem; padding: 0.85rem 0.9rem; }
  .co-ship-info__icon { width: 32px; height: 32px; }
  .co-ship-info__label { font-size: 0.9rem; }
}

/* PayPal-only payment wrap */
.co-paypal-wrap {
  padding: 1.1rem 1rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.co-paypal-wrap #paypal-button-container { min-height: 45px; }
.co-paypal-wrap .co-small { margin: 0.8rem 0 0; }

/* ==========================================================================
   Step 1 — Progress bar + sticky sidebar + mobile mini-summary
   ========================================================================== */

/* Progress bar — sits below the page header, sticky so it follows the
   user as they scroll. Step circles connected by thin lines; the active
   step lights up accent, passed steps stay accent-toned, future steps
   sit muted. Clickable as anchor links (smooth-scrolled by JS). */
.co-progress {
  position: sticky;
  top: 62px;             /* slot below the sticky page header */
  z-index: 4;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.co-progress__list {
  list-style: none;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;       /* prevent line-break on narrow phones */
  scrollbar-width: none;
}
.co-progress__list::-webkit-scrollbar { display: none; }

.co-progress__step {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease;
  cursor: pointer;
}
.co-progress__step:hover { color: var(--text-secondary); background: var(--bg-elevated); }

.co-progress__num {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-muted);
  flex: 0 0 auto;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.co-progress__step.is-active {
  color: var(--text-primary);
}
.co-progress__step.is-active .co-progress__num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.co-progress__step.is-passed { color: var(--text-secondary); }
.co-progress__step.is-passed .co-progress__num {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.co-progress__sep {
  flex: 1 1 auto;
  height: 1.5px;
  min-width: 24px;
  max-width: 90px;
  background: var(--border-strong);
  border-radius: 2px;
}

/* Long/short label swap — full labels on desktop, abbreviations on
   tight phones so all 3 steps fit in a 360px viewport without
   horizontal scroll. Mobile dimensions tuned for legibility (font
   ≥0.82rem on 375px so a glance reads each step at arm's length). */
.co-progress__label-short { display: none; }
@media (max-width: 520px) {
  .co-progress__list { padding: 0.7rem 0.75rem; gap: 0.4rem; justify-content: space-between; }
  .co-progress__step { padding: 0.3rem 0.45rem; font-size: 0.84rem; gap: 0.5rem; font-weight: 600; }
  .co-progress__num  { width: 24px; height: 24px; font-size: 0.78rem; border-width: 2px; }
  .co-progress__sep  { min-width: 8px;  max-width: 28px; height: 2px; }
  .co-progress__label-full  { display: none; }
  .co-progress__label-short { display: inline; }
}
@media (max-width: 380px) {
  .co-progress__list { padding: 0.6rem 0.55rem; gap: 0.3rem; }
  .co-progress__step { padding: 0.25rem 0.35rem; font-size: 0.83rem; gap: 0.4rem; }
  .co-progress__num  { width: 22px; height: 22px; font-size: 0.74rem; }
  .co-progress__sep  { min-width: 6px; max-width: 18px; }
}

/* Sticky sidebar (desktop) — pinned below the header + progress bar.
   align-self:start is critical so the aside doesn't stretch the row. */
@media (min-width: 921px) {
  .checkout-page__summary {
    position: sticky;
    top: 130px;            /* header (62) + progress (~62) + a little air */
    align-self: start;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

/* Mobile order-summary accordion. The mini bar is a sticky toggle
   <button>; click flips aria-expanded + adds .is-summary-open on the
   page, which reveals the existing <aside> right above the form. */
.co-mini-summary {
  display: none;          /* desktop hides this; mobile breakpoint flips it */
}
@media (max-width: 920px) {
  .co-mini-summary {
    position: sticky;
    top: 116px;           /* below header (~62) + progress (~54 mobile) */
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    background-color: var(--bg-elevated);
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
  }
  .co-mini-summary:hover { background-color: var(--bg-secondary); }
  .co-mini-summary__label { flex: 1 1 auto; }
  .co-mini-summary__total {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
  }
  .co-mini-summary__chev {
    color: var(--text-muted);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .co-mini-summary[aria-expanded="true"] .co-mini-summary__chev {
    transform: rotate(180deg);
    color: var(--accent);
  }
  .co-mini-summary[aria-expanded="true"] {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--accent);
  }

  /* Aside on mobile — collapsed by default, expanded inline above
     the form when the user opens the accordion. order:-1 puts it
     above the form in the single-column grid; max-height transition
     gives a smooth open/close feel. */
  .checkout-page__summary {
    order: -1;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                padding 0.22s ease,
                border-color 0.22s ease,
                margin 0.22s ease;
  }
  .checkout-page.is-summary-open .checkout-page__summary {
    max-height: 1200px;
    padding: 0;
    border-color: transparent;
    margin: 0 0 1rem;
  }
}

@media (max-width: 520px) {
  .co-mini-summary { top: 102px; padding: 0.78rem 0.9rem; font-size: 0.9rem; }
  .co-mini-summary__total { font-size: 1rem; }
}
@media (max-width: 380px) {
  .co-mini-summary { top: 92px; padding: 0.7rem 0.85rem; }
}

/* Step 1 — Review Cart compact line list */
.co-review {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.co-review__line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
}
.co-review__line:last-child { border-bottom: 0; }
.co-review__qty {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.co-review__info { min-width: 0; }
.co-review__name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.co-review__variant {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}
.co-review__price {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.co-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.co-link:hover { color: var(--accent-hover); }

/* Anchor-scroll offset — first row of each step shouldn't sit hidden
   under the sticky header + progress bar after a step click. */
#co-step-review,
#co-step-delivery,
#co-step-payment {
  scroll-margin-top: 140px;
}
@media (max-width: 920px) {
  /* Header (~62) + progress (~54) + mini bar (~50) sticky stack. */
  #co-step-review,
  #co-step-delivery,
  #co-step-payment { scroll-margin-top: 174px; }
}
@media (max-width: 520px) {
  #co-step-review,
  #co-step-delivery,
  #co-step-payment { scroll-margin-top: 160px; }
}

/* Tight-screen polish (≤480px) — trim section spacing, headings, notes
   so the form breathes on phones without the user feeling cramped. */
@media (max-width: 480px) {
  .checkout-page__grid {
    padding: 1rem 0.85rem 1.75rem;
    gap: 1rem;
  }
  .co-section { margin-bottom: 1.5rem; }
  .co-section__header { margin-bottom: 0.7rem; }
  .co-section__header h2 { font-size: 1rem; line-height: 1.3; }
  .co-section__header small { font-size: 0.78rem; }
  .co-field { margin-bottom: 0.85rem; }
  .co-field label,
  .co-field > span.co-label {
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
  }
  .co-field input,
  .co-field select,
  .co-field textarea {
    padding: 0.75rem 2.2rem 0.75rem 0.85rem;
    min-height: 46px;     /* still ≥44px Apple HIG target */
    line-height: 1.35;
  }
  .co-field select { padding-right: 2.2rem; }
  .co-field.is-touched::after { right: 0.85rem; top: 1.85rem; width: 16px; height: 16px; -webkit-mask-size: 16px 16px; mask-size: 16px 16px; }
  .co-field .co-err { font-size: 0.78rem; line-height: 1.4; }
  .co-row, .co-row--three { gap: 0.6rem; }
  .co-small { font-size: 0.78rem; line-height: 1.5; }
  .co-shipping-note { font-size: 0.76rem; }
  .co-review { padding: 0.7rem 0.8rem; }
  .co-review__line { gap: 0.55rem; padding: 0.4rem 0; }
  .co-review__name { font-size: 0.9rem; }
  .co-review__variant { font-size: 0.78rem; }
  .co-review__price { font-size: 0.9rem; }
  .co-review__qty { min-width: 32px; font-size: 0.78rem; }
}

/* ==========================================================================
   Step 3 — Trust badges + Disclaimer
   ========================================================================== */

/* Trust badges row — sits right above the PayPal button. Three cards,
   each with a soft accent-tinted icon + a heading + sub-line. The
   muted background keeps them visible without competing with the
   pay-now button next to them. */
.co-trust {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.co-trust__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.co-trust__item:hover { border-color: var(--success, #4caf50); }
.co-trust__icon {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background-color: rgba(76, 175, 80, 0.12);
  color: var(--success, #4caf50);
}
.co-trust__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.co-trust__text strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.co-trust__text small {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile — drop to single column so each badge shows full text +
   bump font sizes / padding so the row reads at a glance instead of
   squinting. Generous gap so the badges stay distinct. */
@media (max-width: 760px) {
  .co-trust {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin: 0.25rem 0 1.2rem;
  }
  .co-trust__item {
    padding: 0.95rem 1.1rem;
    gap: 0.85rem;
    border-radius: var(--radius-md);
  }
  .co-trust__icon {
    width: 40px; height: 40px;
    padding: 8px;
    border-radius: 10px;
  }
  .co-trust__text { gap: 0.18rem; }
  .co-trust__text strong {
    font-size: 0.98rem;
    line-height: 1.35;
    white-space: normal;
  }
  .co-trust__text small {
    font-size: 0.84rem;
    line-height: 1.4;
    white-space: normal;
    color: var(--text-secondary);   /* lift contrast on small screens */
  }
}

/* Disclaimer block — terms / payment processor / demo note. Sits at
   the very bottom of the form, gently muted so it doesn't shout. */
.co-disclaimer {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.co-disclaimer__legal {
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
}
.co-disclaimer__legal a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
.co-disclaimer__legal a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.co-disclaimer__note {
  margin: 0 0 0.5rem;
}
.co-disclaimer__note strong { color: var(--text-secondary); }
/* Demo / sandbox disclaimer — visually distinct from the rest of the
   muted disclaimer text so the operator sees it at a glance while
   testing. Only shown when admin.payment.mode !== "live"; checkout.js
   toggles [hidden] based on storage. */
.co-disclaimer__demo {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.75rem;
  background-color: var(--accent-soft);
  border: 1px solid rgba(229, 57, 53, 0.32);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-style: normal;
  font-size: 0.78rem;
  line-height: 1.5;
}
.co-disclaimer__demo::before {
  content: '⚠';
  flex: 0 0 auto;
  font-size: 0.95rem;
  line-height: 1;
  margin-top: 0.05rem;
}
.co-disclaimer__demo[hidden] { display: none; }

/* Sidebar trust footer — small, single line, success-tinted lock. */
.co-summary-trust {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.co-summary-trust svg {
  flex: 0 0 auto;
  color: var(--success, #4caf50);
}

/* Payment section gets a bit more breathing room on mobile so the
   trust cards + PayPal button + paypal note don't feel cramped. */
@media (max-width: 760px) {
  .co-section--payment {
    padding: 1.1rem 0.95rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    margin-bottom: 1.5rem;
  }
  .co-section--payment .co-section__header {
    margin-bottom: 0.85rem;
  }
  .co-section--payment .co-paypal-wrap { margin-top: 0.25rem; }
  .co-section--payment .co-paypal-wrap .co-small {
    margin-top: 0.95rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
  }
}

/* Tight-screen polish for disclaimer + sidebar trust (≤480px). The
   trust badges themselves stay generous on phones — see the
   ≤760px block above. We do NOT shrink them further here. */
@media (max-width: 480px) {
  .co-trust__item { padding: 0.85rem 0.95rem; gap: 0.75rem; }
  .co-trust__icon { width: 36px; height: 36px; padding: 7px; }
  .co-trust__text strong { font-size: 0.94rem; }
  .co-trust__text small  { font-size: 0.8rem; }
  .co-disclaimer { padding: 0.95rem 1rem; font-size: 0.82rem; line-height: 1.55; }
  .co-disclaimer__demo { font-size: 0.74rem; }
  .co-summary-trust { font-size: 0.78rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .checkout-page,
  .co-success { transition: none; animation: none; }
  .co-progress__step,
  .co-progress__num,
  .co-trust__item,
  .co-disclaimer__legal a { transition: none; }
}
