/* Reset fragment (bezpieczny) */
.onset-rex-page, .onset-rex-page * { box-sizing: border-box; }
.onset-rex-page { background:#f7f8fb; color:#0e0f13; }

/* Layout */
.onset-rex-wrap{
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  line-height: 1.45;
}

.onset-rex-head{
  margin-bottom: 16px;
}
.onset-rex-title{
  font-size: clamp(22px, 3.2vw, 28px);
  margin: 0 0 6px;
  letter-spacing: .2px;
}
.onset-rex-sub{
  margin: 0 0 10px;
  color:#5a5f73;
}
.onset-rex-badges .badge{
  display:inline-flex; align-items:center; gap:.5ch;
  font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid #e5e7ef;
  margin-right:8px; background:#fff;
}
.onset-rex-badges .badge.ok{ border-color:#dce7dc; background:#f7fbf7; }
.onset-rex-badges .badge.off{ opacity:.6; }

/* Karta */
.onset-rex-card{
  background:#fff;
  border:1px solid #eceef5;
  border-radius:14px;
  padding:18px;
  margin: 14px 0;
  box-shadow: 0 1px 0 rgba(10,11,16,.02);
}
.onset-rex-card .card-title{
  font-size: 18px; margin:0 0 12px;
}

/* Lista pozycji */
.onset-rex-list{
  list-style:none; margin:0; padding:0;
}
.onset-rex-row{
  border:1px solid #f0f1f6;
  border-radius:12px;
  padding:12px;
  margin-bottom:10px;
  background:#fff;
}
.onset-rex-row .row-main{
  display:grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items:center;
}
.onset-rex-row .prod .name{ font-weight:600; }
.onset-rex-row .prod .meta{ color:#5a5f73; font-size:12px; margin-top:2px; }
.onset-rex-row .qty{ color:#5a5f73; font-variant-numeric: tabular-nums; }
.onset-rex-row .actions{ display:flex; gap:10px; }
.onset-rex-row .choice{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border:1px solid #e6e8f0; border-radius:10px;
  cursor:pointer; user-select:none; background:#fff;
}
.onset-rex-row input[type="checkbox"]{ width:16px; height:16px; }

/* Detale (zwrot / wymiana) */
.onset-rex-row .row-details{
  margin-top:10px; padding-top:10px; border-top:1px dashed #eceef5;
}
.onset-rex-row .field{
  display:flex; flex-direction:column; gap:6px; margin: 8px 0;
}
.onset-rex-row .field label{ font-size: 13px; color:#3b3f52; }
.onset-rex-row select,
.onset-rex-row input[type="text"],
.onset-rex-row textarea{
  border:1px solid #e1e4ee; border-radius:10px; padding:10px 12px; font:inherit; outline:none; background:#fff;
}
.onset-rex-row select:focus,
.onset-rex-row input[type="text"]:focus,
.onset-rex-row textarea:focus{
  border-color:#ff3b3b55;
  box-shadow: 0 0 0 4px rgba(255,59,59,.08);
}

/* Wyszukiwarka produktu */
.exchange-results{
  margin-top:8px; border:1px solid #eceef5; border-radius:12px; background:#fff; overflow:hidden;
  max-height: 320px; overflow-y:auto;
}
.exchange-results .result{
  padding:10px 12px; border-bottom:1px solid #f4f5fa; cursor:pointer;
}
.exchange-results .result:last-child{ border-bottom:none; }
.exchange-results .result:hover{ background:#f9fafc; }
.exchange-results .result.loading,
.exchange-results .result.empty,
.exchange-results .result.error{ color:#5a5f73; cursor:default; }

.exchange-results .r-main{ display:flex; justify-content:space-between; gap:10px; align-items:center; }
.exchange-results .r-name{ font-weight:600; font-size:14px; }
.exchange-results .r-price{ font-size:12px; color:#5a5f73; }

.r-variants{ padding:8px 2px 2px 2px; display:flex; flex-wrap:wrap; gap:8px; }
.r-variants .variant{
  border:1px solid #e6e8f0; border-radius:999px; padding:6px 10px; background:#fff; font-size:12px;
  cursor:pointer;
}
.r-variants .variant.loading,
.r-variants .variant.empty{ border:0; background:transparent; color:#5a5f73; cursor:default; }

/* Adres + bank */
.onset-rex-card .address{ color:#3b3f52; margin: 6px 0 10px; }
.onset-rex-card .bank input{ width: min(520px, 100%); }

/* Oświadczenie */
.onset-rex-card .agree{
  display:flex; align-items:flex-start; gap:10px; margin: 10px 0 0;
}
.onset-rex-card .agree input{ margin-top:3px; }

/* CTA / komunikaty */
.onset-rex-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.6ch;
  padding:10px 14px; border-radius:10px; border:1px solid #0e0f13; text-decoration:none; font-weight:600;
  transition: transform .12s ease, box-shadow .12s ease;
}
.onset-rex-btn:hover{ transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.onset-rex-btn.primary{
  background:#0e0f13; color:#fff !important; border-color:#0e0f13;
}
.onset-rex-btn.primary[aria-busy="true"]{ opacity:.7; pointer-events:none; }

.cta-row{ display:flex; align-items:center; gap:14px; margin-top:12px; }
.form-note{ font-size:13px; color:#5a5f73; }
.form-note.ok{ color:#1b7a36; }
.form-note.warn{ color:#9a6b00; }
.form-note.error{ color:#9a1a1a; }

/* Karty w "Moje konto" */
.onset-rex-account .onset-rex-card-hd{
  display:flex; gap: 12px; align-items:center; justify-content:space-between; margin-bottom:10px;
}
.onset-rex-order-id{ font-weight:700; }
.onset-rex-order-date{ color:#5a5f73; font-size:12px; }
.onset-rex-items{ list-style:none; margin:0 0 10px; padding:0; }
.onset-rex-item{ padding:6px 0; display:flex; gap:8px; align-items:baseline; border-bottom:1px dotted #eee; }
.onset-rex-item:last-child{ border-bottom:0; }
.onset-rex-item-name{ font-weight:600; }
.onset-rex-item-meta{ color:#5a5f73; font-size:12px; margin-left:6px; }
.onset-rex-item-qty{ margin-left:auto; color:#5a5f73; }

.onset-rex-ctas{ margin-top:4px; }
.onset-rex-info{ margin-top:6px; color:#5a5f73; }
.onset-rex-info.closed{ color:#8a8fa3; }

/* Respons */
@media (max-width:740px){
  .onset-rex-row .row-main{
    grid-template-columns: 1fr;
    align-items:flex-start;
  }
  .onset-rex-row .qty{ order: 3; }
  .onset-rex-row .actions{ order: 2; }
}

/* Nagłówek produktu w wynikach */
.onset-rex-product-head{
  display:flex; align-items:center; gap:10px; margin:6px 0 6px;
}
.onset-rex-product-name{ font-weight:600; }
.onset-rex-product-sku{ font-size:12px; color:#6b7280; }

/* Lista czystych opcji (etykieta + cena) */
.onset-rex-options{ display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 10px; }
.onset-rex-option{
  display:flex; align-items:center; gap:10px;
  border:1px solid #e8e8ef; border-radius:999px;
  padding:6px 12px; background:#fff; cursor:pointer;
}
.onset-rex-option .opt-label{ font-weight:500; }
.onset-rex-option .opt-price{ font-size:12px; opacity:.8; }
.onset-rex-option .opt-out{ font-size:11px; background:#fde2e2; padding:2px 6px; border-radius:6px; margin-left:6px; }
.onset-rex-option.is-selected{ outline:2px solid #1369A2; }

/* Placeholdery wyników */
.onset-rex-search-results{ margin-top:8px; border:1px solid #e8e8ef; border-radius:10px; padding:8px; max-height:280px; overflow:auto; }
.onset-rex-result.loading, .onset-rex-result.error, .onset-rex-result.empty{ color:#6b7280; font-style:italic; }

/* Podsumowanie wyboru w wierszu pozycji (opcjonalny badge) */
.onset-rex-picked{
  margin-left:auto; font-size:12px; color:#1369A2;
  padding:2px 8px; border:1px dashed rgba(19,105,162,.35);
  border-radius:999px;
}
.onset-rex-status{
  margin: 10px 0 6px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
}
.onset-rex-status[data-type="error"]{
  background:#FEF2F2; border-color:#FEE2E2; color:#991B1B;
}
.onset-rex-status[data-type="success"]{
  background:#F0FDF4; border-color:#DCFCE7; color:#065F46;
}
.onset-rex-status .onset-rex-status-inner{ line-height:1.4; }

.onset-rex-muted{ color:#6b7280; font-size:12px; }
