/* ══════════════════════════════════════════════════════════
   MemAero CART DRAWER + CHECKOUT MODAL
   Re-skinned from type19specialists/public/css/cart-checkout.css
   to the MemAero light theme using --color-* tokens from
   src/styles/memaero-tokens.css (loaded globally).

   Key changes from type19 source:
   - Dark-surface values (#1E2F36, rgba(0,0,0,0.25) backgrounds,
     rgba(255,255,255,*) borders) replaced with light-surface values
     (#FFFFFF, #EDEAE4, rgba(20,23,26,*) borders)
   - Form input colours flipped to dark text on white background
   - Stripe Elements appearance updated in memaero-cart-ui.js (theme:'stripe')
   - Pay-spinner card uses white card on near-black scrim
   - All t19-* selectors renamed memaero-*
   ══════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.memaero-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 999;
}
.memaero-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ══════════════ CART DRAWER ══════════════ */
.memaero-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 420px;
  max-width: 100vw;
  background: var(--color-surface, #F8F5F0);
  color: var(--color-text, #1F2124);
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.12);
}
.memaero-drawer.open { transform: translateX(0); }

.memaero-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border, rgba(20,23,26,0.10));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.memaero-drawer-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.memaero-drawer-count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--color-text-muted, #7A8794);
  margin-left: 6px;
}
.memaero-drawer-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 4px 8px;
  border-radius: 4px;
}
.memaero-drawer-close:hover { background: rgba(20,23,26,0.05); }

.memaero-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.memaero-drawer-empty {
  padding: 48px 24px;
  text-align: center;
}
.memaero-drawer-empty p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.memaero-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border, rgba(20,23,26,0.06));
  align-items: start;
}
.memaero-line-img {
  grid-row: 1 / span 2;
  width: 64px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-surface-elevated, #EDEAE4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.memaero-line-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.memaero-line-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}
.memaero-line-name a { color: inherit; text-decoration: none; }
.memaero-line-name a:hover { text-decoration: underline; }
.memaero-line-variant {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.memaero-line-price {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  grid-column: 3;
  grid-row: 1;
}
.memaero-line-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 2 / span 2;
  grid-row: 2;
  margin-top: 6px;
}
.memaero-qty-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border, rgba(20,23,26,0.15));
  border-radius: 4px;
  overflow: hidden;
}
.memaero-qty-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: inherit;
}
.memaero-qty-btn:hover { background: rgba(20,23,26,0.05); }
.memaero-qty-val {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
}
.memaero-line-remove {
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  padding: 4px;
}
.memaero-line-remove:hover { color: var(--color-error, #EF4444); }

/* Upsell rail */
.memaero-upsells {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, rgba(20,23,26,0.06));
}
.memaero-upsells-title {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 12px;
}
.memaero-upsell-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -24px;
  padding: 0 24px 4px;
}
.memaero-upsell-scroll::-webkit-scrollbar { height: 4px; }
.memaero-upsell-scroll::-webkit-scrollbar-thumb { background: rgba(20,23,26,0.15); border-radius: 2px; }
.memaero-upsell {
  flex: 0 0 200px;
  scroll-snap-align: start;
  border: 1px solid var(--color-border, rgba(20,23,26,0.10));
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-surface-elevated, #EDEAE4);
  display: flex;
  flex-direction: column;
}
.memaero-upsell-img {
  aspect-ratio: 4 / 3;
  background: #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.memaero-upsell-img img { width: 100%; height: 100%; object-fit: cover; }
.memaero-upsell-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.memaero-upsell-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}
.memaero-upsell-price {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--color-text-muted);
}
.memaero-upsell-add {
  background: var(--color-primary, #C8102E);
  color: #fff;
  border: 0;
  padding: 6px 10px;
  margin-top: 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease;
}
.memaero-upsell-add:hover { transform: translateY(-1px); }
.memaero-upsell-add.added { background: var(--color-success, #10B981); }

/* Footer */
.memaero-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border, rgba(20,23,26,0.08));
  background: var(--color-surface, #F8F5F0);
  flex-shrink: 0;
}
.memaero-drawer-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.memaero-drawer-subtotal-label {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.memaero-drawer-subtotal-val {
  font-family: var(--font-mono, monospace);
  font-size: 20px;
  font-weight: 700;
}
.memaero-shipping-progress {
  height: 4px;
  background: rgba(20,23,26,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.memaero-shipping-progress-bar {
  height: 100%;
  background: var(--color-primary, #C8102E);
  transition: width 220ms ease;
}
.memaero-shipping-msg {
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 0 0 14px;
  font-family: var(--font-mono, monospace);
}
.memaero-shipping-msg.eligible { color: var(--color-success, #10B981); }

.memaero-drawer-cta {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--color-primary, #C8102E);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
  text-align: center;
  text-decoration: none;
}
.memaero-drawer-cta:hover { background: var(--color-primary-hover, #A50D26); transform: translateY(-1px); }
.memaero-drawer-cta:disabled { opacity: 0.5; cursor: not-allowed; }

.memaero-drawer-secondary {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: underline;
}

.memaero-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 10px;
  color: var(--color-text-muted);
  font-family: var(--font-mono, monospace);
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.memaero-trust-row li {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.memaero-trust-row svg { flex-shrink: 0; }

/* Resume toast in drawer */
.memaero-resume-toast {
  margin: 12px 24px;
  padding: 12px 14px;
  background: rgba(200, 16, 46, 0.06);
  border: 1px solid var(--color-primary, #C8102E);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.memaero-resume-btn {
  background: var(--color-primary, #C8102E);
  color: #fff;
  border: 0;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}

/* ══════════════ CHECKOUT MODAL ══════════════ */
.memaero-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.memaero-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.memaero-modal-panel {
  background: var(--color-surface, #F8F5F0);
  color: var(--color-text, #1F2124);
  border-radius: 8px;
  width: 100%;
  max-width: 960px;
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  transform: translateY(12px);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.memaero-modal.open .memaero-modal-panel { transform: translateY(0); }

.memaero-modal-trustbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 10px 24px;
  background: var(--color-surface-elevated, #EDEAE4);
  border-bottom: 1px solid var(--color-border, rgba(20,23,26,0.06));
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.memaero-modal-trustbar li {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.memaero-modal-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border, rgba(20,23,26,0.06));
}
.memaero-modal-title { font-size: 18px; font-weight: 600; margin: 0; }
.memaero-modal-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  color: inherit;
}

.memaero-modal-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Steps */
.memaero-steps { display: flex; flex-direction: column; gap: 16px; }
.memaero-step {
  border: 1px solid var(--color-border, rgba(20,23,26,0.10));
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 160ms ease;
}
.memaero-step.active { border-color: var(--color-primary, #C8102E); }
.memaero-step.completed { border-color: var(--color-success, #10B981); }

.memaero-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface-elevated, #EDEAE4);
  cursor: pointer;
  user-select: none;
}
.memaero-step.active .memaero-step-header { background: transparent; }
.memaero-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(20,23,26,0.08);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.memaero-step.active .memaero-step-num { background: var(--color-primary, #C8102E); color: #fff; }
.memaero-step.completed .memaero-step-num { background: var(--color-success, #10B981); color: #fff; }
.memaero-step-label { font-size: 14px; font-weight: 600; flex: 1; }
.memaero-step-edit {
  background: transparent; border: 0; cursor: pointer;
  font-size: 11px; color: var(--color-text-muted);
  font-family: var(--font-mono, monospace); text-decoration: underline;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.memaero-step-summary {
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-mono, monospace);
  margin-left: 8px;
}
.memaero-step-body {
  padding: 16px;
  display: none;
}
.memaero-step.active .memaero-step-body { display: block; }

/* Form fields */
.memaero-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.memaero-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.memaero-label {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.memaero-input, .memaero-select {
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong, rgba(20,23,26,0.18));
  border-radius: 4px;
  background: var(--color-surface, #F8F5F0);
  color: var(--color-text, #1F2124);
  font-size: 14px;
  font-family: inherit;
  -webkit-text-fill-color: var(--color-text, #1F2124);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.memaero-input::placeholder {
  color: var(--color-text-muted, #7A8794);
}
.memaero-select option {
  background: var(--color-surface, #F8F5F0);
  color: var(--color-text, #1F2124);
}
.memaero-input:focus, .memaero-select:focus {
  outline: none;
  border-color: var(--color-primary, #C8102E);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.15);
  background: var(--color-surface, #F8F5F0);
}
/* Chrome autofill override — keep warm-neutral background on autofill */
.memaero-input:-webkit-autofill,
.memaero-input:-webkit-autofill:hover,
.memaero-input:-webkit-autofill:focus,
.memaero-input:-webkit-autofill:active,
.memaero-select:-webkit-autofill,
.memaero-select:-webkit-autofill:hover,
.memaero-select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #F8F5F0 inset !important; /* --bg-surface */
  box-shadow: 0 0 0 1000px #F8F5F0 inset !important;
  -webkit-text-fill-color: #1F2124 !important; /* --text-primary */
  caret-color: #1F2124 !important;
  transition: background-color 99999s ease-in-out 0s, color 99999s ease-in-out 0s;
  border-color: #D0CBC4 !important; /* --border */
}

/* Firefox autofill equivalent */
.memaero-input:autofill,
.memaero-select:autofill {
  background: #F8F5F0 !important; /* --bg-surface */
  color: #1F2124 !important;      /* --text-primary */
}

/* Native <select> dropdown arrow — charcoal on white background */
.memaero-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237A8794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.memaero-input[aria-invalid="true"] { border-color: var(--color-error, #EF4444); }
.memaero-helper { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.memaero-error { font-size: 11px; color: var(--color-error, #EF4444); margin-top: 2px; }
.memaero-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  margin: 8px 0;
  cursor: pointer;
}
.memaero-checkbox input { margin-top: 2px; accent-color: var(--color-primary, #C8102E); }

/* Shipping radios */
.memaero-shipping-opts { display: flex; flex-direction: column; gap: 8px; }
.memaero-shipping-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--color-border, rgba(20,23,26,0.15));
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  background: var(--color-surface-elevated, #EDEAE4);
  color: var(--color-text, #1F2124);
}
.memaero-shipping-opt input { margin-right: 10px; }
.memaero-shipping-opt.selected {
  border-color: var(--color-primary, #C8102E);
  background: rgba(200, 16, 46, 0.06);
  color: var(--color-text, #1F2124);
}
.memaero-shipping-opt-price {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--color-text, #1F2124);
}

/* Stripe Payment Element */
.memaero-payment-mount {
  margin-top: 12px;
  min-height: 120px;
  padding: 4px 0;
}
.memaero-payment-skeleton {
  height: 90px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(20,23,26,0.04), rgba(20,23,26,0.08), rgba(20,23,26,0.04));
  background-size: 200% 100%;
  animation: memaero-skeleton 1.2s ease-in-out infinite;
}
.memaero-payment-status {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 0 0 6px;
}

/* Step CTA */
.memaero-step-cta {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: var(--color-primary, #C8102E);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease;
}
.memaero-step-cta:hover { background: var(--color-primary-hover, #A50D26); transform: translateY(-1px); }
.memaero-step-cta:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.memaero-step-cta.loading { pointer-events: none; opacity: 0.8; }
.memaero-step-note {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 10px;
}

/* Summary sidebar */
.memaero-summary {
  background: var(--color-surface-elevated, #EDEAE4);
  border-radius: 6px;
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 0;
}
.memaero-summary-title {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 12px;
}
.memaero-summary-lines { list-style: none; padding: 0; margin: 0 0 16px; }
.memaero-summary-line {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border, rgba(20,23,26,0.10));
  font-size: 12px;
}
.memaero-summary-line-img { width: 40px; height: 40px; border-radius: 4px; overflow: hidden; background: var(--color-surface, #F8F5F0); border: 1px solid var(--color-border, rgba(20,23,26,0.08)); }
.memaero-summary-line-img img { width: 100%; height: 100%; object-fit: cover; }
.memaero-summary-line-name { font-weight: 500; line-height: 1.3; }
.memaero-summary-line-variant { font-family: var(--font-mono, monospace); font-size: 10px; color: var(--color-text-muted); }
.memaero-summary-line-qty { font-family: var(--font-mono, monospace); font-size: 10px; color: var(--color-text-muted); }
.memaero-summary-line-price { font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600; text-align: right; }

.memaero-coupon-row { display: flex; gap: 6px; margin-bottom: 14px; }
.memaero-coupon-row .memaero-input { flex: 1; }
.memaero-coupon-apply {
  background: var(--color-surface, #F8F5F0);
  border: 1px solid var(--color-border-strong, rgba(20,23,26,0.20));
  color: var(--color-text, #1F2124);
  border-radius: 4px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 120ms ease, background 120ms ease;
}
.memaero-coupon-apply:hover {
  border-color: var(--color-primary, #C8102E);
  background: rgba(200,16,46,0.06);
}
.memaero-coupon-msg { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; font-family: var(--font-mono, monospace); }
.memaero-coupon-msg.success { color: var(--color-success, #10B981); }
.memaero-coupon-msg.error { color: var(--color-error, #EF4444); }

.memaero-totals { list-style: none; padding: 0; margin: 0; }
.memaero-totals li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.memaero-totals li span:first-child { color: var(--color-text-muted); font-family: var(--font-mono, monospace); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.memaero-totals li span:last-child { font-family: var(--font-mono, monospace); font-weight: 600; }
.memaero-totals li.total {
  border-top: 1px solid var(--color-border, rgba(20,23,26,0.12));
  margin-top: 8px;
  padding-top: 12px;
  font-size: 16px;
}
.memaero-totals li.total span:first-child { color: inherit; font-size: 12px; }
.memaero-totals li.total span:last-child { font-size: 18px; }

/* Inline error block */
.memaero-inline-error {
  padding: 12px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 12px;
  color: var(--color-error, #EF4444);
}
.memaero-inline-error strong { display: block; margin-bottom: 4px; }

/* ── Pay-now full-screen spinner ──
   Sits above the checkout modal (z-index 9999). Light card on dark scrim.
   Appears when the user clicks Pay and stays until either Stripe redirects
   to /shop/order-complete or onPay's error handler hides it. */
.memaero-pay-spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 26, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.memaero-pay-spinner-overlay.open {
  display: flex;
}
.memaero-pay-spinner-card {
  background: var(--color-surface, #F8F5F0);
  border: 1px solid var(--color-border, #D0CBC4);
  border-radius: 8px;
  padding: 40px 32px 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(31,33,36,0.18);
}
.memaero-pay-spinner-ring {
  width: 48px;
  height: 48px;
  margin: 0 auto 22px;
  border: 3px solid rgba(20, 23, 26, 0.12);
  border-top-color: var(--color-primary, #C8102E);
  border-radius: 50%;
  animation: memaero-pay-spin 800ms linear infinite;
}
@keyframes memaero-pay-spin {
  to { transform: rotate(360deg); }
}
.memaero-pay-spinner-title {
  font-family: var(--font-display, "Outfit", system-ui, sans-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text, #1F2124);
  margin-bottom: 10px;
}
.memaero-pay-spinner-sub {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted, #7A8794);
  line-height: 1.5;
}

/* Skeleton loader */
.memaero-skeleton {
  display: inline-block;
  height: 1em;
  width: 60%;
  background: linear-gradient(90deg, rgba(20,23,26,0.05), rgba(20,23,26,0.10), rgba(20,23,26,0.05));
  background-size: 200% 100%;
  animation: memaero-skeleton 1.2s ease-in-out infinite;
  border-radius: 3px;
}
@keyframes memaero-skeleton { 0% { background-position: 0 0; } 100% { background-position: -200% 0; } }

/* Exit intent banner */
.memaero-exit-banner {
  position: absolute;
  top: 12px;
  left: 24px;
  right: 24px;
  padding: 12px 16px;
  background: var(--color-primary, #C8102E);
  color: #fff;
  border-radius: 4px;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  animation: memaero-slide-down 220ms ease;
  z-index: 10;
}
.memaero-exit-banner.show { display: flex; }
.memaero-exit-banner input {
  flex: 1;
  padding: 6px 10px;
  border: 0;
  border-radius: 3px;
  font-size: 13px;
  background: var(--color-surface, #F8F5F0);
  color: var(--color-text, #1F2124);
}
.memaero-exit-banner button {
  padding: 6px 14px;
  background: var(--color-surface, #F8F5F0);
  color: var(--color-text, #1F2124);
  border: 0;
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
}
.memaero-exit-dismiss {
  background: transparent !important;
  color: rgba(255,255,255,0.7) !important;
  padding: 4px !important;
  font-size: 16px !important;
}
@keyframes memaero-slide-down {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ══════════════ CART PAGE (fallback route) ══════════════ */
.cart-page-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  margin-top: 24px;
  align-items: start;
}
.cart-lines { list-style: none; padding: 0; margin: 0; }
.cart-line {
  display: grid;
  grid-template-columns: 96px 1fr auto auto auto;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border, rgba(20,23,26,0.08));
  align-items: center;
}
.cart-line-img img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; }
.cart-line-name { font-weight: 500; margin-bottom: 4px; }
.cart-line-variant { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--color-text-muted); }
.cart-line-price { font-family: var(--font-mono, monospace); font-size: 13px; margin-top: 4px; }
.cart-line-qty {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--color-border, rgba(20,23,26,0.15));
  border-radius: 4px; padding: 4px 6px;
}
.cart-qty-btn { background: transparent; border: 0; cursor: pointer; width: 24px; font-size: 14px; color: inherit; }
.cart-qty-val { font-family: var(--font-mono, monospace); font-weight: 600; min-width: 20px; text-align: center; }
.cart-line-subtotal { font-family: var(--font-mono, monospace); font-size: 15px; font-weight: 700; }
.cart-line-remove {
  background: transparent; border: 0; color: var(--color-text-muted);
  text-decoration: underline; font-size: 12px; cursor: pointer;
}
.cart-page-summary {
  padding: 24px;
  background: var(--color-surface-elevated, #EDEAE4);
  border-radius: 6px;
  position: sticky;
  top: 24px;
}
.cart-page-summary h2 { font-size: 16px; margin: 0 0 16px; }
.cart-summary-totals { margin: 0 0 20px; }
.cart-summary-totals > div {
  display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px;
}
.cart-summary-totals .cart-summary-total {
  border-top: 1px solid var(--color-border, rgba(20,23,26,0.12));
  margin-top: 8px; padding-top: 12px;
  font-size: 16px;
}
.cart-summary-total dt { font-weight: 600; }
.cart-summary-total dd { font-family: var(--font-mono, monospace); font-weight: 700; font-size: 18px; }
.cart-summary-totals dt, .cart-summary-totals dd { margin: 0; }
.cart-summary-totals dt {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.cart-summary-totals dd { font-family: var(--font-mono, monospace); font-weight: 600; }

.cart-page-empty {
  text-align: center;
  padding: 64px 24px;
  margin-top: 24px;
}
.cart-page-empty p { margin-bottom: 20px; font-size: 16px; color: var(--color-text-muted); }

/* Chatbot / AI-assistant add-to-cart CTA */
.memaero-msg-addtocart {
  display: inline-block;
  background: var(--color-primary, #C8102E);
  color: #fff;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 0;
  margin-top: 8px;
  transition: transform 120ms ease, background 120ms ease;
}
.memaero-msg-addtocart:hover { background: var(--color-primary-hover, #A50D26); transform: translateY(-1px); }
.memaero-msg-addtocart.added { background: var(--color-success, #10B981); }

/* ══════════════ MOBILE ══════════════ */
@media (max-width: 640px) {
  .memaero-drawer { width: 100vw; }
  .memaero-modal { padding: 0; }
  .memaero-modal-panel {
    max-width: 100%;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .memaero-modal-body {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .memaero-summary {
    position: static;
    order: -1;
  }
  .memaero-field-row { grid-template-columns: 1fr; }
  .memaero-modal-trustbar { font-size: 10px; padding: 8px 16px; }
  .cart-page-grid { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 80px 1fr; grid-template-rows: auto auto auto; }
  .cart-line-img img { width: 80px; height: 60px; }
  .cart-line-qty, .cart-line-subtotal, .cart-line-remove { grid-column: 1 / span 2; }
  .cart-line-qty { justify-self: start; }
  .cart-page-summary { position: static; }
}
