/* ═══════════════════════════════════════════════════════════════
   Widerruf Button – Frontend Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Floating Button ───────────────────────────────────────────── */
#wr-floating-btn {
  position: fixed;
  bottom: 24px;
  z-index: 999990;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
#wr-floating-btn:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}
#wr-floating-btn.wr-pos-right { right: 24px; }
#wr-floating-btn.wr-pos-left  { left: 24px;  }

/* ── Backdrop ──────────────────────────────────────────────────── */
#wr-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 999997;
  opacity: 0;
  transition: opacity 0.25s;
  display: none;
}

/* ── Popup ─────────────────────────────────────────────────────── */
#wr-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(560px, 92vw);
  max-height: 88vh;
  z-index: 999999;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
#wr-popup.wr-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Panel (Seitenleiste) ──────────────────────────────────────── */
#wr-panel {
  position: fixed;
  top: 0;
  width: min(480px, 90vw);
  height: 100%;
  z-index: 999999;
  background: #fff;
  box-shadow: -4px 0 28px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#wr-panel.wr-panel-right {
  right: 0;
  transform: translateX(100%);
}
#wr-panel.wr-panel-left {
  left: 0;
  transform: translateX(-100%);
}
#wr-panel.wr-open {
  transform: translateX(0);
}

/* ── Overlay Header ────────────────────────────────────────────── */
.wr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}
.wr-header-title {
  font-weight: 600;
  font-size: 17px;
  color: #111827;
}
.wr-close-btn {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  padding: 0 6px;
  color: #6B7280;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.wr-close-btn:hover {
  background: #F3F4F6;
  color: #111827;
}

/* ── Overlay Body ──────────────────────────────────────────────── */
.wr-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 24px;
}

/* ── Form – Step Indicators ────────────────────────────────────── */
.wr-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.wr-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9CA3AF;
  font-weight: 500;
}
.wr-step.active {
  color: #111827;
}
.wr-step.done {
  color: #059669;
}
.wr-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.wr-step.active .wr-step-num {
  border-color: var(--wr-bg, #0D1B2A);
  background: var(--wr-bg, #0D1B2A);
  color: var(--wr-fg, #fff);
}
.wr-step.done .wr-step-num {
  border-color: #059669;
  background: #059669;
  color: #fff;
}
.wr-step-divider {
  flex: 1;
  height: 1px;
  background: #E5E7EB;
  margin: 0 10px;
}

/* ── Form Fields ───────────────────────────────────────────────── */
.wr-form-group {
  margin-bottom: 18px;
}
.wr-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.wr-form-group input,
.wr-form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.wr-form-group input:focus,
.wr-form-group textarea:focus {
  border-color: var(--wr-bg, #0D1B2A);
  box-shadow: 0 0 0 3px rgba(13, 27, 42, 0.1);
}
.wr-form-group textarea {
  resize: vertical;
  min-height: 90px;
}
.wr-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Primary Button ────────────────────────────────────────────── */
.wr-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 24px;
  background: var(--wr-bg, #0D1B2A);
  color: var(--wr-fg, #FFFFFF);
  border: none;
  border-radius: var(--wr-radius, 6px);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 6px;
}
.wr-btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}
.wr-btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}
.wr-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Secondary Button ──────────────────────────────────────────── */
.wr-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  color: #4B5563;
  border: 1.5px solid #D1D5DB;
  border-radius: var(--wr-radius, 6px);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.wr-btn-secondary:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
}

/* ── Error & Info Messages ─────────────────────────────────────── */
.wr-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}
.wr-info {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}
.wr-warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Order Details Card ────────────────────────────────────────── */
.wr-order-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.wr-order-card h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wr-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
  color: #6B7280;
}
.wr-order-meta strong {
  color: #111827;
}
.wr-deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.wr-deadline-badge.ok {
  background: #DCFCE7;
  color: #166534;
}
.wr-deadline-badge.expired {
  background: #FEE2E2;
  color: #991B1B;
}

/* ── Product List ──────────────────────────────────────────────── */
.wr-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.wr-product-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.wr-product-item:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
}
.wr-product-item.selected {
  border-color: var(--wr-bg, #0D1B2A);
  background: rgba(13, 27, 42, 0.04);
}
.wr-product-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #D1D5DB;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.wr-product-item.selected .wr-product-checkbox {
  background: var(--wr-bg, #0D1B2A);
  border-color: var(--wr-bg, #0D1B2A);
}
.wr-product-checkbox svg {
  display: none;
}
.wr-product-item.selected .wr-product-checkbox svg {
  display: block;
}
.wr-product-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: #F3F4F6;
  flex-shrink: 0;
}
.wr-product-img-placeholder {
  width: 52px;
  height: 52px;
  background: #F3F4F6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  font-size: 22px;
  flex-shrink: 0;
}
.wr-product-info {
  flex: 1;
  min-width: 0;
}
.wr-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wr-product-qty {
  font-size: 13px;
  color: #6B7280;
  margin-top: 2px;
}
.wr-product-price {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  flex-shrink: 0;
}

/* ── Success Screen ────────────────────────────────────────────── */
.wr-success {
  text-align: center;
  padding: 24px 16px 16px;
}
.wr-success-icon {
  width: 64px;
  height: 64px;
  background: #DCFCE7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 30px;
}
.wr-success h3 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
}
.wr-success p {
  font-size: 14px;
  color: #6B7280;
  line-height: 1.6;
  margin: 0 0 8px;
}

/* ── Loading Spinner ───────────────────────────────────────────── */
.wr-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wr-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes wr-spin {
  to { transform: rotate(360deg); }
}

/* ── Footer link to button ─────────────────────────────────────── */
a.wr-footer-link-styled {
  display: inline-block;
  text-decoration: none;
  transition: opacity 0.2s;
}
a.wr-footer-link-styled:hover {
  opacity: 0.85;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wr-body  { padding: 20px 18px 18px; }
  .wr-row   { grid-template-columns: 1fr; }
  #wr-popup { border-radius: 12px 12px 0 0; top: auto; bottom: 0; left: 0; transform: translateY(100%); width: 100%; max-height: 92vh; }
  #wr-popup.wr-open { transform: translateY(0); }
}
