/* ESTILOS GERAIS */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #00303f;
}

/* CABEÇALHO ATUALIZADO */
.header {
  text-align: center;
  padding: 40px 20px 20px;
  color: white;
  position: relative;
}
.header img.logo {
  width: 180px;
  border-radius: 50%;
  margin-bottom: 10px;
  /* Removida a borda preta */
  border: none;
}
.header h1 {
  margin: 10px 0 5px;
  font-size: 28px;
}
.header-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}
.header a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 15px;
  border-radius: 20px;
  transition: background 0.3s;
  height: 32px;
  box-sizing: border-box;
}
.header a:hover {
  background: rgba(255, 255, 255, 0.25);
}
.header a img.instagram-icon {
  width: 20px;
  height: 20px;
  /* Centraliza o ícone verticalmente */
  vertical-align: middle;
  /* Remove qualquer borda */
  border: none;
  margin-right: 6px;
}

/* CARROSSEL */
.carousel-container {
  max-width: 1000px;
  margin: 30px auto;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  height: 400px;
  background: #00303f;
}
.carousel {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}
.carousel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #00303f;
  flex-shrink: 0;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 15px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  font-size: 18px;
  transition: background 0.3s, opacity 0.3s;
}
.carousel-btn:hover {
  background: rgba(0,0,0,0.8);
  opacity: 0.9;
}
.carousel-btn.prev {
  left: 10px;
}
.carousel-btn.next {
  right: 10px;
}
.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s;
}
.carousel-indicator.active {
  background: white;
}

/* CATÁLOGO DE PRODUTOS */
.catalog-page {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}
.product {
  display: flex;
  flex-direction: row;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.image-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}
.main-img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  background-color: #f5f5f5;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}
.main-img:hover {
  transform: scale(1.02);
}
.thumbnail-container {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.thumbnail-container:empty::after {
  content: "Sem miniaturas adicionais";
  color: #999;
  font-size: 12px;
  padding: 10px;
  text-align: center;
  display: block;
}
.thumbnail-container img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border: 1px solid #ccc;
  cursor: pointer;
  border-radius: 4px;
}
.thumbnail-container img:hover {
  border-color: #0077cc;
}
.product-details {
  padding: 60px 20px 20px 20px;
  flex: 1;
}
.product-details h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.product-details p {
  margin: 5px 0;
  color: #333;
}
.price {
  margin-top: 10px;
  font-weight: bold;
  color: #009688;
}

/* CONTROLES DE QUANTIDADE */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 10px 0;
}
.qty-btn {
  width: 25px;
  height: 25px;
  border: none;
  background: #0077cc;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}
.qty-btn:hover {
  background: #005fa3;
}
.quantity {
  width: 40px;
  text-align: center;
}

/* MODAL DE IMAGEM */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Modificado para pan */
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  position: relative; /* Necessário para posicionar a imagem se usarmos left/top */
  width: 100%; /* Ocupa toda a área do modal para referência de pan */
  height: 100%;
  display: flex; /* Para centralizar a imagem */
  align-items: center;
  justify-content: center;
  /* overflow: hidden; */ /* O overflow principal é no .modal */
}

.modal-content img {
  display: block; /* Para evitar espaço extra */
  /* max-width e max-height removidos para permitir que a imagem seja maior que a viewport para o pan */
  /* A centralização e o dimensionamento inicial são feitos por object-fit e transform */
  object-fit: contain; /* Mantém o aspect ratio inicial */
  transform-origin: center center;
  /* A transição será controlada via JS para não afetar o pan */
  /* transition: transform 0.3s ease; */ 
  cursor: default; /* Cursor padrão, mudará para grab/grabbing com JS */
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100;
}
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 15px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  font-size: 18px;
  transition: background 0.3s, opacity 0.3s;
}
.modal-nav:hover {
  background: rgba(0,0,0,0.8);
  opacity: 0.9;
}
.modal-prev {
  left: 20px;
}
.modal-next {
  right: 20px;
}

/* CONTROLES DE ZOOM */
.zoom-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 5px;
  display: flex;
  gap: 5px;
  z-index: 10000;
}
.zoom-controls button {
  background: #fff;
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
}
.zoom-controls button:hover {
  background: #ddd;
  transform: scale(1.05);
}

/* BOTÃO VOLTAR AO TOPO */
#backToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background-color: #0077cc;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 30px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: none;
}
#backToTopBtn:hover {
  background-color: #005fa3;
}

/* PAINEL DE INTERESSES */
#interestPanel {
  display: none; /* Inicialmente oculto */
  position: fixed;
  right: 30px;
  bottom: 80px;
  background: white;
  border-radius: 10px;
  max-width: 300px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  z-index: 1001;
  max-height: 70vh; /* Altura máxima do painel */
  
  /* Layout flexível para organizar título, lista e botão */
  display: flex;
  flex-direction: column;
  padding: 20px; /* Espaçamento interno */
  box-sizing: border-box; /* Para que o padding não aumente a largura/altura total além de max-width/max-height */
}
#interestPanel {
    /* ... seus estilos existentes para #interestPanel ... */
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    opacity: 1;
    visibility: visible;
}

#interestPanel.hidden-fade {
    opacity: 0;
    visibility: hidden;
}

#interestPanel h3 {
  margin-top: 0;
  margin-bottom: 15px; /* Espaço abaixo do título */
  flex-shrink: 0; /* Não encolher o título */
  color: #333; /* Cor do título */
  font-size: 1.2em; /* Tamanho do título */
}

#interestList {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0; /* Margem abaixo da lista, antes do botão */
  overflow-y: auto;   /* Habilita a rolagem vertical para a lista */
  flex-grow: 1;       /* Faz a lista ocupar o espaço vertical disponível */
  min-height: 30px; /* Altura mínima para a lista não sumir se vazia e o painel estiver visível */
  border-top: 1px solid #eee; /* Separador opcional */
  border-bottom: 1px solid #eee; /* Separador opcional */
  padding-top: 10px; /* Espaçamento interno superior para a lista */
  padding-bottom: 10px; /* Espaçamento interno inferior para a lista */
}

#interestList li {
  padding: 8px 5px; /* Ajustar padding dos itens da lista */
  border-bottom: 1px solid #f0f0f0; /* Borda mais suave */
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9em; /* Tamanho da fonte dos itens */
}

#interestList li:last-child {
  border-bottom: none;
}

/* Botão remover dentro do item da lista */
#interestList li button { 
  margin-left: 10px;
  background: #ff4d4d;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  padding: 4px 8px; 
  font-size: 0.9em;
  flex-shrink: 0;
}
#interestList li button:hover {
  background: #e03c3c;
}

/* Estilo para o botão Enviar Interesses (principal do painel) */
#interestPanel > button[onclick*="showContactModal"] {
  padding: 12px 15px; /* Aumentar um pouco o padding para melhor clique */
  background: #0077cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 100%; 
  box-sizing: border-box;
  margin-top: auto; /* Garante que ele fique no final se houver espaço após a lista */
  flex-shrink: 0; 
  font-weight: bold;
  text-align: center;
  font-size: 1em;
}

#interestPanel > button[onclick*="showContactModal"]:hover {
  background: #005fa3;
}

/* BOTÃO DE INTERESSES */
.interest-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 1000;
  background-color: #28a745;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 30px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background 0.3s, transform 0.2s;
}
.interest-btn:hover {
  background: #218838;
  transform: scale(1.05);
}

/* MODAL DE CONTATO */
.contact-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
}

.contact-modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh; /* Altura máxima do modal */
  overflow-y: auto; /* Permite rolagem do conteúdo do modal se exceder max-height */
  box-sizing: border-box;
}

.contact-modal-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #0057b7;
}

.contact-modal-content label {
  display: block;
  margin: 10px 0 5px;
}

.contact-modal-content input,
.contact-modal-content textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Estilo específico para o botão de submit do formulário de contato */
#contactForm button[type="submit"] {
  background-color: #0057b7;
  color: white;
  border: none;
  padding: 12px 15px;
  margin-top: 20px; /* Espaço acima do botão */
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  width: 100%; 
  box-sizing: border-box;
  font-weight: bold;
  text-align: center;
  font-size: 1em;

  position: sticky;
  bottom: 0; /* Gruda no final do .contact-modal-content quando este rola */
  /* O fundo precisa ser opaco para cobrir o conteúdo que rola por baixo */
  /* Usa uma cor ligeiramente diferente ou a mesma do modal para consistência */
  background: #f0f0f0; /* Um cinza claro para se destacar um pouco do conteúdo branco */
  color: #0057b7; /* Cor do texto do botão para combinar com o tema */
  border-top: 1px solid #ccc; /* Linha sutil para separar do conteúdo rolável */
  /* O padding de 20px do .contact-modal-content já cria um espaço abaixo do botão sticky */
  /* Se o botão estiver no final do HTML do modal, ele ficará no final da área de rolagem. */
  /* O padding-bottom do .contact-modal-content garante que haja espaço abaixo do botão quando o conteúdo é curto. */
  /* Quando o conteúdo é longo e rola, o botão fica sticky no bottom:0 da viewport do .contact-modal-content. */
}

#contactForm button[type="submit"]:hover {
  background-color: #005fa3; /* Cor de hover original */
  color: white; /* Texto branco no hover */
  transform: scale(1.02);
}

.close-contact {
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.form-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.items-summary {
  max-height: 150px; /* A lista de itens já é rolável se muitos itens */
  overflow-y: auto;
  padding: 10px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
}

.items-summary div {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.items-summary div:last-child {
  border-bottom: none;
}

.items-summary strong {
  display: inline-block;
  min-width: 50px;
}

/* LOADER */
.loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #0057b7;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: none;
}

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

/* RESPONSIVIDADE */
@media (max-width: 768px) {
  .product {
    flex-direction: column;
    align-items: center;
  }
  .product-details {
    max-width: 100%;
  }
  .carousel-container {
    height: 250px;
  }
  .modal-nav {
    padding: 10px;
    font-size: 16px;
  }
  .zoom-controls {
    bottom: 10px;
  }
  #interestPanel {
    right: 10px;
    bottom: 70px;
    max-width: 280px;
  }
  .contact-modal-content {
    margin: 10% auto;
    width: 95%;
  }
}

