/* Reset básico */
html, body {
  height: 100%;
   /* overflow: hidden;Impede o refresh via body */
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
}
#scroll-wrapper {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Suporte fluido no iOS */
  /*overscroll-behavior-y: contain;  Evita refresh no Android */
}
body {
  margin: 0;
  padding: 10px 20px; /* Reduzi o padding vertical de 20px para 10px */
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}
.titulo-container h2,
.description-titulo h3,
.modal h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #000000;
}
/* Oculta o logo mobile por padrão */
.logo-mobile, .mobile-header {
  display: none;
}
/* Container principal adaptável */
#container {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  grid-auto-rows: 100px;
  background-color: #ffffff;
  width: 100%;
  max-width: 100vw;
  height: auto;
  position: relative;
  margin: 0 auto;
}

/* Tiles */
.tile {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  position: relative;
}
/*
.tile:nth-child(odd) {
  background-color: #e6e6d2;
}
.tile:nth-child(even) {
  background-color: #dcd5a6;
} */

.overlay-image { 
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain; /* Mantém a proporção */
  border-radius: 8px;
  pointer-events: none;
}



.sold-overlay {
  z-index: 1;
}
/* Modal (tela inteira) */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-content {
  background-color: #fff;
  padding: 10px;
  border-radius: 12px;
  max-width: 90vw;
  width: 800px;
  height: 90vh;
  max-height: 600px;
  display: grid;
  grid-template-rows: auto auto auto;
  position: relative;
  overflow: hidden;
}

/* Modal Layout - Colunas */
.modal-columns {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
}

/* Colunas */
.modal-col {
  display: flex;
  flex-direction: column;
  flex: 1; /* Isso é a chave: faz ambas as colunas crescerem igualmente a partir da mesma base */
  min-width: 250px; /* Largura mínima para evitar que fiquem muito estreitas */
}


#modal-livro .modal-col-right {
  display: flex;
  flex-direction: column;
}

.modal-col-left .titulo-container {
  background-color: #dcd5a6;
  border-radius: 5px;
  padding: 15px 12px; /* Aumentei o padding vertical de 2px para 15px */
  margin-bottom: 5px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  height: auto; /* Mudei de 80px fixos para altura automática */
  min-height: 90px; /* Altura mínima para garantir espaço */
  display: flex;
  justify-content: center; /* Centraliza horizontalmente */
  align-items: center;     /* Centraliza verticalmente */
}
.modal-col-left .titulo-container h2 {
  font-size: 1.2rem; /* antes era muito grande */
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: #000000;
  word-break: break-word;
}

/* Container das especificações (pai de peso e estado) */
.specs {
  display: flex;
  flex-direction: column;
}

/* Box do Peso (altura fixa) */
.peso {
  height:50px;
  background: #e6e6d2;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  display: flex;
  align-items: center; /* Centraliza verticalmente */
  box-sizing: border-box;
  flex-shrink: 0; /* Impede que diminua */
   display:flex;
  text-align: left;
  align-items: center;     /* Centraliza verticalmente */
  margin-bottom: 5px;
    margin-top: 5px;
}
/* Box do Estado (ocupa espaço restante) */
/* Container do Estado - mais compacto */


/* ESTILOS ESPECÍFICOS PARA MODAL DE LIVROS */
#modal-livro .modal-col-left .description-section {
  height: auto;
  min-height: 150px;
  max-height: 170px;
  overflow-y: auto;
  margin-top: 10px;
  margin-bottom: 10px;
  flex-grow: 1;
}

 .estado {
  height: auto;
  min-height: 120px;
  max-height: 250px;
  flex-grow: 1;
  margin-bottom: 10px;
     background: #e6e6d2;
}

#modal-livro .description-scroll {
  max-height: 150px;
  overflow-y: auto;
}

/* Ajuste para o texto do estado */
.estado span {
  display: block;
  word-break: break-word;
}

/* Carrossel */
.carousel {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  background-color: #f9f9f9;
  gap: 10px;
  
}
.carousel-container {
  width: 100%;
  max-width: 320px;
  height: auto;
}
.carousel img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
  transition: opacity 0.5s ease-in-out;
  opacity: 0;
}
.carousel img.active {
  display: block;
  opacity: 1;
}
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 15px;
  cursor: pointer;
  z-index: 10;
}
.carousel-control.prev { left: 0px; }
.carousel-control.next { right: 0px; }

/* Descrição */
.description-section {
  background: #e6e6d2;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  height: auto;
  text-align: justify;
  height:400px;
}

.description-scroll {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 10px;
}
.description-titulo {
  color: #000000;
  font-size: 1.1rem;
  margin-top: -10px;
  border-bottom: 1px dashed #d0d0d0;
}

/* Rodapé */
.modal-footer {
  border-top: 1px solid #eee;
  padding-top: 20px;
}

/* Fechar modal */
.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ff4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
  z-index: 1001;
}
.close-modal:hover {
  background-color: #cc0000;
}

/* Azulejo vazio */
.tile.empty {
  background-color: #f9f9f9;
  border: 1px dashed #ccc;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile.empty::after {
  opacity: 0.7;
  font-size: 14px;
  color: #666;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

/* Responsividade */
@media (max-width: 768px) {
  .modal-columns {
    flex-direction: column;
    display: block !important;
  }
 .logo-mobile {
    display: block;
    text-align: center;
    margin: 0 auto;
    padding: 0px 0;
      width: auto;
  height: auto;
  max-width: none;
  }
  .logo-mobile img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none;
  display: inline-block;
  }

  .carousel {
    height: 250px;
  }
  .modal-content {
    height: auto;
    max-height: 95vh;
    overflow-y: auto;
  }
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #fff;
}
.header-icon {
  width: auto;
  height: auto;
  cursor: pointer;
}
.header-logo {
  height: auto;
}
}

.modal-informativo {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}
.modal-conteudo {
  background: #fff;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  border-radius: 10px;
  text-align: left;
}
.modal-informativo.show {
  display: flex;
}

.close-info {
  background: none;
  border: none;
  font-size: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  color: #0077cc;
}
/* Estilos específicos para o modal de livros */
.dimensoes {
  height: 50px;
  background: #e6e6d2;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  margin-bottom: 5px;
}

.description-section p {
  margin: 8px 0;
}
/* Remover ou modificar estas regras problemáticas
.tile:nth-child(odd) {
  background-color: #e6e6d2;
}
.tile:nth-child(even) {
  background-color: #dcd5a6;
}
*/
/* Adicionar estas novas regras */
.tile {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.tile-background {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  z-index: 1;
}

.tile-background.odd {
  background-color: #e6e6d2;
}

.tile-background.even {
  background-color: #dcd5a6;
}

.tile-image {
  max-width: 80px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  z-index: 2;
  position: relative;
}

.tile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  object-fit: contain;
 /* background-color: rgba(0, 0, 0, 1); /* Fundo preto com 30% de opacidade */
  border-radius: 8px;
}
.tile-image {
  pointer-events: none !important;
}

.tile-overlay {
  pointer-events: none !important;
}

.tile {
  cursor: pointer;
  position: relative;
}

/* Garantir que o tile seja clicável */
.tile > * {
  pointer-events: none;
}

/* Mas os botões do carousel precisam manter pointer-events */
.carousel-control {
  pointer-events: auto !important;
}


