/* rastreio.css — v2.1 (2026-01-15)
   - Mantém v2.0
   - MODAIS: padroniza modais injetados (ship/occ/pick) usando o MESMO estilo do modal de vídeo
   - Remove dependência de inline-style nos botões pequenos (classe rt-mini-action--sm)
   - NÃO altera IDs
*/

:root{
  --pri:#69488E;
  --pri-2:#7b5aa4;
  --pri-h:#d59b68;
  --bg:#f3f1f6;
  --card:#ffffff;
  --txt:#111827;
  --muted:#6b7280;
  --line:rgba(17,24,39,.10);
  --shadow: 0 18px 50px rgba(17,24,39,.10);
  --shadow-2: 0 10px 25px rgba(17,24,39,.10);
  --radius:18px;
  --radius-sm:12px;
}

*{box-sizing:border-box}
html,body{height:100%}
html,body{ overflow-x:hidden; }

body{
  margin:0;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  color:var(--txt);
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(105,72,142,.12), transparent 60%),
    radial-gradient(900px 500px at 80% -10%, rgba(213,155,104,.10), transparent 60%),
    var(--bg);
}

.rt-page{
  max-width: 1050px;
  margin: 0 auto;
  padding: 26px 16px 18px;
  padding-top: calc(26px + env(safe-area-inset-top));
}

.rt-brand{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom: 18px;
}

.rt-logo{
  max-width: 260px;
  height:auto;
  display:block;
}

.rt-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rt-card--search{
  padding: 18px 18px 16px;
}

.rt-title{
  margin: 0 0 6px 0;
  font-size: 22px;
  letter-spacing: -.02em;
  font-weight: 600;
}

.rt-subtitle{
  margin: 0 0 14px 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 13.5px;
  font-weight: 400;
}

.rt-form{
  display:grid;
  gap: 10px;
}

.rt-label{
  font-size: 12px;
  font-weight: 500;
  letter-spacing:.01em;
  color:#111827;
}

.rt-input{
  width:100%;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.14);
  padding: 12px 12px;
  font-size: 14px;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
  background:#fff;
  font-weight: 400;
}

.rt-input:focus{
  border-color: rgba(105,72,142,.45);
  box-shadow: 0 0 0 4px rgba(105,72,142,.14);
}

.rt-btn{
  width:100%;
  border:0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing:.01em;
  cursor:pointer;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.rt-btn--pg{
  background: linear-gradient(135deg, var(--pri), var(--pri-2));
  color:#fff;
  box-shadow: 0 14px 30px rgba(105,72,142,.22);
}

.rt-btn--pg:hover{
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(105,72,142,.24);
}

.rt-btn--pg:active{
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(105,72,142,.22);
}

.rt-btn:disabled{
  opacity:.65;
  cursor:not-allowed;
  transform:none !important;
}

.rt-btn-ic{
  width: 28px;
  height: 28px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
}

.rt-msg{
  margin-top: 6px;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 13px;
  border: 1px solid var(--line);
}

.rt-msg.success{
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.25);
  color: #065f46;
}

.rt-msg.error{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.25);
  color: #7f1d1d;
}

.rt-results{ margin-top: 16px; }

.rt-results-grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 14px;
}
.rt-results-grid > *{ min-width:0; }

@media (max-width: 980px){
  .rt-results-grid{ grid-template-columns: minmax(0, 1fr); }
}

.rt-card--order{
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-2);
}

.rt-order-head{
  display:flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.rt-order-left{ min-width:0; }
.rt-order-right{
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items:stretch;
  flex: 0 0 auto;
}

.rt-mini-card{
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(17,24,39,.08);
  padding: 10px 12px;
  text-align:center;
  min-width: 132px;
}

.rt-mini-kicker{
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 4px;
}

.rt-mini-value{
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.rt-mini-action{
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.14);
  background: #fff;
  box-shadow: 0 14px 34px rgba(17,24,39,.08);
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 600;
  color:#111827;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  transition: transform .10s ease, box-shadow .12s ease, border-color .12s ease;
  min-width: 132px;
}

.rt-mini-action:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(17,24,39,.12);
  border-color: rgba(17,24,39,.18);
}

.rt-mini-action-ic{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(105,72,142,.12);
}

/* ✅ Botão pequeno (pra modais/stepper) — sem inline-style */
.rt-mini-action--sm{
  min-width: auto;
  padding: 10px 12px;
}

@media (max-width: 520px){
  .rt-order-head{ flex-direction: column; align-items: stretch; }
  .rt-order-right{ width: 100%; flex-direction: row; gap: 10px; align-items: stretch; }
  .rt-mini-card, .rt-mini-action{ min-width: 0; width: 100%; }
  .rt-order-client{ width: 100%; }
}

.rt-order-client{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(17,24,39,.03);
  border: 1px dashed rgba(17,24,39,.12);
  font-weight: 400;
}

.rt-divider{
  height:1px;
  background: var(--line);
  margin: 12px 0;
}

.rt-order-meta{ display:grid; gap: 8px; }

.rt-meta-row{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}

.rt-meta-k{
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.rt-meta-v{
  font-size: 13px;
  font-weight: 500;
}

.rt-products-title{
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

.rt-products-list{ display:grid; gap: 10px; }

.rt-product{
  display:grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items:center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:#fff;
}

.rt-product-img{
  width:48px;
  height:48px;
  border-radius: 12px;
  background: rgba(17,24,39,.06);
  border:1px solid rgba(17,24,39,.08);
  object-fit: cover;
}

.rt-product-title{
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
}

.rt-product-sub{
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.rt-product-qty{
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.rt-product-price{
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
}

.rt-timeline{
  padding: 14px;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.rt-timeline-title{
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.rt-current-stage{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.rt-steps{
  margin-top: 12px;
  display:grid;
  gap: 10px;
}

.rt-step{
  display:grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  position: relative;
}

.rt-step-left{
  position: relative;
  display:flex;
  justify-content:center;
}

.rt-step-dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(17,24,39,.18);
  background: #fff;
  margin-top: 6px;
  z-index: 2;
}

.rt-step-line{
  position:absolute;
  top: 22px;
  bottom: -12px;
  width: 2px;
  background: rgba(17,24,39,.10);
  border-radius: 2px;
}

.rt-step:last-child .rt-step-line{ display:none; }

.rt-step-card{
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  min-width: 0;
}

.rt-step-top{
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 10px;
}

.rt-step-title{
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -.01em;
  display:flex;
  align-items:center;
  gap: 8px;
  min-width: 0;
}

.rt-step-date{
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.rt-step-msg{
  margin-top: 6px;
  font-size: 12.5px;
  color: #374151;
  font-weight: 400;
  line-height: 1.25;
}

.rt-step-tag{
  display:inline-flex;
  align-items:center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  border:1px solid transparent;
}

.rt-step-tag--current{
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.25);
  color:#065f46;
}

.rt-step-tag--future{
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.25);
  color:#92400e;
}

.rt-step--done .rt-step-dot{
  background: rgba(105,72,142,.14);
  border-color: rgba(105,72,142,.45);
}
.rt-step--done .rt-step-line{ background: rgba(105,72,142,.18); }
.rt-step--done .rt-step-card{ background: rgba(105,72,142,.04); }

.rt-step--current .rt-step-dot{
  background: rgba(16,185,129,.18);
  border-color: rgba(16,185,129,.65);
  box-shadow: 0 0 0 6px rgba(16,185,129,.10);
}
.rt-step--current .rt-step-line{ background: rgba(16,185,129,.18); }
.rt-step--current .rt-step-card{
  border-color: rgba(16,185,129,.35);
  box-shadow: 0 12px 25px rgba(16,185,129,.10);
}

.rt-step--future .rt-step-dot{
  background:#fff;
  border-color: rgba(245,158,11,.55);
}
.rt-step--future .rt-step-card{
  border-style: dashed;
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.04);
}

/* DICAS (accordion) */
.rt-card--tips{
  margin-top: 14px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.rt-accordion{
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.rt-accordion-summary{
  list-style: none;
  cursor: pointer;
  padding: 14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  user-select:none;
  background: linear-gradient(180deg, rgba(105,72,142,.10), rgba(255,255,255,.85));
  border-bottom: 1px solid rgba(17,24,39,.08);
}

.rt-accordion-summary::-webkit-details-marker{ display:none; }

.rt-accordion-title{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.rt-accordion-ic{
  width: 32px;
  height: 32px;
  display:grid;
  place-items:center;
  border-radius: 999px;
  background: rgba(105,72,142,.14);
  border: 1px solid rgba(105,72,142,.22);
}

.rt-accordion-chev{
  font-weight: 600;
  color: rgba(17,24,39,.65);
  transition: transform .15s ease;
}

.rt-accordion[open] .rt-accordion-chev{ transform: rotate(180deg); }

.rt-accordion-body{ padding: 14px; }

.rt-tip{
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.96);
}

.rt-tip-title{
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #111827;
}

.rt-tip-text{
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: #374151;
}

.rt-tips-empty{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(17,24,39,.18);
  background: rgba(17,24,39,.02);
  color: rgba(17,24,39,.70);
  font-weight: 400;
  font-size: 13px;
}

/* quebra de texto */
.rt-product-title,
.rt-product-sub,
.rt-order-client,
.rt-meta-v,
.rt-step-msg,
.rt-tip-text{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Rodapé em card */
.rt-card--footer{
  margin-top: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow-2);
}

.rt-footer{
  text-align:center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.rt-footer-sublines{
  margin-top: 8px;
  display:grid;
  gap: 4px;
  color: rgba(17,24,39,.70);
  font-weight: 400;
}

.rt-footer-link{
  color: var(--pri);
  text-decoration: none;
  font-weight: 600;
}
.rt-footer-link:hover{ text-decoration: underline; }

/* Toast */
.rt-toast{
  position: fixed;
  left: 50%;
  top: calc(18px + env(safe-area-inset-top));
  transform: translateX(-50%) translateY(-8px);
  min-width: min(720px, calc(100vw - 28px));
  max-width: 720px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(17,24,39,.16);
  font-weight: 500;
  font-size: 13px;
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
  background: #ffffff;
  backdrop-filter: blur(8px);
}

.rt-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.rt-toast.hidden{ display:none; }

.rt-toast.info{ background: #eff6ff; border-color: rgba(59,130,246,.35); color: #1e3a8a; }
.rt-toast.success{ background: #ecfdf5; border-color: rgba(16,185,129,.35); color: #065f46; }
.rt-toast.error{ background: #fef2f2; border-color: rgba(239,68,68,.35); color: #7f1d1d; }

/* Loading Overlay */
.rt-loading{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.40);
  backdrop-filter: blur(6px);
  display:grid;
  place-items:center;
  z-index: 9998;
}
.rt-loading.hidden{ display:none; }

.rt-loading-card{
  width: min(420px, calc(100vw - 38px));
  background: #fff;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  padding: 16px 16px;
  display:flex;
  align-items:center;
  gap: 12px;
}

.rt-spinner{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 3px solid rgba(105,72,142,.20);
  border-top-color: rgba(105,72,142,.95);
  animation: rtspin .9s linear infinite;
}
@keyframes rtspin{ to { transform: rotate(360deg); } }

.rt-loading-text{
  font-weight: 500;
  font-size: 13px;
  color:#111827;
}

/* ALERTA (ID-BASED) */
#rt-alert-card{
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(239,68,68,.28);
  background: rgba(239,68,68,.06);
  box-shadow: 0 14px 34px rgba(17,24,39,.08);
  padding: 12px 12px;
}

#rt-alert-card .rt-alert-head,
#rt-alert-card .rt-alert-header,
#rt-alert-card .rt-alert-top,
#rt-alert-card > .rt-alert-title,
#rt-alert-card > .rt-alert-label{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 10px;
}

#rt-alert-card .rt-alert-ic,
#rt-alert-card .rt-alert-icon{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.22);
}

#rt-alert-body{
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(239,68,68,.18);
  padding: 12px 12px;
  color: #111827;
  font-weight: 400;
  line-height: 1.32;
  overflow-wrap:anywhere;
  word-break:break-word;
}
#rt-alert-body > div,
#rt-alert-body p{
  margin: 0;
  font-weight: 400;
}

/* MODAIS — vídeo + injetados (mesmo padrão) */
.rt-vmodal.hidden{ display:none !important; }

.rt-vmodal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.rt-vmodal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(17,24,39,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rt-vmodal-card{
  position: relative;
  width: min(720px, calc(100vw - 36px));
  max-height: min(86vh, calc(100vh - 36px));
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(17,24,39,.12);
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
  overflow: hidden;
  display:flex;
  flex-direction: column;
}

.rt-vmodal-close{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  font-weight: 600;
  display:grid;
  place-items:center;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  z-index: 2;
}

.rt-vmodal-close:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(17,24,39,.12);
  border-color: rgba(17,24,39,.18);
}

.rt-vmodal-title{
  padding: 14px 50px 12px 16px;
  border-bottom: 1px solid rgba(17,24,39,.10);
  font-weight: 600;
  font-size: 14px;
}

.rt-vmodal-content{
  padding: 14px 16px 16px;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  font-weight: 400;
}

/* utilitário pro JS esconder bodies */
.hidden{ display:none !important; }

/* Esconde botão “Mostrar informações ocultas” (fallback) */
#rt-show-hidden,
#rt-btn-reveal,
.rt-show-hidden,
.rt-reveal,
button[aria-label="Mostrar informações ocultas"],
button[data-act="reveal"],
button[data-action="reveal"]{
  display:none !important;
}


/* Setinha nos steps (quando tiver conteúdo para expandir) */
.rt-step-chev{
  display:inline-block;
  margin-left: 8px;
  font-weight: 700;
  color: rgba(17,24,39,.65);
  transition: transform .15s ease;
  transform: rotate(0deg);
}

/* Gira quando expandir (toggleStepBody já aplica rt-step--expanded) */
.rt-step--expanded .rt-step-chev{
  transform: rotate(180deg);
}
