/* Favoritos e comparador — comprador PF */

.portal-veiculo-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 12;
  display: flex;
  gap: 0.35rem;
}

.portal-btn-favorito,
.portal-btn-comparar {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #64748b;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}

.portal-btn-favorito:hover,
.portal-btn-comparar:hover {
  transform: scale(1.05);
  color: #0050e9;
}

.portal-btn-favorito.is-active {
  color: #e11d48;
}

.portal-btn-comparar.is-active {
  color: #0050e9;
  background: #eff6ff;
}

.portal-veiculo-actions--favorito-only {
  gap: 0;
}

.portal-veiculo-actions--detail {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.portal-veiculo-actions--detail .portal-btn-favorito,
.portal-veiculo-actions--detail .portal-btn-comparar {
  width: auto;
  height: auto;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  gap: 0.4rem;
}

.portal-veiculo-actions--detail .portal-btn-favorito::after {
  content: 'Favoritar';
  font-weight: 600;
}

.portal-veiculo-actions--detail .portal-btn-favorito.is-active::after {
  content: 'Favoritado';
}

.portal-veiculo-actions--detail .portal-btn-comparar::after {
  content: 'Comparar';
  font-weight: 600;
}

.portal-veiculo-actions--detail .portal-btn-comparar.is-active::after {
  content: 'Na comparação';
}

.portal-compare-login-cta {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid rgba(0, 80, 233, 0.15);
}

.portal-compare-login-cta h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.portal-compare-login-cta p {
  margin-bottom: 1rem;
  color: #475569;
}

.page-anuncio .portal-compare-bar.is-visible {
  bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

.portal-compare-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Variante outline (usada na barra e em Comparar / Vender) */
.portal-btn--outline {
  background: #fff;
  border: 1px solid #c5d0e6;
  color: #0050e9;
}

.portal-btn--outline:hover {
  background: #f4f7ff;
  border-color: #0050e9;
  color: #003db8;
}

.portal-compare-bar .portal-compare-bar-clear,
.portal-compare-bar .portal-btn--outline.portal-compare-bar-clear {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  color: #fff !important;
  box-shadow: none;
}

.portal-compare-bar .portal-compare-bar-clear:hover,
.portal-compare-bar .portal-btn--outline.portal-compare-bar-clear:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: #fff !important;
  color: #fff !important;
  transform: none;
}

.portal-comprador-body.portal-compare-active {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.portal-compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1rem;
  transform: translateY(110%);
  transition: transform 0.25s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.portal-compare-bar.is-visible {
  transform: translateY(0);
}

.portal-compare-bar--shake {
  animation: portalCompareBarShake 0.55s ease;
}

@keyframes portalCompareBarShake {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(0) translateX(-6px); }
  40% { transform: translateY(0) translateX(6px); }
  60% { transform: translateY(0) translateX(-4px); }
  80% { transform: translateY(0) translateX(4px); }
}

.portal-compare-limite-alert {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%) translateY(16px) scale(0.96);
  z-index: 1060;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: min(92vw, 480px);
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid #93c5fd;
  border-left: 5px solid #0050e9;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  box-shadow: 0 12px 40px rgba(0, 80, 233, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.portal-compare-limite-alert.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.portal-compare-limite-alert__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0050e9 0%, #15eeff 100%);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 80, 233, 0.35);
}

.portal-compare-limite-alert__title {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e40af;
  letter-spacing: -0.01em;
}

.portal-compare-limite-alert__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1e3a8a;
  padding-right: 1.25rem;
}

.portal-compare-limite-alert__text strong {
  color: #1e40af;
}

.portal-compare-limite-alert__close {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  border: none;
  background: transparent;
  color: #3b82f6;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.portal-compare-limite-alert__close:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

@media (max-width: 575.98px) {
  .portal-compare-limite-alert {
    bottom: 6rem;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .portal-compare-limite-alert__icon {
    margin: 0 auto;
  }

  .portal-compare-limite-alert__text {
    padding-right: 0;
  }
}

.portal-compare-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-compare-bar-text {
  font-size: 0.95rem;
}

.portal-compare-bar .portal-btn {
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
}

.portal-compare-bar .portal-btn--primary.disabled,
.portal-compare-bar .portal-btn--primary[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.portal-compare-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1050;
  max-width: min(90vw, 360px);
  text-align: center;
}

.portal-compare-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.portal-compare-toast--warning {
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  box-shadow: 0 6px 20px rgba(180, 83, 9, 0.35);
  font-weight: 600;
  max-width: min(92vw, 420px);
}

.portal-compare-table-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.portal-compare-table th,
.portal-compare-table td {
  vertical-align: middle;
  font-size: 0.9rem;
}

.portal-compare-label-col,
.portal-compare-row-label {
  background: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
  min-width: 140px;
}

.portal-compare-veiculo-col {
  min-width: 160px;
  text-align: center;
}

.portal-compare-foto {
  max-width: 140px;
  max-height: 90px;
  object-fit: cover;
  border-radius: 8px;
}

.portal-compare-remove {
  display: block;
  margin: 0 auto;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}

.portal-compare-veiculo-link {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.portal-compare-veiculo-link:hover {
  color: #0050e9;
}

@media (max-width: 767px) {
  .portal-compare-bar-inner {
    flex-direction: column;
    text-align: center;
  }
}

.portal-favorito-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.35rem;
}
.portal-favorito-badge--down {
  background: #dcfce7;
  color: #166534;
}

/* body legado usa color:#fff — área do comprador PF precisa de texto escuro */
main.page-favoritos .portal-page-body,
main.page-comparar .portal-page-body {
  color: #334155;
}

.portal-favoritos-alertas {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: #1e293b;
}

.portal-favoritos-alertas h2 {
  color: #0f172a;
}

.portal-favoritos-alerta-item strong,
.portal-favoritos-alerta-titulo {
  color: #0f172a;
  font-weight: 600;
}

.portal-favorito-alerta-toggle {
  cursor: pointer;
  user-select: none;
  color: #475569;
}

.portal-favoritos-limite-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #fcd34d;
  border-left: 5px solid #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #78350f;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.18);
}

.portal-favoritos-limite-banner__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.portal-favoritos-limite-banner__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #92400e;
  letter-spacing: -0.01em;
}

.portal-favoritos-limite-banner__text {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.5;
  color: #78350f;
}

.portal-favoritos-limite-banner__text strong {
  color: #92400e;
}

.portal-favoritos-limite-alert {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%) translateY(16px) scale(0.96);
  z-index: 1060;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: min(92vw, 480px);
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid #fcd34d;
  border-left: 5px solid #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #78350f;
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.portal-favoritos-limite-alert.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.portal-favoritos-limite-alert__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.portal-favoritos-limite-alert__title {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #92400e;
  letter-spacing: -0.01em;
}

.portal-favoritos-limite-alert__text {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #78350f;
  padding-right: 1.25rem;
}

.portal-favoritos-limite-alert__text strong {
  color: #92400e;
}

.portal-favoritos-limite-alert__link {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
  text-decoration: none;
  border-bottom: 1px solid rgba(146, 64, 14, 0.35);
  transition: color 0.15s, border-color 0.15s;
}

.portal-favoritos-limite-alert__link:hover {
  color: #b45309;
  border-bottom-color: #b45309;
}

.portal-favoritos-limite-alert__close {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  border: none;
  background: transparent;
  color: #d97706;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.portal-favoritos-limite-alert__close:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.portal-btn-favorito--shake {
  animation: portalFavoritoBtnShake 0.55s ease;
}

@keyframes portalFavoritoBtnShake {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.08) rotate(-8deg); }
  40% { transform: scale(1.08) rotate(8deg); }
  60% { transform: scale(1.05) rotate(-5deg); }
  80% { transform: scale(1.05) rotate(5deg); }
}

@media (max-width: 575.98px) {
  .portal-favoritos-limite-alert {
    bottom: 1.25rem;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .portal-favoritos-limite-alert__icon {
    margin: 0 auto;
  }

  .portal-favoritos-limite-alert__text {
    padding-right: 0;
  }
}

@media (max-width: 575.98px) {
  .portal-favoritos-limite-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .portal-favoritos-limite-banner__icon {
    margin: 0 auto;
  }
}

@media print {
  .loja-header, .loja-topbar, #header, footer, .portal-compare-bar,
  .portal-compare-toolbar, .next-top, .portal-compare-remove {
    display: none !important;
  }
  .page-comparar .portal-page-body {
    padding: 0 !important;
  }
  .portal-compare-table-wrap {
    box-shadow: none;
  }
  .portal-compare-foto {
    max-width: 100px;
  }
}
