/* Modal de Comparação */
.modal-comparacao {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-in-out;
}

#oferta,
#mecanica,
#itens-serie {
  scroll-margin-top: 350px;
}

.btn-atalho {
  border-radius: 8px;
  background: #005dff;
  display: flex;
  padding: 8px 10px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: #fff;
  border-color: transparent;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-comparacao-conteudo {
  background-color: #fff;
  margin: 0 0 0 auto;
  padding: 30px;
  border: 1px solid #888;
  width: 90%;
  max-width: 1350px;
  border-radius: 8px;
  max-height: 101%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideFromRight 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#conteudoComparacao {
  overflow-y: auto;
  overflow-x: auto;
  width: 100%;
  height: calc(100vh - 140px);
}

@keyframes slideFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.modal-comparacao-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
}

.modal-comparacao-header h2 {
  margin: 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

/* Tabela de Comparação */
.tabela-comparacao {
  width: 100%;
  background-color: #fff;
  border-collapse: separate;
}

.tabela-comparacao thead {
  background-color: #f9f9f9;
}

.tabela-comparacao thead td {
  top: 0;
  background-color: #f9f9f9;
}

.info-veiculo-comparacao {
  position: sticky;
  top: 0;
  z-index: 10;
}

.tabela-comparacao th,
.tabela-comparacao td {
  padding: 15px;
  text-align: left;
}

.label-pular:hover {
  background-color: #fff !important;
  cursor: default;
}

.label-pular {
  height: 45px;
}

.tabela-comparacao tbody tr:nth-child(odd) {
  background-color: #e6efff;
}

.coluna-veiculo {
  vertical-align: top;
  padding: 0px 15px 20px 15px !important;
  background-color: #fff !important;
  display: table-cell; /* keep table layout */
  text-align: center !important;
  border-right: 1px solid #e9e9e9;
  border-bottom: 1px solid #e9e9e9;
  border-left: 1px solid #e9e9e9;
  background: #fff;
}

.coluna-veiculo:first-child {
  border: none;
}

.coluna-veiculo > * {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.coluna-veiculo:hover {
  background-color: #fff !important;
}

/* Wrapper keeps X button over the image */
.img-wrapper-comparacao {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

.btn-remover-comparacao {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  background-color: #dc3545;
  color: white;
  border-radius: 100px;
  width: 30px;
  height: 30px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  border: 1px solid #f5f7fc;
}

.btn-remover-comparacao:hover {
  background-color: #c82333;
}

.img-veiculo-comparacao {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 200px;
  border-radius: 4px;
}

.coluna-veiculo h5 {
  margin: 10px 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.versao-comparacao {
  margin: 5px 0;
  font-size: 13px;
  color: #666;
}

.oferta-comparacao {
  margin: 5px 0;
  font-size: 12px;
  color: #fff;
  background-color: #28a745;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-block;
}

.label-comparacao {
  font-weight: 600;
  color: #333;
  text-align: left;
  background-color: #fff;
  position: sticky;
  left: 0;
  z-index: 5;
}

tr:nth-child(odd) .label-comparacao {
  background-color: #e6efff !important;
}

tr:nth-child(even) .label-comparacao {
  background-color: #fff !important;
}

/* Botões de ação */
.modal-comparacao-botoes {
  display: flex;
  justify-content: center;
}

.btn-modal {
  padding: 10px 25px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-modal-fechar {
  background-color: #6c757d;
  color: white;
}

.btn-modal-fechar:hover {
  background-color: #5a6268;
}

.btn-modal-continuar {
  background-color: #005dff;
  color: white;
}

.btn-modal-continuar:hover {
  background-color: #0056b3;
}

.btn-ver-anuncio {
  display: flex;
  padding: 8px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 190px;
  height: 34px;
  margin: 8px auto 0 auto;
  color: #fff;
  border-radius: 8px;
  background: #005dff;
  cursor: pointer;
  border: none;
}

/*
.tem-opcional {
  background-color: #c0e7c9;
}

.nao-tem-opcional {
  background-color: #f8d7da;
}*/

.infoModal {
  font-weight: 600;
  color: black;
}

/* Animação favoritar */
@keyframes heartPop {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.55); }
  55%  { transform: scale(0.88); }
  80%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.heart-pop {
  animation: heartPop 0.45s ease;
}

/* Responsivo */
@media (max-width: 768px) {
  .modal-comparacao-conteudo {
    width: 95%;
    margin: 10% auto;
    padding: 15px;
  }

  th,
  td {
    border-right: 1px solid #e9e9e9;
    border-bottom: 1px solid #e9e9e9;
    border-left: 1px solid #e9e9e9;
  }

  .modal-comparacao-header {
    flex-direction: column !important;
    justify-content: normal !important;
    align-items: flex-start !important;
  }

  .coluna-veiculo:first-child {
      border-right: 1px solid #e9e9e9 !important;
      border-bottom: 1px solid #e9e9e9 !important;
      border-left: 1px solid #e9e9e9 !important;
  }

  .desktopinfo {
    display: none !important;
  }

  .m-infoModal {
    font-size: 11px;
    font-weight: 600;
    color: black;
  }

  .voltar {
    font-size: 14px;
    font-weight: 600;
    color: black;
  }

  .mobileinfo {
    display: flex !important;
  }

  .modal-comparacao-header h2 {
    font-size: 18px;
  }

  .tabela-comparacao th,
  .tabela-comparacao td {
    padding: 10px 5px;
    font-size: 12px;
  }

  .img-veiculo-comparacao {
    max-height: 150px;
  }

  .coluna-veiculo h5 {
    font-size: 14px;
  }

  .modal-comparacao-header {
      margin-bottom: 0px !important;
  }

}
