/* Cards - BusKPê */

/* Cards gerais já estão definidos no main.css para anuncio-card */
/* Este arquivo é para cards adicionais se necessário */

.card {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 30px 0px 30px;
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.01s ease, box-shadow 0.01s ease, border 0.01s ease;
}

/* Remove padding and margin when .card is combined with .anuncio-card */
.anuncio-card.card {
  padding: 0;
  margin: 0;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(241, 135, 25, 0.3);
  transform: translateY(-5px);
  border: 1px solid #f18719;
}

.card-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-body {
  padding: 0;
}

.card-footer {
  border-top: 1px solid var(--border-light);
  padding-top: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

/* Cards compactos */
.card-compact {
  padding: var(--spacing-md);
}

/* Cards sem sombra */
.card-flat {
  box-shadow: none;
  border: 1px solid var(--border-light);
}

/* Responsividade dos cards */
@media (max-width: 768px) {
  .card {
    padding: var(--spacing-md);
  }
  
  .card-compact {
    padding: var(--spacing-sm);
  }
}

/* ===== TIPOGRAFIA ESPECÍFICA PARA CARDS DE IMÓVEIS ===== */

/* Preços dos imóveis - 15px Arial Bold */
.anuncio-card .preco,
.anuncio-card .valor,
.anuncio-card .valor-principal,
.card .preco-valor {
  font-family: var(--font-family) !important;
  font-size: var(--font-size-lg) !important;
  font-weight: bold !important;
  color: var(--primary-color);
}

/* Títulos dos cards - 15px Arial Bold */
.anuncio-card .titulo,
.anuncio-card h3,
.card-title {
  font-family: var(--font-family) !important;
  font-size: var(--font-size-lg) !important;
  font-weight: bold !important;
  color: var(--text-primary);
}

/* Informações dos cards - 13px Arial */
.anuncio-card .info,
.anuncio-card .detalhes,
.anuncio-card .localizacao,
.anuncio-card .caracteristicas {
  font-family: var(--font-family) !important;
  font-size: var(--font-size-base) !important;
  font-weight: normal !important;
  gap: 4px;
}

/* Elementos específicos dos cards */
.anuncio-card .endereco,
.anuncio-card .bairro,
.anuncio-card .cidade {
  font-family: var(--font-family) !important;
  font-size: var(--font-size-base) !important;
}

/* Características (quartos, banheiros, área) */
.anuncio-card .quartos,
.anuncio-card .banheiros,
.anuncio-card .area,
.anuncio-card .vagas {
  font-family: var(--font-family) !important;
  font-size: var(--font-size-base) !important;
}

/* Botão de favorito nos cards */
.card-favorito-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Container da imagem precisa ter position relative para posicionamento correto do dropdown */
.card-image-container,
.image-container,
.anuncio-card-imagem-container {
  position: relative;
}

/* Cards devem ter position relative para dropdowns */
.anuncio-card,
.card {
  position: relative;
}

/* ===== LOGOS DE PLATAFORMA SOBREPOSTOS ===== */

/* Logo da plataforma de origem sobreposto na imagem */
.logo-origem-sobreposto {
  position: absolute;
  top: 8px;
  /* right é definido dinamicamente via JS: 8px, 63px, 118px */
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 1px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 5;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Efeito hover para logos */
.logo-origem-sobreposto:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 1);
}

/* Garantir que múltiplos logos não se sobreponham aos controles do carousel */
.carousel-control-prev,
.carousel-control-next {
  z-index: 6;
}

/* Responsividade - logos menores em mobile */
@media (max-width: 768px) {
  .logo-origem-sobreposto {
    width: 40px;
    height: 40px;
    padding: 1px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .logo-origem-sobreposto {
    width: 36px;
    height: 36px;
    padding: 1px;
    border-radius: 5px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
  }
}

/* Botão de compartilhamento nos cards */
.card-share-btn {
  position: absolute;
  bottom: 8px;
  right: 50px; /* Ao lado do botão de favorito */
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

  /* Mobile touch optimization */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

/* Área de toque maior para mobile (invisível, apenas funcional) */
.card-share-btn::before {
  content: '';
  position: absolute;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -8px;
  border-radius: 50%;
}

.card-favorito-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
  fill: #ffffff;
  stroke: #f46f09;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-share-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-favorito-btn svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2;
  transition: all 0.3s ease;
}

.card-favorito-btn.favorito svg {
  fill: #f46f09;
  stroke: #f46f09;
}

/* SVG do botão de compartilhamento */
.card-share-btn svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2;
  transition: all 0.3s ease;
  pointer-events: none; /* CRÍTICO: Permitir que click passe para o botão */
}

/* Path do SVG também não deve interceptar eventos */
.card-share-btn svg path {
  pointer-events: none;
}

/* Backdrop removido - usando click outside handler ao invés */

/* Dropdown de compartilhamento */
.share-dropdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
  padding: 0;
  min-width: 240px;
  max-width: 90%;
  display: none;
  z-index: 100000;
  animation: fadeInCenter 0.2s ease;
  overflow: hidden;
  pointer-events: auto;

  /* Mobile optimization */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Garantir que o dropdown seja visível mesmo quando ultrapassa o card */
.anuncio-card:has(.share-dropdown.active),
.card:has(.share-dropdown.active) {
  z-index: 1000;
  overflow: visible !important;
  position: relative;
}

/* Título do dropdown */
.share-dropdown-header {
  padding: 14px 20px;
  background: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  font-size: 15px;
  color: #333;
  text-align: center;
}

.share-dropdown-body {
  padding: 8px 0;
}

.share-dropdown.active {
  display: block;
}


/* Mobile: Ajustar posicionamento do dropdown */
@media (max-width: 768px) {
  .share-dropdown {
    min-width: 220px;
    font-size: 14px;
    width: 85%;
    max-width: 250px;
  }

  .share-dropdown-header {
    padding: 12px 16px;
    font-size: 14px;
  }

  .share-dropdown-item {
    padding: 10px 14px;
    font-size: 13px;
  }

  .share-dropdown-item svg {
    width: 22px;
    height: 22px;
  }
}

.share-dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;

  /* Mobile touch optimization */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

.share-dropdown-item:hover {
  background: #f0f0f0;
  cursor: pointer;
}

.share-dropdown-item:active {
  background: #e8e8e8;
}

.share-dropdown-item svg {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  pointer-events: none; /* CRÍTICO: Permitir que eventos passem para o item */
}

/* CRÍTICO: Span também não deve interceptar eventos */
.share-dropdown-item span {
  pointer-events: none;
}

/* Spinner pequeno para estados de loading */
.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
  pointer-events: none; /* Não interceptar eventos de toque */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Ícones de status (check e times) */
.share-dropdown-item i.fa-check {
  color: #28a745;
  margin-right: 8px;
  pointer-events: none;
}

.share-dropdown-item i.fa-times {
  color: #dc3545;
  margin-right: 8px;
  pointer-events: none;
}

/* Todos os ícones FontAwesome não devem interceptar eventos */
.share-dropdown-item i.fas {
  pointer-events: none;
}

.share-dropdown-item.whatsapp svg {
  fill: #25D366;
}

.share-dropdown-item.telegram svg {
  fill: #0088cc;
}

.share-dropdown-item.email svg {
  stroke: #666;
  fill: none;
}

.share-dropdown-item.copy svg {
  stroke: #666;
  fill: none;
}

/* Toast de link copiado */
.toast-copied {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  z-index: 10000;
  animation: slideUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInCenter {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Destaque para anúncio compartilhado */
.card-highlight-shared {
  box-shadow: 0 0 25px rgba(244, 111, 9, 0.6) !important;
  border: 2px solid #f46f09 !important;
  border-radius: 30px 0px 30px !important;
  position: relative;
  z-index: 20;
}

.card-highlight-shared::before {
  content: "🎯 Anúncio compartilhado";
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: #f46f09;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 21;
  animation: fadeInDown 0.5s ease;
}

/* Borda persistente após compartilhamento */
.card-shared-permanent {
  border: 2px solid #f46f09 !important;
  border-radius: 30px 0px 30px !important;
  box-shadow: 0 0 10px rgba(244, 111, 9, 0.3) !important;
}

@keyframes pulseHighlight {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.03);
  }
  75% {
    transform: scale(1.01);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.card-favorito-btn.loading {
  pointer-events: none;
}

.card-favorito-btn.loading svg {
  opacity: 0.5;
}

/* Estilo especial para confirmação de remoção de favorito */
.card-favorito-btn.confirming-remove {
  animation: shake 0.5s ease-in-out;
  background: rgba(220, 53, 69, 0.1) !important;
  border: 2px solid #dc3545 !important;
}

.card-favorito-btn.confirming-remove svg {
  fill: #dc3545 !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Indicador de carregamento */
.loading-indicator {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
  animation: pulse 1.5s infinite;
}

.loading-indicator::before {
  content: "⏳ ";
  font-size: 24px;
  margin-right: 10px;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Animação de pulso para feedback */
@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.card-favorito-btn.pulse {
  animation: heartPulse 0.3s ease;
}

/* Estilos para modo "Meus Favoritos" */
.favoritos-header {
  margin-bottom: 20px;
  animation: fadeInDown 0.5s ease;
}

.card-favorito-ativo {
  position: relative;
  animation: favoritoHighlight 0.5s ease;
}

.card-favorito-ativo::before {
  content: "💖";
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(244, 111, 9, 0.9);
  color: white;
  padding: 5px 8px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: bold;
  z-index: 10;
  animation: pulse 2s infinite;
}

/* Animações */
@keyframes favoritoHighlight {
  0% { 
    transform: scale(1); 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); 
  }
  50% { 
    transform: scale(1.02); 
    box-shadow: 0 8px 25px rgba(244, 111, 9, 0.3); 
  }
  100% { 
    transform: scale(1); 
    box-shadow: 0 4px 15px rgba(244, 111, 9, 0.2); 
  }
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MODAL DE CONFIRMAÇÃO DE FAVORITOS ===== */

/* Efeito de blur localizado no card */
.card-backdrop-blur {
  filter: blur(3px) brightness(0.7);
  transition: filter 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Modal sem background global - apenas posicionamento */
#modal-confirmacao-favorito {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Backdrop localizado atrás do modal */
#modal-confirmacao-favorito::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: -1;
  pointer-events: none;
}

/* Conteúdo do modal de confirmação */
#modal-confirmacao-favorito > div {
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

#modal-confirmacao-favorito.show > div {
  transform: scale(1);
}

/* Botões do modal de confirmação */
#modal-confirmacao-favorito button {
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

#modal-confirmacao-favorito #btn-cancelar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#modal-confirmacao-favorito #btn-confirmar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Animação de saída */
@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.8); }
}

/* ===== TOAST DE FEEDBACK ===== */

/* Container de toast */
.toast-favorito {
  font-family: var(--font-family);
  user-select: none;
  pointer-events: none;
}

/* Toast de sucesso */
.toast-favorito.sucesso {
  background: linear-gradient(135deg, #f46f09, #ff7409);
  border-left: 4px solid #f46f09;
}

/* Toast de erro */
.toast-favorito.erro {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
  border-left: 4px solid #bd2130;
}

/* Animações melhoradas para toast */
@keyframes slideInRight {
  from { 
    transform: translateX(100%) translateZ(0); 
    opacity: 0; 
    filter: blur(2px);
  }
  to { 
    transform: translateX(0) translateZ(0); 
    opacity: 1; 
    filter: blur(0);
  }
}

@keyframes slideOutRight {
  from { 
    transform: translateX(0) translateZ(0); 
    opacity: 1; 
    filter: blur(0);
  }
  to { 
    transform: translateX(100%) translateZ(0); 
    opacity: 0; 
    filter: blur(2px);
  }
}

/* ===== TOASTS DE FAVORITOS POSICIONADOS ===== */

/* Garantir que toasts de favoritos tenham prioridade máxima e sejam sempre visíveis */
.buskpe-toast-favorito,
.buskpe-toast-erro {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", var(--font-family) !important;
  user-select: none !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  contain: layout style !important;
  will-change: transform, opacity !important;
  z-index: 16000 !important; /* Maior que qualquer outro elemento */
}

/* Garantir que toasts não sejam afetados por transformações de containers pais */
.buskpe-toast-favorito,
.buskpe-toast-erro {
  position: absolute !important;
  isolation: isolate !important;
  transform-style: flat !important;
}

/* Estilos específicos para toasts de sucesso */
.buskpe-toast-favorito {
  background: linear-gradient(135deg, #f46f09 0%, #ff7409 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

/* Estilos específicos para toasts de erro */
.buskpe-toast-erro {
  background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

/* Responsividade específica para toasts */
@media (max-width: 768px) {
  .buskpe-toast-favorito,
  .buskpe-toast-erro {
    max-width: calc(100vw - 40px) !important;
    min-width: 220px !important; /* Aumentado para acomodar texto */
    font-size: 13px !important;
    padding: 12px 16px !important;
    border-radius: 30px !important;
  }
}

@media (max-width: 480px) {
  .buskpe-toast-favorito,
  .buskpe-toast-erro {
    max-width: calc(100vw - 20px) !important;
    min-width: 200px !important; /* Aumentado para acomodar texto */
    font-size: 12px !important;
    padding: 10px 14px !important;
    border-radius: 30px !important;
  }
}

/* Garantir que toasts funcionem com smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
  .buskpe-toast-favorito,
  .buskpe-toast-erro {
    transition: none !important; /* Evitar conflitos com animações CSS */
  }
}

/* ===== MELHORIAS NO POSICIONAMENTO DE CARDS PARA TOASTS ===== */

/* Garantir que cards tenham position relative para cálculos de posição corretos */
.anuncio-card,
.card {
  position: relative;
}

/* Espaço adicional abaixo dos cards para toasts */
.anuncio-card {
  margin-bottom: 20px; /* Espaço para toasts aparecerem sem sobreposição */
}

/* Em grids, garantir espaçamento adequado */
#listaAnuncios {
  gap: 10px; /* Aumentar gap para acomodar toasts */
}

/* Ajustes responsivos */
@media (max-width: 768px) {
  .anuncio-card {
    margin-bottom: 15px;
  }
  
  #listaAnuncios {
    gap: 15px;
  }
}

/* ===== TOASTS DE FAVORITOS CENTRALIZADOS ===== */

/* Toast de sucesso (favorito adicionado/removido) */
.buskpe-toast-favorito {
  position: absolute !important;
  z-index: 20000 !important;
  pointer-events: none !important;
  border-radius: 30px !important;
  font-weight: 600 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  user-select: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

/* Toast de erro */
.buskpe-toast-erro {
  position: absolute !important;
  z-index: 20000 !important;
  pointer-events: none !important;
  border-radius: 30px !important;
  font-weight: 600 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  user-select: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

/* Garantir que cards tenham posição relativa para toasts funcionarem */
.anuncio-card {
  position: relative !important;
}

/* Animações específicas para toasts centralizados */
@keyframes toastFadeInScale {
  0% { 
    transform: scale(0.8); 
    opacity: 0; 
  }
  100% { 
    transform: scale(1); 
    opacity: 1; 
  }
}

@keyframes toastFadeOutScale {
  0% { 
    transform: scale(1); 
    opacity: 1; 
  }
  100% { 
    transform: scale(0.8); 
    opacity: 0; 
  }
}

/* Responsivo para toasts */
@media (max-width: 768px) {
  .buskpe-toast-favorito,
  .buskpe-toast-erro {
    width: 160px !important;
    height: 35px !important;
    font-size: 11px !important;
    padding: 8px 12px !important;
  }
}

@media (max-width: 480px) {
  .buskpe-toast-favorito,
  .buskpe-toast-erro {
    width: 140px !important;
    height: 30px !important;
    font-size: 10px !important;
    padding: 6px 10px !important;
  }
}

/* ===== MODAL DE CONFIRMAÇÃO DE FAVORITOS POSICIONADO ===== */

/* Modal de confirmação centralizado no card */
#modal-confirmacao-favorito {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", var(--font-family) !important;
  user-select: none !important;
  z-index: 25000 !important; /* Maior prioridade que toasts */
}

/* Conteúdo do modal de confirmação */
#modal-confirmacao-favorito > div {
  contain: layout style !important;
  will-change: transform, opacity !important;
  isolation: isolate !important;
}

/* Garantir que o modal seja sempre visível */
#modal-confirmacao-favorito,
#modal-confirmacao-favorito * {
  pointer-events: auto !important;
}

/* Estilos específicos dos botões do modal */
#modal-confirmacao-favorito #btn-cancelar,
#modal-confirmacao-favorito #btn-confirmar {
  font-family: inherit !important;
  outline: none !important;
  border: none !important;
  cursor: pointer !important;
  user-select: none !important;
}

/* Estados de hover mais sutis para mobile */
@media (hover: hover) {
  #modal-confirmacao-favorito #btn-cancelar:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    transform: translateY(-1px) !important;
  }
  
  #modal-confirmacao-favorito #btn-confirmar:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    border-color: #bd2130 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4) !important;
  }
}

/* Estados de foco para acessibilidade */
#modal-confirmacao-favorito #btn-cancelar:focus,
#modal-confirmacao-favorito #btn-confirmar:focus {
  outline: 2px solid #007bff !important;
  outline-offset: 2px !important;
}

/* Responsividade específica do modal de confirmação */
@media (max-width: 768px) {
  #modal-confirmacao-favorito > div {
    max-width: calc(100vw - 40px) !important;
    width: calc(100vw - 40px) !important;
    padding: 25px 20px !important;
    margin: 20px !important;
  }
  
  #modal-confirmacao-favorito #btn-cancelar,
  #modal-confirmacao-favorito #btn-confirmar {
    min-width: 100px !important;
    padding: 12px 20px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 480px) {
  #modal-confirmacao-favorito > div {
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    padding: 20px 15px !important;
    margin: 10px !important;
    font-size: 13px !important;
  }
  
  #modal-confirmacao-favorito #btn-cancelar,
  #modal-confirmacao-favorito #btn-confirmar {
    min-width: 90px !important;
    padding: 10px 16px !important;
    font-size: 12px !important;
    flex: 1 !important;
  }
  
  #modal-confirmacao-favorito h3 {
    font-size: 18px !important;
  }
  
  #modal-confirmacao-favorito p {
    font-size: 13px !important;
  }
}

/* Animações específicas do modal de confirmação */
@keyframes modalConfirmacaoFadeIn {
  from { 
    opacity: 0; 
    backdrop-filter: blur(0px); 
  }
  to { 
    opacity: 1; 
    backdrop-filter: blur(4px); 
  }
}

@keyframes modalConfirmacaoSlideIn {
  0% { 
    transform: scale(0.7) translateY(-30px); 
    opacity: 0; 
  }
  100% { 
    transform: scale(1) translateY(0); 
    opacity: 1; 
  }
}

/* Estilos para animações de favoritos */
@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.8); }
}

/* Grid responsivo para favoritos */
.anuncios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  padding: 0;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .anuncios-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ===== ANIMAÇÕES DE SCROLL REVEAL ===== */

/* Estado inicial dos cards - invisíveis e deslocados */
.anuncio-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Estado quando card está visível */
.anuncio-card.card-visible {
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.01s ease !important, box-shadow 0.01s ease !important,
              border 0.01s ease !important, opacity 0.6s ease-out !important;
}

/* CORREÇÃO: Hover funcional para cards com animação scroll reveal */
.anuncio-card.card-visible:hover,
.anuncio-card:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 25px rgba(241, 135, 25, 0.3) !important;
  border: 1px solid #f18719 !important;
  z-index: 2;
}

/* Variações de animação - slide from left */
.anuncio-card.fade-left {
  transform: translateX(-30px) translateY(20px);
}

.anuncio-card.fade-left.card-visible {
  transform: translateX(0) translateY(0);
}

/* Variações de animação - slide from right */
.anuncio-card.fade-right {
  transform: translateX(30px) translateY(20px);
}

.anuncio-card.fade-right.card-visible {
  transform: translateX(0) translateY(0);
}

/* Animação de scale */
.anuncio-card.fade-scale {
  transform: scale(0.9) translateY(20px);
}

.anuncio-card.fade-scale.card-visible {
  transform: scale(1) translateY(0);
}

/* Delays escalonados para criar efeito cascata */
.anuncio-card.stagger-1 {
  transition-delay: 0.1s;
}

.anuncio-card.stagger-2 {
  transition-delay: 0.2s;
}

.anuncio-card.stagger-3 {
  transition-delay: 0.3s;
}


/* Animação especial para cards de anúncio Google AdSense */
.anuncio-card-adsense {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.anuncio-card-adsense.card-visible {
  opacity: 1;
  transform: scale(1);
}

/* Desabilitar animações para usuários com preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .anuncio-card,
  .anuncio-card-adsense {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  .anuncio-card.card-visible,
  .anuncio-card-adsense.card-visible {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Responsividade das animações */
@media (max-width: 768px) {
  /* Em mobile, animações mais sutis */
  .anuncio-card {
    transform: translateY(20px);
    transition-duration: 0.4s;
  }
  
  .anuncio-card.fade-left,
  .anuncio-card.fade-right {
    transform: translateY(20px); /* Sem movimento horizontal em mobile */
  }
  
  /* Sem delays em mobile para carregamento mais rápido */
  .anuncio-card.stagger-1,
  .anuncio-card.stagger-2,
  .anuncio-card.stagger-3 {
    transition-delay: 0s;
  }
}

/* Loading skeleton para cards que ainda estão carregando */
.anuncio-card.loading-extra {
  opacity: 1 !important;
  transform: none !important;
}

.anuncio-card.loading-extra .skeleton-loader {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
