/* ============================
   ESTILOS GERAIS
============================ */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  color: #2a2a2a;
  background-color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-weight: 700;
  margin: 0.5rem 0;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================
   CONTAINER PRINCIPAL
============================ */
.pagina-produto {
  padding: 1rem;
  max-width: 1200px;
  margin: auto;
}

.product-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

/* ============================
   SEÇÃO DE IMAGENS
============================ */
.product-images {
  flex: 1 1 40%;
  min-width: 280px;
  max-width: 500px;
}

.imagem-container {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  margin-right: 4.5rem;
  margin-left: 1rem;
}

.thumbnails-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 450px;
  overflow-y: auto;
}

.thumbnail-container {
  position: relative;
}

.thumbnail {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: border 0.3s;
}

.thumbnail.active,
.thumbnail:hover {
  border: 2px solid #007bff;
}

.main-image-container {
  flex: 1;
  text-align: center;
  cursor: zoom-in;
}


/* ============================
   MODAL DE IMAGEM
============================ */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.452);
}

.modal-content {
  display: block;
  max-width: 80%;
  max-height: 80%;
  margin: auto;
}

.close {
  position: absolute;
  top: 20px; right: 35px;
  font-size: 40px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}

/* ============================
   INFORMAÇÕES DO PRODUTO
============================ */
.product-info {
  flex: 1 1 50%;
  min-width: 300px;
  
}

.SKU {
  font-size: 0.9rem;
  color: #555;
}

.product-title {
  font-size: 1.8rem;
  margin: 0.5rem 0;
  margin-left: 0.5rem;
  margin-right: 4rem;
}

.product-meta {
  font-size: 0.95rem;
  color: #777;
}

.promo-badge {
  color: #e63946;
  font-weight: bold;
}

.product-description,
.product-description-full {
  font-size: 0.7rem;
  margin: 2rem 0;
  word-break: break-word;
  overflow-wrap: break-word;
  margin-right: 4rem;
  margin-left: 0.5rem;
}

/* ============================
   PREÇOS
============================ */
.product-price {
  font-size: 1.5rem;
  margin: 1rem 0;
}

.preco-antigo {
  text-decoration: line-through;
  color: #999;
  margin-right: 0.5rem;
}

.preco-formatado {
  color: #28a745;
  font-weight: bold;
}

.preco-sob-consulta {
  color: #ff9800;
  font-style: italic;
}


/* ============================
   SELLOS DE CONFIANÇA
============================ */
.product-trust-seals {
  display: flex;
  flex-wrap: wrap; /* permite quebrar linha em telas pequenas */
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-weight: 300;
  color: #2a2a2a;
  font-size: 0.9rem; /* tamanho legível */
  margin-right: 1rem;
  margin-left: 0.5rem;
}

.product-trust-seals div {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Responsividade: telas até 480px (mobile) */
@media (max-width: 480px) {
  .product-trust-seals {
    flex-direction: column; /* empilha os selos */
    align-items: flex-start; /* alinha à esquerda */
    margin-right: 0; 
    font-size: 0.85rem; /* levemente menor */
    gap: 0.4rem;
  }

  .product-trust-seals div {
    gap: 0.2rem;
  }
}

/* ============================
   SUGESTÕES / MAIS VISITADOS
============================ */
.sugestoes-grid,
.mais-visitados-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1rem;
  margin-right: 1.5rem;
}

.sugestao-item, 
.mais-visitado-item {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

.sugestao-item:hover,
.mais-visitado-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sugestao-imagem-container,
.mais-visitado-imagem-container {
  width: 100%;
  padding-top: 100%; /* Mantém proporção quadrada */
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.sugestao-imagem,
.mais-visitado-imagem {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sugestao-info,
.mais-visitado-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sugestao-nome,
.mais-visitado-nome {
  font-size: 1rem;
  margin: 0.5rem 0;
  line-height: 1.2;
  min-height: 2.4em; /* Mantém alinhamento */
}

.preco-original {
  font-size: 0.9rem;
  text-decoration: line-through;
  color: #999;
  margin-right: 0.5rem;
}

.preco-final {
  font-size: 1rem;
  color: #28a745;
  font-weight: bold;
}

.preco-consulta {
  font-style: italic;
  color: #ff9800;
}

/* ============================
   RESPONSIVO
============================ */

/* Tablets */
@media (max-width: 992px) {
  .sugestoes-grid,
  .mais-visitados-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .sugestao-nome,
  .mais-visitado-nome {
    font-size: 0.95rem;
  }

  .preco-final {
    font-size: 0.95rem;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .sugestoes-grid,
  .mais-visitados-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
  }

  .sugestao-item,
  .mais-visitado-item {
    padding: 0.8rem;
  }

  .sugestao-nome,
  .mais-visitado-nome {
    font-size: 0.9rem;
  }

  .preco-original,
  .preco-final {
    font-size: 0.85rem;
  }

  .preco-consulta {
    font-size: 0.85rem;
  }
}

/* Telas muito pequenas até 320px */
@media (max-width: 320px) {
  .sugestoes-grid,
  .mais-visitados-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .sugestao-item,
  .mais-visitado-item {
    padding: 0.6rem;
  }

  .sugestao-nome,
  .mais-visitado-nome {
    font-size: 0.85rem;
  }

  .preco-original,
  .preco-final,
  .preco-consulta {
    font-size: 0.8rem;
  }
}


/* ============================
   RESPONSIVIDADE
============================ */

/* Tablets / Large Mobile */
@media (max-width: 1024px) {
  .product-container {
    flex-direction: column;
    align-items: center;
  }
  .product-images,
  .product-info {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Medium Mobile */
@media (max-width: 768px) {
  .product-title {
    font-size: 1.5rem;
  }
  .btn-adicionar-carrinho,
  .btn-importar-lista {
    flex: 1;
    justify-content: center;
  }
}

/* Small Mobile */
@media (max-width: 320px) {
  .thumbnails-vertical {
    flex-direction: row;
    max-height: unset;
    overflow-x: auto;
  }
  .thumbnail {
    width: 60px;
    height: 60px;
  }
  .sugestoes-grid,
  .mais-visitados-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .modal-content {
    max-width: 95%;
    max-height: 95%;
  }
}

/* Extra Small Mobile */
@media (max-width: 320px) {
  body {
    font-size: 14px;
  }
  .product-title {
    font-size: 1.2rem;
  }
  .produto-card {
    flex-direction: column;
    gap: 0.8rem;
  }
  .btn-adicionar-carrinho,
  .btn-importar-lista {
    width: 30%;
    padding: 0.6rem;
  }
}
/* ===================== DESCRIÇÃO DO PRODUTO ===================== */
.product-description-full {
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    overflow-x: auto; /* evita quebrar layout caso tabela seja maior */
}

/* Ajuste para listas */
.product-description-full ul,
.product-description-full ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.product-description-full li {
    margin-bottom: 0.5rem;
}

/* Ajuste para tabelas */
.product-description-full table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    display: block;        /* força responsividade */
    overflow-x: auto;      /* adiciona scroll horizontal se necessário */
}

.product-description-full th,
.product-description-full td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.95rem;
    white-space: nowrap;   /* impede quebra esquisita dentro de células */
}

.product-description-full th {
    background: #f5f5f5;
    font-weight: bold;
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
    .product-description-full {
        font-size: 0.95rem;
    }
    .product-description-full table {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .product-description-full {
        font-size: 0.9rem;
    }
    .product-description-full table,
    .product-description-full th,
    .product-description-full td {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}
/* ============================
   AJUSTE FINO RESPONSIVO
============================ */

/* ============================
   ESCALA BASE
============================ */
body {
    font-size: 16px; /* base para scaling automático */
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }


/* ============================
   PREÇOS
============================ */
.product-price {
    font-size: 1.3rem;
    margin: 0.5rem 0;
}

/* ============================
   SUGESTÕES / MAIS VISITADOS
============================ */
.sugestoes-grid,
.mais-visitados-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

/* ============================
   MODAL DE IMAGEM
============================ */
.modal-content {
    max-width: 95%;
    max-height: 95%;
}

/* ============================
   RESPONSIVIDADE POR LARGURA
============================ */

/* Tablets e grandes smartphones */
@media (max-width: 1024px) {
    .product-container {
        flex-direction: column;
        align-items: center;
    }
}

/* Smartphones médios (Galaxy, iPhone Plus) */
@media (max-width: 768px) {
    .product-title { font-size: 1.4rem; }
    .product-price { font-size: 1.2rem; }
    .product-description-full { font-size: 0.95rem; }
}

/* Smartphones pequenos (Galaxy M53, iPhone SE) */
@media (max-width: 480px) {
    .product-title { font-size: 1.2rem; }
    .product-price { font-size: 1rem; }
    .product-description-full { font-size: 0.9rem; }
    .thumbnail { width: 50px; height: 50px; }
    .imagem-container { gap: 0.3rem; }
    .product-info { padding: 0.3rem; }
}

/* Smartphones extra pequenos (<360px) */
@media (max-width: 360px) {
    body { font-size: 14px; }
    .product-title { font-size: 1.1rem; }
    .product-description-full { font-size: 0.85rem; }
    .thumbnail { width: 45px; height: 45px; }
    .btn-adicionar-carrinho,
    .btn-importar-lista { padding: 0.4rem 0; font-size: 0.85rem; }
}


/* ==========================
   Formulário Carrinho & Botões
========================== */

/* Container do card do produto */
.produto-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

/* Input de quantidade */
.input-quantidade {
  width: 70px;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  text-align: center;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-quantidade:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
  outline: none;
}

/* Botão principal: Solicitar */
.btn-adicionar-carrinho {
  /* display: flex; */
  /* align-items: center; */
  gap: 0.1rem;
  padding: 0.55rem 1rem;
  background-color: #007bff;
  color: #fff;
  font-weight: 600;
  font-size: 1.5rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-adicionar-carrinho:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

/* Botão secundário: Importar CSV */
.btn-importar-lista {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.3rem;
  background-color: #6c757d;
  color: #fff;
  font-weight: 600;
  font-size: 0.7rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-importar-lista:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
}

/* Ícones nos botões */
.btn-adicionar-carrinho i,
.btn-importar-lista i {
  font-size: 0.8rem;
}

/* ==========================
   RESPONSIVIDADE
========================== */
@media (max-width: 668px) {
  .produto-card {
    flex-direction: column;
    align-items: stretch;
  }

  .input-quantidade {
    width: 40%;
  }

  .btn-adicionar-carrinho,
  .btn-importar-lista {
    width: 50%;
    justify-content: center;
  }
}
/* Estilo para link de datasheet */
.product-datasheet {
    margin-top: 15px;
    font-size: 16px;
}

.product-datasheet .separador {
    height: 1px;
    background-color: #e0e0e0;
    margin: 10px 0;
}

.datasheet-link {
    display: inline-block;
    margin-top: 5px;
    padding: 8px 15px;
    background-color: #ffd257; /* cor de destaque */
    color: 000000;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
}

.datasheet-link:hover,
.datasheet-link:focus {
    background-color: #ffbb00; /* hover mais escuro */
    transform: translateY(-2px);
    outline: none;
    color: #000000;
}
