/* EasyReturn — front office · direzione "Tracciato"
 * Theme-proof: tutto è racchiuso nel root isolato .er-root, con reset locale,
 * componenti autosufficienti (nessuna dipendenza da classi del tema/Bootstrap),
 * griglia intrinseca (niente breakpoint del tema) e fallback su ogni token.
 * Il font è quello del tema (font-family: inherit). Solo il monospace è nostro.
 */

/* ============================================================ *
 * 1) ROOT ISOLATO + TOKEN (con fallback) + RESET DIFENSIVO
 *    Ogni regola è scope-ata sotto .er-root: vince sul tema
 *    per specificità, senza ricorrere a !important.
 * ============================================================ */
.er-root {
  --er-ink: #16241c;
  --er-ink-soft: #52635a;
  --er-paper: #f3f6f3;
  --er-surface: #ffffff;
  --er-line: #e2e8e2;
  --er-line-strong: #cdd8cf;
  --er-brand: #1f8f63;
  --er-brand-deep: #136848;
  --er-brand-tint: #e9f4ee;
  --er-amber: #c9760f;
  --er-danger: #d64545;
  --er-info: #2f7c92;
  --er-shadow: 0 16px 44px -24px rgba(16, 40, 28, .38);
  --er-shadow-sm: 0 3px 12px -7px rgba(16, 40, 28, .35);
  --er-r: 16px;
  --er-r-sm: 10px;
  --er-pill: 999px;
  --er-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', Menlo, Consolas, monospace;

  /* base neutra: annulla ereditarietà ostile del tema */
  color: var(--er-ink, #16241c);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
}

/* box model coerente su tutto ciò che renderizziamo */
.er-root,
.er-root *,
.er-root *::before,
.er-root *::after { box-sizing: border-box; }

/* reset mirato degli elementi che usiamo (no reset globale aggressivo) */
.er-root h1,
.er-root h2,
.er-root h3,
.er-root h4,
.er-root h5,
.er-root p,
.er-root ul,
.er-root ol,
.er-root figure,
.er-root table { margin: 0; }

.er-root h1,
.er-root h2,
.er-root h3,
.er-root h4,
.er-root h5 {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--er-ink, #16241c);
}
.er-root p { line-height: 1.55; }
.er-root ul { list-style: none; padding: 0; }
.er-root img { max-width: 100%; height: auto; }
.er-root hr { border: 0; border-top: 1px solid var(--er-line, #e2e8e2); margin: 22px 0; }
.er-root a { color: var(--er-brand-deep, #136848); text-decoration: none; }
.er-root a:hover { text-decoration: underline; }
/* contenimento: niente sforamenti orizzontali in container stretti */
.er-root { max-width: 100%; overflow-wrap: break-word; word-wrap: break-word; }

.er-root .easyreturn-mono {
  font-family: var(--er-mono, monospace);
  letter-spacing: .02em;
  font-variant-ligatures: none;
}

/* ---------- Icone inline (vedi views/templates/_icons.tpl) ---------- */
.er-root .er-ico {
  width: 1em; height: 1em;
  display: inline-block; vertical-align: -.14em;
  flex: 0 0 auto;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Tile "I miei resi": è un root ma deve integrarsi nella griglia account
   del tema → eredita tipografia/colore del tema, stiliamo solo l'icona. */
.er-root#easyreturn-account-link {
  font: inherit; color: inherit; line-height: inherit;
  text-transform: inherit; text-align: inherit; letter-spacing: inherit;
}
.er-root#easyreturn-account-link .er-ico {
  width: 2.2rem; height: 2.2rem; stroke-width: 1.7;
  display: block; margin: 0 auto 4px;
}

/* ============================================================ *
 * 2) COMPONENTI AUTOSUFFICIENTI (nessuna classe del tema)
 * ============================================================ */

/* ---------- Bottoni ---------- */
.er-root .er-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border: 1px solid transparent; border-radius: var(--er-r-sm, 10px);
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  text-transform: none; letter-spacing: normal; white-space: nowrap;
  text-decoration: none; cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease, border-color .14s ease;
}
.er-root .er-btn:hover { text-decoration: none; }
.er-root .er-btn--primary {
  background: linear-gradient(135deg, var(--er-brand, #1f8f63) 0%, var(--er-brand-deep, #136848) 100%);
  color: #fff; box-shadow: 0 8px 18px -10px rgba(19, 104, 72, .55);
}
.er-root .er-btn--primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 22px -10px rgba(19, 104, 72, .65); }
.er-root .er-btn--primary:active { transform: translateY(0); }
.er-root .er-btn--ghost {
  background: var(--er-surface, #fff); border-color: var(--er-line-strong, #cdd8cf); color: var(--er-ink, #16241c);
}
.er-root .er-btn--ghost:hover { border-color: var(--er-brand, #1f8f63); color: var(--er-brand-deep, #136848); }
.er-root .er-btn--danger {
  background: var(--er-surface, #fff); border-color: var(--er-danger, #d64545); color: var(--er-danger, #d64545);
}
.er-root .er-btn--danger:hover { background: var(--er-danger, #d64545); color: #fff; }
.er-root .er-btn--lg { padding: 14px 28px; font-size: 16px; }
.er-root .er-btn--sm { padding: 8px 15px; font-size: 13px; }

/* ---------- Campi / form ---------- */
.er-root .er-form-group { margin-top: 16px; }
.er-root .er-form-group > label:not(.easyreturn-checkbox) { font-weight: 600; display: block; margin-bottom: 6px; color: var(--er-ink, #16241c); }
.er-root .er-field {
  width: 100%; border: 1px solid var(--er-line-strong, #cdd8cf); border-radius: 9px;
  padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5;
  background: var(--er-surface, #fff); color: var(--er-ink, #16241c);
}
.er-root textarea.er-field { resize: vertical; min-height: 84px; }
.er-root .er-field:focus { outline: 2px solid var(--er-brand, #1f8f63); outline-offset: 1px; border-color: var(--er-brand, #1f8f63); }
.er-root .er-file {
  display: block; width: 100%; font: inherit; font-size: 14px; color: var(--er-ink, #16241c);
  border: 1px solid var(--er-line-strong, #cdd8cf); border-radius: 9px; padding: 9px 11px;
  background: var(--er-surface, #fff);
}

/* ---------- Utility ---------- */
.er-root .er-text-right { text-align: right; }
.er-root .er-text-muted { color: var(--er-ink-soft, #52635a); }

/* ============================================================ *
 * 3) GRIGLIA E TABELLE INDIPENDENTI DAI BREAKPOINT DEL TEMA
 * ============================================================ */

/* griglia intrinseca: impila quando lo spazio è poco, qualunque sia
   il breakpoint del tema. min-width:0 evita lo sforamento dei flex item. */
.er-root .er-grid { display: flex; flex-wrap: wrap; gap: 28px; }
.er-root .er-grid__main { flex: 1 1 360px; min-width: 0; }
.er-root .er-grid__side { flex: 1 1 230px; min-width: 0; }

/* ogni tabella vive in un contenitore con scroll orizzontale:
   in colonne strette scorre invece di rompere il layout. */
.er-root .er-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.er-root .er-table { width: 100%; border-collapse: collapse; }
.er-root .er-table th,
.er-root .er-table td { text-align: left; padding: 10px 12px; vertical-align: top; }

/* ============================================================ *
 * 4) ELEMENTI / SIGNATURE (rescope-ati sotto .er-root, con fallback)
 * ============================================================ */

/* ---------- Hero pagina ordine (pulsante recesso) ---------- */
.er-root.easyreturn-order-box,
.er-root .easyreturn-order-box { display: block; }
.easyreturn-order-box.er-root {
  position: relative;
  border: 1px solid var(--er-line, #e2e8e2);
  border-radius: var(--er-r, 16px);
  margin: 20px 0;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--er-brand-tint, #e9f4ee) 0%, rgba(233, 244, 238, 0) 42%),
    var(--er-surface, #fff);
  box-shadow: var(--er-shadow, 0 16px 44px -24px rgba(16, 40, 28, .38));
  overflow: hidden;
}
.easyreturn-order-box.er-root::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(var(--er-brand, #1f8f63), var(--er-brand-deep, #136848));
}
.er-root .easyreturn-order-box__body { padding: 22px 24px 24px 26px; }
.er-root .easyreturn-order-box__head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.er-root .easyreturn-order-box__icon {
  flex: 0 0 auto; width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px;
  background: var(--er-brand-tint, #e9f4ee);
  color: var(--er-brand-deep, #136848);
  box-shadow: inset 0 0 0 1px rgba(31, 143, 99, .18);
}
.er-root .easyreturn-order-box__icon .er-ico { width: 26px; height: 26px; stroke-width: 1.9; }
.er-root .easyreturn-order-box__title { margin: 2px 0 5px; font-size: 19px; font-weight: 700; }
.er-root .easyreturn-order-box__subtitle { margin: 0; color: var(--er-ink-soft, #52635a); font-size: 14px; line-height: 1.5; }

.er-root .easyreturn-btn-return {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--er-brand, #1f8f63) 0%, var(--er-brand-deep, #136848) 100%);
  border: none; color: #fff;
  padding: 13px 24px; border-radius: var(--er-r-sm, 10px);
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(19, 104, 72, .6);
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.er-root .easyreturn-btn-return:hover,
.er-root .easyreturn-btn-return:focus { color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 14px 26px -10px rgba(19, 104, 72, .7); }
.er-root .easyreturn-btn-return:active { transform: translateY(0); }
.er-root .easyreturn-btn-return .er-ico { width: 19px; height: 19px; }

.er-root .easyreturn-deadline {
  margin: 14px 0 0;
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 7px 13px;
  background: var(--er-paper, #f3f6f3);
  border: 1px solid var(--er-line, #e2e8e2);
  border-radius: var(--er-pill, 999px);
  font-size: 12.5px; color: var(--er-ink-soft, #52635a);
}
.er-root .easyreturn-deadline strong { font-family: var(--er-mono, monospace); color: var(--er-ink, #16241c); font-weight: 600; }
.er-root .easyreturn-deadline .er-ico { width: 15px; height: 15px; color: var(--er-brand-deep, #136848); align-self: center; }

/* ---------- Alert ---------- */
.er-root .easyreturn-alert {
  padding: 13px 16px; border-radius: var(--er-r-sm, 10px);
  margin: 14px 0; font-size: 14px; line-height: 1.5;
  border: 1px solid transparent;
}
.er-root .easyreturn-alert--info { background: #eaf3f6; color: #1d4f5e; border-color: #cfe6ec; }
.er-root .easyreturn-alert--muted { background: var(--er-paper, #f3f6f3); color: var(--er-ink-soft, #52635a); border-color: var(--er-line, #e2e8e2); }
.er-root .easyreturn-alert--success { background: var(--er-brand-tint, #e9f4ee); color: var(--er-brand-deep, #136848); border-color: #c7e7d6; display: flex; gap: 11px; align-items: center; }
.er-root .easyreturn-alert--success .er-ico { width: 21px; height: 21px; flex: 0 0 auto; }
.er-root .easyreturn-alert--danger { background: #fdecec; color: #a12626; border-color: #f6d5d5; }
.er-root .easyreturn-alert ul { margin: 0; padding-left: 18px; list-style: disc; }
.er-root .easyreturn-alert a { color: inherit; text-decoration: underline; font-family: var(--er-mono, monospace); }

/* ---------- Layout shell ---------- */
.easyreturn-front.er-root { margin-top: 8px; }
.er-root .easyreturn-intro { margin-bottom: 20px; color: var(--er-ink-soft, #52635a); }
.er-root .easyreturn-intro strong { color: var(--er-ink, #16241c); font-family: var(--er-mono, monospace); }

/* ---------- Step progress ---------- */
.er-root .easyreturn-steps { display: flex; gap: 10px; margin-bottom: 22px; }
.er-root .easyreturn-step {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-radius: var(--er-r-sm, 10px);
  background: var(--er-surface, #fff);
  border: 1px solid var(--er-line, #e2e8e2);
  color: var(--er-ink-soft, #52635a); font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.er-root .easyreturn-step--active { background: var(--er-brand, #1f8f63); color: #fff; border-color: var(--er-brand, #1f8f63); box-shadow: var(--er-shadow-sm, 0 3px 12px -7px rgba(16, 40, 28, .35)); }
.er-root .easyreturn-step--done { background: var(--er-brand-tint, #e9f4ee); color: var(--er-brand-deep, #136848); border-color: #c7e7d6; }

/* ---------- Selezione prodotti ---------- */
.er-root .easyreturn-products { display: grid; gap: 12px; }
.er-root .easyreturn-product {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border: 1px solid var(--er-line, #e2e8e2); border-radius: var(--er-r, 16px);
  background: var(--er-surface, #fff);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.er-root .easyreturn-product--selected {
  border-color: var(--er-brand, #1f8f63);
  background: var(--er-brand-tint, #e9f4ee);
  box-shadow: var(--er-shadow-sm, 0 3px 12px -7px rgba(16, 40, 28, .35));
}
.er-root .easyreturn-product__select { margin: 0; }
.er-root .easyreturn-product__check { width: 20px; height: 20px; accent-color: var(--er-brand, #1f8f63); cursor: pointer; }
.er-root .easyreturn-product__img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--er-r-sm, 10px); border: 1px solid var(--er-line, #e2e8e2); flex: 0 0 auto; }
.er-root .easyreturn-product__info { flex: 1; min-width: 0; }
.er-root .easyreturn-product__name { display: block; font-weight: 600; color: var(--er-ink, #16241c); }
.er-root .easyreturn-product__meta { display: block; color: var(--er-ink-soft, #52635a); font-size: 13px; margin-top: 2px; }
.er-root .easyreturn-product__controls { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; min-width: 0; }
.er-root .easyreturn-product__controls label { font-size: 12px; color: var(--er-ink-soft, #52635a); display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.er-root .easyreturn-qty { width: 84px; }
.er-root .easyreturn-product__controls input,
.er-root .easyreturn-product__controls select {
  border: 1px solid var(--er-line-strong, #cdd8cf); border-radius: 9px; padding: 9px 11px;
  font: inherit; font-size: 14px; background: var(--er-surface, #fff); color: var(--er-ink, #16241c);
}
.er-root .easyreturn-product__controls input:disabled,
.er-root .easyreturn-product__controls select:disabled { background: var(--er-paper, #f3f6f3); opacity: .55; cursor: not-allowed; }

.er-root .easyreturn-checkbox { display: inline-flex; gap: 9px; align-items: flex-start; font-weight: 500; line-height: 1.45; cursor: pointer; }
.er-root .easyreturn-checkbox input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--er-brand, #1f8f63); flex: 0 0 auto; }
.er-root .easyreturn-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.er-root .easyreturn-note,
.er-root .easyreturn-withdrawal { margin-top: 18px; }
.er-root .easyreturn-terms {
  background: var(--er-paper, #f3f6f3); border: 1px solid var(--er-line, #e2e8e2); border-radius: var(--er-r-sm, 10px);
  padding: 14px 16px; margin: 16px 0; font-size: 13px; line-height: 1.6;
  max-height: 220px; overflow: auto;
  white-space: pre-wrap; /* preserva gli a-capo del testo (output escaped, no HTML) */
}

/* ---------- Riepilogo (review) ---------- */
.er-root .easyreturn-review-table th { font-size: 13px; color: var(--er-ink-soft, #52635a); }
.er-root .easyreturn-review-table tfoot th { color: var(--er-ink, #16241c); font-size: 15px; }
.er-root .easyreturn-review-table th,
.er-root .easyreturn-review-table td { border-bottom: 1px solid var(--er-line, #e2e8e2); }
.er-root .easyreturn-review-note { background: var(--er-paper, #f3f6f3); border-left: 3px solid var(--er-brand, #1f8f63); border-radius: 0 var(--er-r-sm, 10px) var(--er-r-sm, 10px) 0; padding: 12px 16px; margin: 16px 0; }
.er-root .easyreturn-review-note p { margin: 4px 0 0; color: var(--er-ink-soft, #52635a); }

/* ---------- Badge stato ---------- */
.er-root .easyreturn-badge {
  display: inline-block; padding: 4px 12px; border-radius: var(--er-pill, 999px);
  color: #fff; font-size: 11.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  white-space: nowrap;
}

/* ---------- Dettaglio reso ---------- */
.er-root .easyreturn-detail__header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
  margin: 8px 0 24px; padding-bottom: 22px; border-bottom: 1px solid var(--er-line, #e2e8e2);
  flex-wrap: wrap;
}
.er-root .easyreturn-detail__header h3 { margin: 12px 0 6px; font-size: 24px; }
.er-root .easyreturn-detail__header h3 .easyreturn-mono,
.er-root .easyreturn-detail__header .easyreturn-mono { font-size: .82em; }
.er-root .easyreturn-detail__refund {
  text-align: right; background: var(--er-paper, #f3f6f3); border: 1px solid var(--er-line, #e2e8e2);
  border-radius: var(--er-r-sm, 10px); padding: 12px 18px; min-width: 150px;
}
.er-root .easyreturn-detail__refund .er-text-muted { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.er-root .easyreturn-detail__refund strong { display: block; font-size: 24px; font-family: var(--er-mono, monospace); color: var(--er-ink, #16241c); margin-top: 3px; }
.er-root .easyreturn-detail h4 { font-size: 16px; margin: 0 0 12px; }
.er-root .easyreturn-detail__products th { font-size: 13px; color: var(--er-ink-soft, #52635a); }
.er-root .easyreturn-detail__products th,
.er-root .easyreturn-detail__products td { border-bottom: 1px solid var(--er-line, #e2e8e2); }

/* ---------- Signature: il binario tracker ---------- */
.er-root .easyreturn-timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.er-root .easyreturn-timeline li {
  position: relative; padding: 0 0 22px 26px;
  border-left: 2px solid var(--er-line-strong, #cdd8cf);
}
.er-root .easyreturn-timeline li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.er-root .easyreturn-timeline__dot {
  position: absolute; left: -8px; top: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 0 4px var(--er-surface, #fff);
}
.er-root .easyreturn-timeline li:last-child .easyreturn-timeline__dot {
  width: 18px; height: 18px; left: -10px; top: -1px;
  box-shadow: 0 0 0 4px var(--er-surface, #fff), 0 0 0 8px rgba(31, 143, 99, .16);
  animation: er-pulse 2s ease-out infinite;
}
.er-root .easyreturn-timeline__state { display: block; font-weight: 600; color: var(--er-ink-soft, #52635a); }
.er-root .easyreturn-timeline li:last-child .easyreturn-timeline__state { color: var(--er-ink, #16241c); font-weight: 700; }
.er-root .easyreturn-timeline__date { display: block; font-size: 12px; color: var(--er-ink-soft, #52635a); font-family: var(--er-mono, monospace); margin-top: 1px; }

@keyframes er-pulse {
  0% { box-shadow: 0 0 0 4px var(--er-surface, #fff), 0 0 0 6px rgba(31, 143, 99, .28); }
  70% { box-shadow: 0 0 0 4px var(--er-surface, #fff), 0 0 0 14px rgba(31, 143, 99, 0); }
  100% { box-shadow: 0 0 0 4px var(--er-surface, #fff), 0 0 0 14px rgba(31, 143, 99, 0); }
}

/* ---------- Messaggi ---------- */
.er-root .easyreturn-messages { margin: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.er-root .easyreturn-message { padding: 12px 16px; border-radius: 14px; max-width: 82%; box-shadow: var(--er-shadow-sm, 0 3px 12px -7px rgba(16, 40, 28, .35)); }
.er-root .easyreturn-message--customer { background: var(--er-brand-tint, #e9f4ee); border-bottom-right-radius: 4px; margin-left: auto; }
.er-root .easyreturn-message--merchant { background: var(--er-surface, #fff); border: 1px solid var(--er-line, #e2e8e2); border-bottom-left-radius: 4px; }
.er-root .easyreturn-message__head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 5px; color: var(--er-ink-soft, #52635a); }
.er-root .easyreturn-message__head strong { color: var(--er-ink, #16241c); }
.er-root .easyreturn-message__head .er-text-muted,
.er-root .easyreturn-message__head span:last-child { font-family: var(--er-mono, monospace); }
.er-root .easyreturn-message__body { line-height: 1.5; }
.er-root .easyreturn-message-form { margin-top: 16px; }
.er-root .easyreturn-back { margin-top: 22px; }
.er-root .easyreturn-back a { color: var(--er-brand-deep, #136848); font-weight: 600; text-decoration: none; }
.er-root .easyreturn-back a:hover { text-decoration: underline; }

/* ---------- Storico (card su mobile) ---------- */
.er-root .easyreturn-history-table { width: 100%; }
.er-root .easyreturn-history-table thead th { font-size: 13px; color: var(--er-ink-soft, #52635a); border-bottom: 2px solid var(--er-line, #e2e8e2); }
.er-root .easyreturn-history-table tbody tr { border-bottom: 1px solid var(--er-line, #e2e8e2); }
.er-root .easyreturn-history-table tbody tr:hover { background: var(--er-brand-tint, #e9f4ee); }
.er-root .easyreturn-history-table .easyreturn-mono { font-weight: 600; }

/* ============================================================ *
 * 5) ACCESSIBILITÀ + RIDOTTO MOVIMENTO
 * ============================================================ */
.er-root a:focus-visible,
.er-root button:focus-visible,
.er-root input:focus-visible,
.er-root select:focus-visible,
.er-root textarea:focus-visible,
.er-root .easyreturn-btn-return:focus-visible {
  outline: 2px solid var(--er-brand, #1f8f63);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .er-root * { animation: none !important; transition: none !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .er-root .easyreturn-order-box__body { padding: 18px 18px 20px 20px; }
  .er-root .easyreturn-btn-return { width: 100%; justify-content: center; }

  .er-root .easyreturn-steps { gap: 6px; }
  .er-root .easyreturn-step { padding: 9px 10px; font-size: 11.5px; justify-content: center; }

  .er-root .easyreturn-product { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .er-root .easyreturn-product__info { flex: 1 1 60%; }
  .er-root .easyreturn-product__controls { flex: 1 1 100%; gap: 12px; }
  .er-root .easyreturn-product__controls label { flex: 1; }
  .er-root .easyreturn-product__controls select,
  .er-root .easyreturn-qty { width: 100%; }

  .er-root .easyreturn-actions { flex-direction: column; }
  .er-root .easyreturn-actions .er-btn { width: 100%; }
  .er-root .easyreturn-message { max-width: 92%; }

  .er-root .easyreturn-detail__refund { text-align: left; width: 100%; }

  /* Storico: tabella -> card impilate */
  .er-root .easyreturn-history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .er-root .easyreturn-history-table,
  .er-root .easyreturn-history-table tbody,
  .er-root .easyreturn-history-table tr,
  .er-root .easyreturn-history-table td { display: block; width: 100%; }
  .er-root .easyreturn-history-table tr {
    border: 1px solid var(--er-line, #e2e8e2); border-radius: var(--er-r, 16px); margin-bottom: 12px;
    padding: 6px 14px; background: var(--er-surface, #fff); box-shadow: var(--er-shadow-sm, 0 3px 12px -7px rgba(16, 40, 28, .35));
  }
  .er-root .easyreturn-history-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    text-align: right; padding: 9px 0; border-bottom: 1px solid var(--er-line, #e2e8e2);
  }
  .er-root .easyreturn-history-table tr td:last-child { border-bottom: none; }
  .er-root .easyreturn-history-table td::before {
    content: attr(data-label); text-align: left;
    font-size: 12px; font-weight: 600; color: var(--er-ink-soft, #52635a);
  }
  .er-root .easyreturn-history-table td .er-btn { width: auto; }
}
