/* ==========================================================================
   entriso Returns Compliance – Frontend Styles
   Neutral design that integrates with any WooCommerce theme.
   ========================================================================== */

/* ── Trigger button ────────────────────────────────────────────────────────── */

.erc-trigger-wrap {
  margin-top: 20px;
}

p.order-again #entriso-withdrawal-root {
  display: inline-block;
  vertical-align: middle;
}

p.order-again .erc-trigger-wrap {
  display: inline-block;
  margin-top: 0;
  margin-left: 10px;
}

.erc-btn--withdraw {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  color: var(--wc-text, #333);
  border: 2px solid currentColor;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.erc-btn--withdraw:hover,
.erc-btn--withdraw:focus {
  background: #c00;
  color: #fff;
  border-color: #c00;
}

/* ── Modal overlay ────────────────────────────────────────────────────────── */

.erc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: erc-fade-in 0.2s ease;
}

@keyframes erc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.erc-modal {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  animation: erc-slide-up 0.22s ease;
  overflow: hidden;
}

@keyframes erc-slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Modal header ─────────────────────────────────────────────────────────── */

.erc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.erc-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #111;
}

.erc-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #777;
  padding: 0 4px;
  transition: color 0.15s;
}

.erc-modal__close:hover { color: #111; }

/* ── Step indicator ───────────────────────────────────────────────────────── */

.erc-steps {
  display: flex;
  gap: 0;
  background: #f7f7f7;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.erc-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  color: #999;
  border-bottom: 3px solid transparent;
  transition: border-color 0.2s;
}

.erc-step--active {
  color: #2271b1;
  border-bottom-color: #2271b1;
}

.erc-step--done {
  color: #1e7e34;
  border-bottom-color: #1e7e34;
}

.erc-step__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.erc-step__label {
  font-size: 11px;
  line-height: 1.3;
}

/* ── Modal body ───────────────────────────────────────────────────────────── */

.erc-modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ── Modal footer ─────────────────────────────────────────────────────────── */

.erc-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
  flex-shrink: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.erc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

.erc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.erc-btn--next,
.erc-btn--close {
  background: #2271b1;
  color: #fff;
}

.erc-btn--next:hover,
.erc-btn--close:hover { background: #135e96; }

.erc-btn--confirm {
  background: #c00;
  color: #fff;
  font-size: 15px;
  padding: 10px 22px;
}

.erc-btn--confirm:hover { background: #a00; }

.erc-btn--back {
  background: #f0f0f0;
  color: #333;
}

.erc-btn--back:hover { background: #e0e0e0; }

.erc-btn--link {
  background: none;
  border: none;
  color: #2271b1;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ── Loading spinner ──────────────────────────────────────────────────────── */

.erc-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.erc-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #2271b1;
  border-radius: 50%;
  animation: erc-spin 0.7s linear infinite;
}

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

/* ── Error ────────────────────────────────────────────────────────────────── */

.erc-error {
  background: #fde8e8;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 10px 14px;
  color: #721c24;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ── Items list (Step 1) ──────────────────────────────────────────────────── */

.erc-items-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.erc-item__label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.erc-item__label--checked {
  border-color: #2271b1;
  background: #f0f6fb;
}

.erc-item__label:hover {
  border-color: #999;
}

.erc-item__checkbox {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #2271b1;
}

.erc-item__info {
  flex: 1;
}

.erc-item__name {
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.erc-item__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #666;
}

.erc-item__deadline {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.erc-select-controls {
  font-size: 12px;
  margin-bottom: 16px;
  color: #555;
}

/* ── Reason (Step 1) ──────────────────────────────────────────────────────── */

.erc-reason__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}

.erc-reason__textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}

/* ── Summary (Step 2) ─────────────────────────────────────────────────────── */

.erc-summary-box {
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.erc-summary-box__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
}

.erc-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.erc-summary-list__item {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.erc-summary-list__name { flex: 1; }
.erc-summary-list__qty  { color: #666; }
.erc-summary-list__price{ font-weight: 600; }

.erc-summary-box__reason {
  font-size: 12px;
  color: #666;
  margin: 10px 0 0;
  font-style: italic;
}

.erc-info-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #e8f4fd;
  border: 1px solid #bee3f8;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #1a4f7a;
}

.erc-info-box__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.erc-legal-note {
  font-size: 12px;
  color: #666;
  background: #fffbea;
  border: 1px solid #f5e6a0;
  border-radius: 4px;
  padding: 10px 12px;
}

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

.erc-success {
  text-align: center;
  padding: 20px 0;
}

.erc-success__icon {
  width: 64px;
  height: 64px;
  color: #1e7e34;
  margin: 0 auto 16px;
}

.erc-success__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #111;
}

.erc-success__body {
  font-size: 14px;
  color: #555;
  margin: 0 0 20px;
}

.erc-success__details {
  background: #f0f9f0;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  padding: 14px;
  text-align: left;
  font-size: 13px;
}

.erc-success__details p { margin: 4px 0; }

.erc-success__timestamp-note {
  font-size: 11px;
  color: #888;
  font-style: italic;
  margin-top: 10px !important;
}

/* ── My Withdrawals tab ───────────────────────────────────────────────────── */

.erc-my-withdrawals__table {
  width: 100%;
  border-collapse: collapse;
}

.erc-my-withdrawals__table th,
.erc-my-withdrawals__table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
}

.erc-my-withdrawals__table th {
  font-weight: 700;
  background: #f7f7f7;
}

.erc-item-badge {
  display: inline-block;
  background: #eee;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  margin: 2px 2px 2px 0;
}

.erc-empty {
  padding: 24px 0;
  color: #777;
  font-size: 14px;
}

/* ── Status badges (shared with admin inline styles) ──────────────────────── */

.erc-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.erc-status--submitted  { background: #e8f0fe; color: #1a56b0; }
.erc-status--processing { background: #fff3cd; color: #856404; }
.erc-status--accepted   { background: #d4edda; color: #155724; }
.erc-status--rejected   { background: #f8d7da; color: #721c24; }
.erc-status--refunded   { background: #d1ecf1; color: #0c5460; }

/* ── Text button type & Powered by entriso ────────────────────────────────── */

.erc-btn--withdraw-text {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--wc-text, #666) !important;
  text-decoration: underline !important;
  font-size: 13px !important;
  font-weight: normal !important;
}

.erc-btn--withdraw-text:hover,
.erc-btn--withdraw-text:focus {
  background: transparent !important;
  color: var(--wc-primary, #333) !important;
  border: none !important;
  text-decoration: none !important;
  opacity: 0.8 !important;
}

.erc-modal__powered-by {
  font-size: 10px;
  color: #a0a0a0;
  text-align: center;
  padding: 8px 0;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.erc-modal__powered-by a {
  color: #a0a0a0;
  text-decoration: none;
  font-weight: 600;
}

.erc-modal__powered-by a:hover {
  text-decoration: underline;
  color: #666;
}

.erc-modal__footer + .erc-modal__powered-by {
  border-top: none;
  padding-top: 0;
  padding-bottom: 12px;
}

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

@media (max-width: 480px) {
  .erc-modal {
    max-height: 96vh;
    border-radius: 0;
  }

  .erc-step__label {
    display: none;
  }

  .erc-modal__footer {
    flex-direction: column-reverse;
  }

  .erc-btn {
    width: 100%;
    justify-content: center;
  }
}
