/* ============================================================
   PORTAL DE DEVOLUCIONES — RECAMBIOS ECOGAS
   Estética: editorial limpia, tipografía con personalidad,
   verde corporativo #0AA007 como acento decisivo
   ============================================================ */

:root {
  --brand: #0AA007;
  --brand-dark: #088105;
  --brand-soft: #e8f5e8;
  --ink: #0f1411;
  --ink-soft: #4a5249;
  --ink-faint: #8a948c;
  --paper: #faf9f6;
  --paper-warm: #f4f2eb;
  --line: #e3e1d8;
  --line-soft: #ecebe4;
  --danger: #c8372d;
  --danger-soft: #fde8e6;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(15,20,17,0.04);
  --shadow-md: 0 4px 24px rgba(15,20,17,0.06);
  --shadow-lg: 0 12px 40px rgba(15,20,17,0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* TOPBAR ============================================================ */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.96);
}
.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}
.help-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--line);
  transition: all 0.18s ease;
}
.help-link:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.help-link strong { color: var(--ink); }
.help-link:hover strong { color: var(--brand); }

/* MAIN ============================================================ */
.portal {
  flex: 1;
  padding: 48px 24px 64px;
}
.portal-inner {
  max-width: 720px;
  margin: 0 auto;
}

/* HERO ============================================================ */
.hero {
  margin-bottom: 56px;
  text-align: left;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 16px;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: 'opsz' 144;
  margin-bottom: 20px;
}
.lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 540px;
  line-height: 1.55;
}

/* STEPPER ============================================================ */
.stepper {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0;
}
.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-faint);
  position: relative;
  font-weight: 500;
}
.step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  margin: 0 12px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.25s ease;
}
.step.active .step-num {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.step.complete .step-num {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.step.complete .step-num::before {
  content: '✓';
}
.step.complete .step-num:not(:empty) > * { display: none; }
.step.active, .step.complete { color: var(--ink); }
.step-label { white-space: nowrap; }
@media (max-width: 540px) {
  .step-label { display: none; }
  .step { flex: 0 0 auto; }
  .step:not(:last-child)::after { width: 32px; flex: 0 0 32px; margin: 0 8px; }
}

/* CARD / PANEL ============================================================ */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-md);
  display: none;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.card.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  color: var(--ink);
  font-variation-settings: 'opsz' 144;
}
.card .muted { color: var(--ink-soft); margin-bottom: 24px; }
.card .muted.small { font-size: 13px; margin-bottom: 12px; }

/* FORM FIELDS ============================================================ */
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}
.field .optional {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 13px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  color: var(--ink);
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,20,17,0.06);
}
.field textarea { resize: vertical; min-height: 100px; }

/* BUTTONS ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(10,160,7,0.25);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

/* ALERTS ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin: 16px 0;
}
.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-left: 3px solid var(--danger);
}
.alert-warn {
  background: var(--warn-soft);
  color: #78350f;
  border-left: 3px solid var(--warn);
}

/* ORDER SUMMARY ============================================================ */
.order-summary {
  background: var(--paper-warm);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.order-summary .field-row { display: flex; flex-direction: column; gap: 2px; }
.order-summary .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-weight: 600;
}
.order-summary .value {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}
.order-summary .value.days-remaining {
  color: var(--brand);
  font-weight: 600;
}
.order-summary .value.expired {
  color: var(--danger);
}

/* ITEM LIST ============================================================ */
.items-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.18s, background 0.18s;
  cursor: pointer;
}
.item-row:hover { border-color: var(--ink-faint); }
.item-row.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.item-row input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex-shrink: 0;
  cursor: pointer;
}
.item-row .item-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--paper-warm);
  flex-shrink: 0;
  object-fit: cover;
}
.item-row .item-info { flex: 1; min-width: 0; }
.item-row .item-name {
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-row .item-meta {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.item-row .qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.item-row .qty-control button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: all 0.15s;
}
.item-row .qty-control button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}
.item-row .qty-control button:disabled { opacity: 0.3; cursor: not-allowed; }
.item-row .qty-control input {
  width: 36px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding: 0;
}

/* UPLOAD ZONE ============================================================ */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 28px;
  text-align: center;
  background: var(--paper);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
}
.upload-prompt svg { color: var(--ink-faint); }
.upload-prompt p { font-size: 14px; }
.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.upload-preview .preview-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper-warm);
}
.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-preview .remove-thumb {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-req-label.required { color: var(--danger); font-weight: 600; }

/* METHOD OPTIONS ============================================================ */
.method-options { display: flex; flex-direction: column; gap: 12px; }
.method-option { cursor: pointer; }
.method-option input { position: absolute; opacity: 0; pointer-events: none; }
.method-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: all 0.18s ease;
}
.method-option:hover .method-card { border-color: var(--ink-faint); }
.method-option input:checked + .method-card {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(10,160,7,0.08);
}
.method-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.method-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.method-body p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.parcel-shop-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}
.parcel-shop-link:hover { color: var(--brand-dark); }

/* LEGAL CHECK ============================================================ */
.legal-check {
  margin-top: 20px;
  padding: 16px;
  background: var(--paper-warm);
  border-radius: var(--radius-sm);
}
.legal-check label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.legal-check input { margin-top: 2px; accent-color: var(--brand); }
.legal-check a { color: var(--brand); font-weight: 500; }

/* SUCCESS ============================================================ */
.success-panel { text-align: center; padding: 56px 40px; }
.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.return-code {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.04em;
  margin: 12px 0 24px;
  padding: 14px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.next-steps {
  text-align: left;
  margin: 36px 0 24px;
  padding: 32px;
  background: var(--paper-warm);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.next-steps h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  color: var(--ink);
}
.timeline {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timeline li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}
.timeline li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: -16px;
  width: 1.5px;
  background: var(--line);
}
.t-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
}
.t-body { flex: 1; padding-top: 2px; }
.t-body strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 4px;
}
.t-body p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}

.contact-help {
  margin: 24px 0 12px;
  padding: 14px 20px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
  text-align: left;
}
.contact-help p { margin: 0; color: var(--ink); }
.contact-help a { color: var(--brand); text-decoration: none; }
.contact-help a:hover { text-decoration: underline; }

/* Method cost text */
.method-cost {
  font-size: 13px !important;
  margin-top: 8px !important;
  padding: 8px 10px;
  background: var(--paper-warm);
  border-radius: 4px;
  color: var(--ink-soft) !important;
  line-height: 1.5;
}
.method-option input:checked + .method-card .method-cost {
  background: rgba(255,255,255,0.6);
}

/* FOOTER ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--paper-warm);
}

/* SPINNER ============================================================ */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* MOBILE ============================================================ */
@media (max-width: 600px) {
  .portal { padding: 24px 16px 48px; }
  .card { padding: 24px 20px; border-radius: 10px; }
  .topbar-inner { padding: 14px 16px; }
  .help-link { font-size: 13px; padding: 6px 12px; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .order-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   V4 — Tipo de devolución, productos bloqueados, mini summary
   ============================================================ */

/* ORDER MINI SUMMARY (step 2) */
.order-mini-summary {
  background: var(--paper-warm);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.mini-row { display: flex; flex-direction: column; gap: 2px; }
.mini-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
}
.mini-value { color: var(--ink); font-weight: 500; }

/* RETURN TYPE OPTIONS */
.return-type-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.return-type-option {
  cursor: pointer;
  display: block;
}
.return-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.rt-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 22px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: all 0.2s ease;
}
.return-type-option:hover .rt-card:not(.disabled) {
  border-color: var(--ink-faint);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.return-type-option input:checked + .rt-card {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(10,160,7,0.1);
}
.rt-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.rt-body { flex: 1; min-width: 0; }
.rt-body h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--ink);
}
.rt-body > p {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 12px;
  line-height: 1.55;
}
.rt-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rt-bullets li {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.rt-fineprint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-faint);
  font-style: italic;
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.rt-card.disabled {
  opacity: 0.45;
  background: var(--paper-warm);
}
.rt-expired {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

/* Color accents per type */
.rt-garantia .rt-icon { filter: hue-rotate(0deg); }
.return-type-option input:checked + .rt-garantia {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 4px rgba(220,38,38,0.08);
}
.return-type-option input:checked + .rt-cupon {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 0 0 4px rgba(217,119,6,0.08);
}

/* PRODUCTOS BLOQUEADOS (bajo pedido) */
.item-row.item-disabled {
  opacity: 0.5;
  background: var(--paper-warm);
  cursor: not-allowed;
}
.item-row.item-disabled:hover { border-color: var(--line); }
.backorder-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* SECCIÓN LEGAL */
.legal-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--paper-warm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.legal-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.legal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 0;
}
.legal-check:last-child { margin-bottom: 0; }
.legal-check input { margin-top: 3px; accent-color: var(--brand); flex-shrink: 0; }
.legal-check a { color: var(--brand); font-weight: 500; }

/* V4.3 — Pantalla de bloqueo total (pedido 100% bajo pedido) */
.alert-blocking {
  background: var(--paper-warm);
  border: 2px solid var(--ink-faint);
  border-left: 4px solid var(--danger);
  padding: 24px 28px;
  margin-bottom: 0;
}
.alert-blocking strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: block;
  margin-bottom: 8px;
}
.alert-blocking p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }
.alert-blocking a:not(.btn) { color: var(--brand); font-weight: 500; }
