/* ============================================================
 * @AI_GUIDE: Reusable Cross-Step Components — Sticky-CTA, Processing-Overlay,
 * Toast, Mock-Stripe-Mount, Free-Order-Hint, Payment-Error-Box, Link-Btn,
 * Shared Animations (spin, fadeIn, f24-shake, skeleton-shimmer).
 *
 * Iteration 14g (Mo 2026-06-14): Split aus styles.css (war 2933 Zeilen).
 * Geschwister-Files: base.css, editor.css, checkout.css, components.css
 * ============================================================ */

/* ─── Sticky CTA (Bottom-Bar mit Mini-Total + BOB) ─── */
.sticky-cta-wrap {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
}
.sticky-cta-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  max-width: 560px;
  margin: 0 auto;
}
.sticky-cta-total {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.sticky-cta-total-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.sticky-cta-total-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.sticky-cta-btn {
  flex: 1 1 auto;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  min-height: 48px;
  box-shadow: 0 2px 6px rgba(255,153,20,0.3),
              inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 100ms, box-shadow 100ms, opacity 100ms;
}
.sticky-cta-btn:active {
  transform: scale(0.98);
}
.sticky-cta-btn.is-disabled,
.sticky-cta-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.sticky-cta-btn--full {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sticky-cta-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Link-Button (Plain-Text-Action) ─── */
.link-btn {
  background: transparent;
  border: none;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ─── MOCK Stripe Element (Phase 5 Reference-UI) ─── */
.mock-stripe-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
}
.mock-stripe-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.mock-stripe-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.mock-stripe-tab {
  background: transparent;
  border: none;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}
.mock-stripe-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent-dark);
}
.mock-stripe-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mock-stripe-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
}
.mock-stripe-input:focus {
  outline: none;
  border-color: var(--accent-dark);
}
.mock-stripe-row {
  display: flex;
  gap: 8px;
}
.mock-stripe-row .mock-stripe-input {
  flex: 1;
}
.mock-stripe-note {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── Free-Order-Hint + Payment-Error-Box ─── */
.free-order-hint,
.payment-error-box {
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
}
.free-order-hint {
  background: rgba(29,158,117,0.08);
  color: var(--green);
  text-align: center;
  font-weight: 600;
}
.payment-error-box {
  background: #fdecea;
  color: #c0392b;
}
.payment-error-box .link-btn {
  margin-left: 8px;
}

/* ─── Processing-Overlay (Phase 6) ─── */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,15,15,0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 200ms;
}
.processing-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.processing-spinner {
  width: 56px; height: 56px;
  border: 4px solid rgba(26,115,232,0.15);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}
.processing-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--text);
}
.processing-stages {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}
.processing-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 6px 0;
  transition: opacity 200ms;
}
.stage-marker {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  background: transparent;
  position: relative;
}
.processing-stage.is-done .stage-marker {
  background: var(--green);
  border-color: var(--green);
}
.processing-stage.is-done .stage-marker::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.processing-stage.is-active .stage-marker {
  border-color: var(--accent-dark);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.processing-stage.is-done .stage-label {
  color: var(--text-muted);
  text-decoration: line-through;
}
.processing-stage.is-pending {
  opacity: 0.4;
}
.processing-eta {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Iteration 18.5b: pre-payment Phase 1 — minimaler Spinner + 1-Liner. */
.processing-card--simple {
  padding: 28px 24px;
}
.processing-card--simple .processing-spinner {
  margin-bottom: 14px;
}
.processing-simple-msg {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* ─── Toast (Error-Notifications) ─── */
.toast {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  background: #dc2626;
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999999;
  box-shadow: 0 8px 24px rgba(220,38,38,0.3);
  transform: translateY(-120px);
  opacity: 0;
  transition: transform 250ms, opacity 250ms;
  max-width: 480px;
  margin: 0 auto;
}
.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================================
 * Shared Animations
 * ============================================================ */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes f24-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
 * Media Queries — Component-spezifisch
 * ============================================================ */

/* Desktop: schmalere Sticky-Bar mit max-width */
@media (min-width: 900px) {
  .sticky-cta-inner { max-width: 720px; }
}
