/* ============================================================
   DOTEC Shipping Info v4
   ============================================================ */

#dotec-shipping-info {
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  overflow: hidden;
  font-size: .875rem;
  line-height: 1.5;
  margin: 12px 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* ============================================================
   HEADER
   ============================================================ */
.dotec-si-header { background: #f4f6f9; border-bottom: 1px solid #e0e4ea; }

.dotec-si-country-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: #374151;
  text-align: left;
  transition: background .12s;
}
.dotec-si-country-btn:hover { background: #eaecf0; }

/* ícone camião no header */
.dotec-si-header-left { display: flex; align-items: center; flex-shrink: 0; }
.dotec-si-truck-icon  { color: #6b7280; display: block; }

/* destino */
.dotec-si-header-dest {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.dotec-si-dest-label {
  font-size: .75rem;
  color: #9ca3af;
  line-height: 1.2;
}
.dotec-si-dest-country {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.dotec-si-flag {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
  flex-shrink: 0;
  vertical-align: middle;
}
.dotec-si-country-name {
  font-size: .875rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dotec-si-state-name { font-size: .8rem; color: #6b7280; white-space: nowrap; }

/* ícone externo */
.dotec-si-launch-icon { color: #2563eb; flex-shrink: 0; opacity: .65; transition: opacity .12s; }
.dotec-si-country-btn:hover .dotec-si-launch-icon { opacity: 1; }

/* ============================================================
   BODY
   ============================================================ */
.dotec-si-body {
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dotec-si-body.is-loading { opacity: .35; pointer-events: none; }

/* ---- Rows ---- */
.dotec-si-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .875rem;
  color: #374151;
}
.dotec-si-row > svg,
.dotec-si-row > .dotec-si-carrier-icon { flex-shrink: 0; margin-top: 1px; }

/* ---- Carrier row ---- */
.dotec-si-row--carrier { align-items: center; }

.dotec-si-carrier-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  flex-shrink: 0;
  color: #6b7280;
}
.dotec-si-carrier-logo {
  max-width: 32px;
  max-height: 24px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.dotec-si-carrier-logo-fallback { display: flex; align-items: center; }

.dotec-si-carrier-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.dotec-si-carrier-name  { font-weight: 600; color: #111827; font-size: .875rem; }
.dotec-si-carrier-delay { font-size: .775rem; color: #6b7280; }

.dotec-si-price { font-size: .9375rem; font-weight: 700; white-space: nowrap; color: #111827; flex-shrink: 0; }
.dotec-si-price--free { color: #15803d; }

/* ---- Free row ---- */
.dotec-si-row--free > svg { color: #16a34a; margin-top: 2px; }
.dotec-si-row--free { color: #15803d; }

/* ---- Threshold row ---- */
.dotec-si-row--threshold { align-items: flex-start; color: #92400e; }
.dotec-si-row--threshold > svg { color: #d97706; margin-top: 3px; flex-shrink: 0; }
.dotec-si-threshold-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.dotec-si-amount { color: #d97706; }

/* ---- Blocked / warn ---- */
.dotec-si-row--blocked > svg { color: #dc2626; margin-top: 2px; }
.dotec-si-row--blocked { color: #991b1b; }
.dotec-si-row--warn > svg { color: #9ca3af; margin-top: 2px; }
.dotec-si-row--warn { color: #6b7280; }

/* ---- Progress bar ---- */
.dotec-si-progress-bar {
  height: 5px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}
.dotec-si-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 9999px;
  transition: width .4s ease;
}
.dotec-si-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .73rem;
  color: #9ca3af;
}

/* ============================================================
   MODAL
   ============================================================ */
.dotec-si-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dotec-si-modal[hidden] { display: none !important; }
.dotec-si-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  animation: dsiBack .18s ease;
}
@keyframes dsiBack    { from { opacity:0 } to { opacity:1 } }
@keyframes dsiSlideUp { from { transform:translateY(14px);opacity:0 } to { transform:translateY(0);opacity:1 } }

.dotec-si-modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
  animation: dsiSlideUp .2s ease;
  overflow: hidden;
}
.dotec-si-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.dotec-si-modal-header h3 { margin: 0; font-size: .9375rem; font-weight: 600; color: #111827; }
.dotec-si-modal-close {
  background: none; border: none; cursor: pointer;
  color: #6b7280; padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: background .12s, color .12s; flex-shrink: 0;
}
.dotec-si-modal-close:hover { background: #f3f4f6; color: #111827; }

.dotec-si-modal-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  position: relative;
}

/* Steps */
.dotec-si-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  overflow: hidden;
  flex: 1;
  transition: opacity .15s, transform .15s;
}
.dotec-si-step--hidden {
  display: none;
}

.dotec-si-modal-label {
  font-size: .8125rem;
  color: #6b7280;
  margin: 0;
  flex-shrink: 0;
}
.dotec-si-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  flex-shrink: 0;
}
.dotec-si-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Listas país e estado */
.dotec-si-country-list, .dotec-si-state-list {
  list-style: none; margin: 0; padding: 0;
  overflow-y: auto; flex: 1;
}
.dotec-si-country-item, .dotec-si-state-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: 6px; cursor: pointer;
  color: #374151; font-size: .875rem;
  transition: background .1s;
}
.dotec-si-country-item:hover, .dotec-si-state-item:hover  { background: #f3f4f6; }
.dotec-si-country-item.is-active, .dotec-si-state-item.is-active {
  background: #eff6ff; color: #1d4ed8; font-weight: 600;
}
.dotec-si-country-item img { flex-shrink: 0; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.dotec-si-country-item span, .dotec-si-state-item span { flex: 1; }
.dotec-si-check { flex-shrink: 0; color: #2563eb; }
.dotec-si-has-states { flex-shrink: 0; color: #9ca3af; }
.dotec-si-country-item.is-hidden { display: none !important; }

/* Botão voltar */
.dotec-si-back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  color: #2563eb; font-size: .8125rem; font-family: inherit; padding: 0;
  flex-shrink: 0;
}
.dotec-si-back-btn:hover { text-decoration: underline; }

/* Scrollbar */
.dotec-si-country-list::-webkit-scrollbar,
.dotec-si-state-list::-webkit-scrollbar       { width: 4px; }
.dotec-si-country-list::-webkit-scrollbar-track,
.dotec-si-state-list::-webkit-scrollbar-track { background: #f8f9fb; }
.dotec-si-country-list::-webkit-scrollbar-thumb,
.dotec-si-state-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
