/* =============================================
   FSP Frete Pro — Frontend CSS
   Calculadora de frete para página do produto.
   ============================================= */

/* ── Variáveis ─────────────────────────────── */
:root {
  --fret-primary:     #1d4ed8;
  --fret-primary-h:   #1e40af;
  --fret-radius:      999px;   /* pill */
  --fret-radius-card: 12px;
  --fret-border:      #e5e7eb;
  --fret-text:        #111827;
  --fret-muted:       #6b7280;
  --fret-success:     #059669;
  --fret-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Card container ──────────────────────────── */
.fsp-frete-calc {
  font-family: var(--fret-font);
  background: #fff;
  border: 1px solid var(--fret-border);
  border-radius: var(--fret-radius-card);
  padding: 18px 20px 16px;
  max-width: 480px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ── Header (ícone + título) ─────────────────── */
.fsp-frete-calc__header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--fret-text);
  margin-bottom: 14px;
}
.fsp-frete-calc__header svg {
  color: var(--fret-primary);
  flex-shrink: 0;
}

/* ── Linha de input + botão ──────────────────── */
.fsp-frete-calc__input-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}

.fsp-frete-calc__input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  font-size: 15px;
  font-family: var(--fret-font);
  color: var(--fret-text);
  background: #fff;
  border: 1.5px solid var(--fret-border);
  border-radius: var(--fret-radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  /* sobrescreve estilos do tema */
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.fsp-frete-calc__input:focus {
  border-color: var(--fret-primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12) !important;
}
.fsp-frete-calc__input::placeholder {
  color: #9ca3af;
}

/* ── Botão Calcular ──────────────────────────── */
.fsp-frete-calc__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 22px;
  background: var(--fret-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--fret-font);
  border: none;
  border-radius: var(--fret-radius);
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.fsp-frete-calc__btn:hover { background: var(--fret-primary-h); }
.fsp-frete-calc__btn:active { transform: scale(.97); }
.fsp-frete-calc__btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Loader (spinner) ────────────────────────── */
.fsp-frete-calc__btn-loader {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fsp-spin .6s linear infinite;
}
.fsp-frete-calc--loading .fsp-frete-calc__btn-loader { display: block; }
.fsp-frete-calc--loading .fsp-frete-calc__btn-text   { display: none; }
.fsp-frete-calc--loading .fsp-frete-calc__btn        { pointer-events: none; }

@keyframes fsp-spin { to { transform: rotate(360deg); } }

/* ── "Não sei meu CEP" ───────────────────────── */
.fsp-frete-calc__nao-sei {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--fret-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .12s;
}
.fsp-frete-calc__nao-sei:hover { color: var(--fret-primary-h); }

/* ── Área de resultado ───────────────────────── */
.fsp-frete-calc__resultado {
  margin-top: 16px;
}

/* Erro */
.fsp-frete-erro {
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
}

/* Lista de opções */
.fsp-frete-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Item de frete */
.fsp-frete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid var(--fret-border);
  border-radius: 10px;
  font-size: 13px;
  transition: border-color .12s, background .12s;
}
.fsp-frete-item:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.fsp-frete-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.fsp-frete-item__nome {
  font-weight: 600;
  color: var(--fret-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fsp-frete-item__prazo {
  font-size: 12px;
  color: var(--fret-muted);
}

.fsp-frete-item__preco {
  font-size: 14px;
  font-weight: 700;
  color: var(--fret-text);
  white-space: nowrap;
  flex-shrink: 0;
}
.fsp-frete-item__preco--gratis {
  color: var(--fret-success);
}

/* Fonte badge (pequeno) */
.fsp-frete-item__fonte {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}
.fsp-frete-fonte-manual     { background: #dbeafe; color: #1e40af; }
.fsp-frete-fonte-superfrete { background: #fce7f3; color: #9d174d; }
.fsp-frete-fonte-melhor_envio { background: #ecfdf5; color: #065f46; }
