/* EU Withdrawal Form & Button - Storefront Styles */

.widerruf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 1000000;
  display: flex;
  justify-content: flex-end;
  transition: background 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.widerruf-overlay--active {
  background: rgba(0, 0, 0, 0.45);
}

/* Popup mode: center content */
.widerruf-overlay--popup {
  justify-content: center;
  align-items: center;
}

/* Fullscreen mode */
.widerruf-overlay--fullscreen {
  justify-content: stretch;
  align-items: stretch;
}

/* ── Drawer (Side Panel) ──────────────────────── */

.widerruf-drawer {
  width: 460px;
  max-width: 100vw;
  height: 100%;
  background: #ffffff;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.widerruf-drawer--active {
  transform: translateX(0);
}

/* ── Modal (Popup) ────────────────────────────── */

.widerruf-modal {
  width: 520px;
  max-width: 94vw;
  max-height: 90vh;
  background: #ffffff;
  overflow-y: auto;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.widerruf-modal--active {
  transform: scale(1);
  opacity: 1;
}

/* ── Fullscreen ──────────────────────────────── */

.widerruf-fullscreen {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  background: #ffffff;
  overflow-y: auto;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.widerruf-fullscreen--active {
  opacity: 1;
}

/* ── Header ───────────────────────────────────── */

.widerruf-header {
  padding: 16px 24px 14px;
  border-bottom: 1px solid #eee;
}

.widerruf-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.widerruf-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.widerruf-subtitle {
  font-size: 12px;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

.widerruf-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.widerruf-close:hover {
  background: #eee;
  color: #333;
}

.widerruf-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.widerruf-step {
  display: flex;
  align-items: center;
  gap: 6px;
}

.widerruf-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e5e5;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.widerruf-step-label {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.widerruf-step--active .widerruf-step-num {
  background: #1a1a1a;
  color: #fff;
}

.widerruf-step--active .widerruf-step-label {
  color: #1a1a1a;
  font-weight: 600;
}

.widerruf-step--done .widerruf-step-num {
  background: #2e7d32;
  color: #fff;
}

.widerruf-step--done .widerruf-step-label {
  color: #2e7d32;
}

.widerruf-step-line {
  flex: 1;
  height: 1px;
  background: #e5e5e5;
  margin: 0 8px;
  min-width: 12px;
}

/* ── Body ─────────────────────────────────────── */

.widerruf-body {
  flex: 1;
  padding: 20px 24px;
}

.widerruf-field {
  margin-bottom: 12px;
}

.widerruf-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 3px;
}

.widerruf-field input[type="text"],
.widerruf-field input[type="email"],
.widerruf-field select,
.widerruf-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  background: #f7f7f8;
  color: #1a1a1a;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.widerruf-field input:focus,
.widerruf-field select:focus,
.widerruf-field textarea:focus {
  border-color: #1a1a1a;
  background: #ffffff;
}

.widerruf-field-hint {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 3px;
}

.widerruf-error {
  background: #fce4ec;
  color: #c62828;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.widerruf-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #555;
  margin: 4px 0 16px;
  cursor: pointer;
}

.widerruf-consent input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.widerruf-consent a {
  color: inherit;
  text-decoration: underline;
}

.widerruf-warning {
  background: #fff3e0;
  color: #e65100;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.widerruf-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 4px;
}

.widerruf-btn-primary {
  padding: 9px 20px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}

.widerruf-btn-primary:hover {
  opacity: 0.9;
}

.widerruf-btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.widerruf-btn-secondary {
  padding: 9px 16px;
  background: #fff;
  color: #555;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
  white-space: nowrap;
}

.widerruf-btn-secondary:hover {
  border-color: #333;
}

/* ── Order Info ────────────────────────────────── */

.widerruf-order-info {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.widerruf-order-found {
  font-size: 14px;
  font-weight: 600;
  color: #2e7d32;
  margin: 0 0 4px;
}

.widerruf-order-meta {
  font-size: 13px;
  color: #666;
  margin: 2px 0;
}

.widerruf-select-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px;
}

.widerruf-no-order {
  font-size: 13px;
  color: #666;
  margin: 0 0 16px;
}

/* ── Item Rows ────────────────────────────────── */

.widerruf-item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.widerruf-item-row:hover {
  background: #f9f9f9;
}

.widerruf-item-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #1a1a1a;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.widerruf-select-all {
  background: #f5f5f5;
  font-weight: 600;
  font-size: 13px;
}

.widerruf-item-img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
  border: 1px solid #eee;
}

.widerruf-item-img--placeholder {
  display: block;
}

.widerruf-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.widerruf-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.widerruf-item-variant {
  font-size: 12px;
  color: #666;
}

.widerruf-item-meta {
  font-size: 12px;
  color: #999;
}

.widerruf-item--excluded {
  opacity: 0.5;
  cursor: not-allowed;
}

.widerruf-item-excluded {
  font-size: 11px;
  color: #c62828;
  font-weight: 600;
}

/* ── Success ──────────────────────────────────── */

.widerruf-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 40px;
}

.widerruf-success-icon {
  margin-bottom: 16px;
}

.widerruf-success h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.widerruf-success p {
  font-size: 14px;
  color: #666;
  margin: 0 0 24px;
  max-width: 320px;
}

.widerruf-ref {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 24px;
}

.widerruf-ref span {
  font-size: 12px;
  color: #666;
  display: block;
  margin-bottom: 4px;
}

.widerruf-ref strong {
  font-size: 16px;
  font-family: monospace;
  color: #1a1a1a;
  word-break: break-all;
}

/* ── Footer ───────────────────────────────────── */

/* Standard attribution (App Store req. 5.1.4): neutral 24x24px icon, no app name/logo */
.widerruf-footer {
  padding: 6px 24px;
  border-top: 1px solid #eee;
  text-align: center;
  line-height: 0;
}

.widerruf-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #999;
  text-decoration: none;
}

.widerruf-footer-link svg {
  display: block;
}

.widerruf-footer-link:hover {
  color: #444;
}

/* ── Inline Link Block ────────────────────────── */

.widerruf-inline-block {
  display: inline;
}

.widerruf-inline-link {
  text-decoration: underline;
  cursor: pointer;
}

.widerruf-inline-link:hover {
  opacity: 0.8;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 480px) {
  .widerruf-drawer {
    width: 100vw;
  }

  .widerruf-modal {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    max-height: 90vh;
    margin: 16px;
    border-radius: 12px;
  }

  .widerruf-step-label {
    display: none;
  }

  .widerruf-body {
    padding: 16px;
  }

  /* Buttons gestapelt + volle Breite, damit lange Labels
     (z. B. FR "Continuer sans numéro de commande") nicht überlaufen */
  .widerruf-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .widerruf-actions .widerruf-btn-primary,
  .widerruf-actions .widerruf-btn-secondary {
    width: 100%;
    white-space: normal;
  }
}

/* ── Inline Form (Dedicated Page) ────────────── */

.widerruf-inline-form {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e1e3e5;
}
