:root {
  --cor0: #001B40;
  --cor1: #0056B3;
  --cor2: #007BFF;
  --cor3: #AD2D01;
  --cor4: #F24405;
  --cor5: #f35b04;  
  --cor6: #f5f7fa;
  --cor6-alt: #f0f2f5;
  --cor7: #31393c;  

  --branco: #fff;
  --preto: #000;
  --texto-principal: #1a1a1a;
  --texto-suave: #333;
  --fundo-transparente-claro: rgba(255, 255, 255, 0.13);
  --sombra-leve: rgba(0, 0, 0, 0.15);
}

/* Reset Básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0; /* REMOVIDO: margin-top fixo, será ajustado via JS */
  padding: 0;
  min-height: 100vh; 
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--texto-suave);
  background-color: var(--fundo-transparente-claro);
  overflow-x: hidden; 
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 2rem); 
  /* IMPORTANTE: O padding-top será adicionado dinamicamente via JavaScript */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--cor2);
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--branco);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  color: var(--cor1);
  line-height: 1.2;
  margin-bottom: 0.75em;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p, li, label, input, textarea, button {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--texto-suave);
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2em;
  background: rgba(223, 223, 223, 0.459);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

header.scrolled {
  background-color: var(--cor0); 
}

/* Estilos para o estado 'scrolled' */
header.scrolled #botao-carrinho-mobile i {
  color: var(--branco); 
}

header.scrolled #botao-carrinho-mobile {
  background: none; 
}

header.scrolled #botao-carrinho-mobile .cart-badge {
  background-color: var(--cor5); 
  color: var(--branco); 
}

header.scrolled #menu-toggle .hamburger {
  background-color: var(--branco); 
}


/* Menu Toggle (Hamburger) */
#menu-toggle {
  display: none; 
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001; 
  width: 30px;
  height: 20px;
  padding: 0;
}

.hamburger {
  display: block;
  width: 100%;
  height: 3px;
  margin: 5px 0;
  background: var(--cor1);
  transition: transform 0.3s ease, opacity 0.1s ease;
  position: absolute; 
  left: 0;
}

.hamburger:nth-child(1) { top: 0; }
.hamburger:nth-child(2) { top: 8px; }
.hamburger:nth-child(3) { top: 16px; }

#menu-toggle.active .hamburger:nth-child(1) { top: 8px; transform: rotate(45deg); }
#menu-toggle.active .hamburger:nth-child(2) { opacity: 0; }
#menu-toggle.active .hamburger:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* Navegação Principal */
nav#top-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0;
  background: transparent;
  margin: 0 auto; 
}

nav#top-menu ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav#top-menu li {
  padding: 0.5rem 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

nav#top-menu li a {
  color: var(--cor1); 
  text-decoration: none;
  position: relative;
  z-index: 1;
  transition: color 0.3s ease; 
}

nav#top-menu li::before {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--cor1); 
  transition: width 0.3s ease, left 0.3s ease;
  z-index: 0;
}

nav#top-menu li:hover::before {
  width: 100%;
  left: 0;
}

header.scrolled nav#top-menu li a { color: var(--branco); }
header.scrolled nav#top-menu li::before { background-color: var(--branco); }

nav#top-menu li:hover {
  border-radius: 50px;
  transform: scale(1.1);
  transition: all 0.3s ease;
}

/* Botão CTA */
.cta {
  background: var(--cor4);
  color: var(--branco);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s; 
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.cta:hover {
  background: #006618;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Visibilidade de elementos por dispositivo */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* Ícone do Carrinho (Mobile) */
#botao-carrinho-mobile {
  display: none; 
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.8rem;
  color: var(--cor1); 
  position: absolute; 
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  z-index: 1001;
  padding: 0;
  transition: color 0.3s ease; 
}

#botao-carrinho-mobile .cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--cor5);
  color: var(--branco);
  border-radius: 50%;
  padding: 0.2em 0.5em;
  font-size: 0.7rem;
  font-weight: bold;
  line-height: 1;
  min-width: 20px;
  text-align: center;
}

/* Catálogo */
.catalog h1 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.catalog-intro {
  max-width: 600px; 
  margin: 0 auto 2rem auto; 
  font-size: clamp(1rem, 2.5vw, 1.2rem); 
  line-height: 1.5; 
  color: var(--cor0); 
  text-align: center; 
}

/* Filtros */
.filters {
  margin-bottom: 2rem;
}

.filters h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 1rem;
  color: var(--texto-principal);
  text-align: center;
}

.filters form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--texto-suave);
  justify-content: center;
}

.filters label {
  font-weight: bold;
  color: var(--texto-suave);
}

.filters select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  min-width: 150px;
}

/* Estilos para os novos campos de filtro (pesquisa e ordenação) */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start; 
}

.filter-group input[type="text"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  min-width: 200px; 
}


/* Imagem da Categoria Filtrada */
.category-image {
  display: flex;
  justify-content: center; 
  align-items: center; 
  width: 100%; 
  margin: 1rem 0 2rem; 
}

.category-image img {
  max-width: 300px; 
  width: 100%; 
  height: auto;
  border-radius: 8px; 
}

.category-image.hidden {
    display: none;
}

/* Grade de Produtos */
.grade-produtos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.cartao-produto {
  background: var(--branco);
  border: 1px solid var(--cor6-alt);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
  padding: 0.75rem;
  max-width: 300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cartao-produto:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cartao-produto img {
  max-width: 90%;
  margin: 0 auto;
  border-bottom: 1px solid var(--cor6-alt);
  padding-bottom: 0.5rem;
}

.cartao-produto h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  margin: 0.5rem 0;
  color: var(--preto);
}

.cartao-produto p {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--cor5);
  margin-bottom: 0.75rem;
}

/* Estilos para o seletor de variação no cartão do produto */
.variation-selector-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.variation-selector-group label {
    font-weight: 600;
    color: var(--texto-suave);
    font-size: 0.9rem;
}

.variation-selector-group select {
    width: calc(100% - 1rem); /* Ajuste para preencher o espaço do cartão */
    max-width: 180px; /* Limita a largura */
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95rem;
    text-align: center;
}


.cartao-produto button,
.cartao-produto a {
  display: block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  margin: 0.3rem auto;
  text-decoration: none;
  width: calc(100% - 1rem); 
  max-width: 200px; 
}

.ver-detalhes {
  background: var(--cor1);
  color: var(--branco);
}

.ver-detalhes:hover {
  background: var(--cor2);
}

.contact-btn {
  background: var(--cor5);
  color: var(--branco);
  transition: 0.3s, transform 0.3s, box-shadow 0.3s; 
  font-weight: bold;
}

.contact-btn:hover {
  background: #006618;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Modals (Product Details & Cart) */
.modal {
  display: none; 
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.conteudo-modal {
  background: var(--branco);
  padding: 3rem;
  border-radius: 10px;
  max-width: 500px;
  max-height: 95vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.fechar-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--texto-suave);
  border: none;
  background: none;
  outline: none;
  padding: 0;
}

.fechar-btn:hover {
  color: var(--cor5);
}

#imagem-modal-produto {
  max-width: 60%;
  max-height: 50vh;
  height: auto;
  border-radius: 5px;
  margin-bottom: 1rem;
}

#titulo-modal-produto {
  color: var(--cor1);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#descricao-modal-produto {
  margin-bottom: 1.5rem;
  color: var(--texto-suave);
}

/* Novo estilo para o preço no modal */
#preco-modal-produto {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--cor5);
  margin-bottom: 1rem;
}

.conteudo-modal .contact-btn {
  text-decoration: none;
  background-color: var(--cor4);
  padding: 0.5em;
  border-radius: 20px;
}

/* Estilos para o alerta personalizado */
.custom-alert {
  /* Tailwind classes for positioning and initial styling */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #10B981; /* green-500 */
  color: white;
  padding: 1rem 2rem;
  border-radius: 0.5rem; /* rounded-lg */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* shadow-lg */
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  text-align: center;
  font-weight: 600;
}


/* Estilos Específicos do Carrinho (Página carrinho.html) */
.cart-page {
  background: var(--branco);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

.cart-page h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--cor1);
}

#itens-carrinho-pagina {
  margin-bottom: 2rem;
  border-top: 1px solid var(--cor6-alt);
  padding-top: 1.5rem;
}

.item-carrinho-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--cor6);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.item-carrinho-container img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 1rem;
  flex-shrink: 0;
}

.informacoes-item-carrinho {
  flex-grow: 1;
  text-align: left;
  min-width: 120px;
}

.informacoes-item-carrinho h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--preto);
  margin-bottom: 0.25rem;
}

.informacoes-item-carrinho p {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.acoes-item-carrinho {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  width: 100%;
  justify-content: flex-end;
}

.input-quantidade {
  width: 60px;
  padding: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  text-align: center;
  font-size: 0.9rem;
}

.remover-item-carrinho {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cor3);
  font-size: 1.5rem;
  transition: color 0.2s ease-in-out;
}

.remover-item-carrinho:hover {
  color: #EF4444;
}

.empty-cart-message {
  text-align: center;
  color: var(--texto-suave);
  font-style: italic;
  padding: 1rem;
}

.resumo-carrinho-pagina {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border-top: 1px solid var(--cor6-alt);
  padding-top: 1.5rem;
  gap: 1rem;
}

.texto-total-carrinho {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--texto-principal);
}

#total-carrinho-pagina {
  color: var(--cor5);
  font-size: 1.8rem;
}

/* Estilos específicos para o botão "Finalizar Pedido via WhatsApp" na página do carrinho */
#finalizar-whatsapp-btn-pagina {
  background-color: #25D366; 
  width: 100%;
  max-width: 300px;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  text-align: center;
  margin-top: 1rem;
  color: var(--branco); 
  border: none; 
  cursor: pointer; 
  text-decoration: none; 
  display: inline-block; 
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; 
}

#finalizar-whatsapp-btn-pagina:hover {
  background-color: #1DA851; 
  transform: translateY(-2px); 
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); 
}

/* Ajuste para o estado disabled, caso o botão esteja desabilitado */
#finalizar-whatsapp-btn-pagina:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none; 
  box-shadow: none; 
}


.continuar-comprando-btn {
  background: var(--cor1);
  color: var(--branco);
  width: 100%;
  max-width: 300px;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  text-align: center;
  margin-top: 0.5rem;
  transition: 0.3s, transform 0.3s, box-shadow 0.3s; 
}

.continuar-comprando-btn:hover {
  background: var(--cor2);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Footer (Original) */
footer {
  background-color: var(--cor0);
  border-radius: 10px 10px 0 0;
  padding: 1rem 1rem;
  text-align: center;
  color: #fff;
}

footer p {
  margin-top: 1rem;
  color: var(--branco);
}

/* Redes Sociais (Original) */
.social-media {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.social-media .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  z-index: 100;
  margin: 0 20px;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.social-media .icon a { text-decoration: none; }

.social-media .icon a span {
  position: relative;
  height: 50px;
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--cor1);
  border-radius: 50%;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.103);
  transition: 0.3s ease;
}

.social-media .icon a span i {
  font-size: 36px;
  color: black;
}

.social-media .icon:hover a span i { color: white; transition: all 0.3s ease-in-out; }

.social-media .icon .tooltip {
  background-color: #d2dae2;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.103);
  color: white;
  font-size: 20px;
  padding: 10px 18px;
  border-radius: 25px;
  position: absolute;
  top: 0;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.social-media .icon:hover .tooltip { top: -70px; opacity: 0; transition: all 0.3s ease-in-out; }
.social-media .icon .tooltip::before {
  position: absolute;
  content: '';
  height: 15px;
  width: 15px;
  bottom: -8px;
  background-color: #d2dae2;
  left: 50%;
  transform: translate(-50%) rotate(45deg);
}

.social-media .icon:hover span,
.social-media .icon:hover .tooltip { text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.404); transition: all 0.3s ease-in-out; }

.social-media .instagram:hover a span,
.social-media .instagram:hover .tooltip,
.social-media .instagram:hover .tooltip::before { background-image: linear-gradient(to right, #f9ce34, #ee2a7b, #6228d7); transition: all 0.3s ease-in-out; }

.social-media .whatsapp:hover a span,
.social-media .whatsapp:hover .tooltip,
.social-media .whatsapp:hover .tooltip::before { background-color: #25d366; transition: all 0.3s ease-in-out; }

/* ==========================================================================
   Responsividade (Media Queries)
   ========================================================================== */

/* Desktop (min-width: 769px) */
@media (min-width: 769px) {
  #menu-toggle, #botao-carrinho-mobile {
    display: none; 
  }
  nav#top-menu {
    position: static; 
    width: auto;
    height: auto;
    background: transparent;
    padding-top: 0;
    flex-direction: row;
    justify-content: flex-end; 
  }
  nav#top-menu ul {
    flex-direction: row;
  }
  .desktop-only { display: block; }
  .mobile-only { display: none; }
  .acoes-item-carrinho {
    width: auto;
    margin-top: 0;
    justify-content: flex-start;
  }
  /* Ajustes para a página do carrinho em desktop */
  .resumo-carrinho-pagina {
    align-items: flex-end;
  }
  #finalizar-whatsapp-btn-pagina,
  .continuar-comprando-btn {
    width: auto; 
    max-width: 300px; 
  }
  .filter-group {
    flex-direction: row; 
    align-items: center;
  }
}

/* Tablet e Mobile (max-width: 768px) */
@media (max-width: 768px) {
  body { 
    margin-top: 0; /* Remover margin-top fixo também para mobile, será ajustado via JS */
  } 

  header {
    padding: 1rem 1.5rem; 
  }

  /* Mostra o menu toggle e o ícone do carrinho */
  #menu-toggle, #botao-carrinho-mobile {
    display: block; 
  }

  /* Posicionamento absoluto para os botões de mobile no header */
  #botao-carrinho-mobile {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
  }
  
  #menu-toggle {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
  }

  /* Esconde o menu de navegação e o botão de carrinho desktop */
  nav#top-menu {
    position: fixed;
    top: 0;
    right: -100%; 
    width: 70%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.671);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 30px 0 0 30px;
    flex-direction: column;
    align-items: center;
    padding-top: 4rem;
    justify-content: flex-start;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 1000;
  }

  nav#top-menu.active {
    right: 0; 
  }

  nav#top-menu ul {
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    align-items: center;
  }

  nav#top-menu ul li a {
    color: var(--branco);
  }

  nav#top-menu ul li a::before {
    background-color: var(--cor2);
  }

  .desktop-only { display: none !important; } 
  .mobile-only { display: block; } 

  .filters form { flex-direction: column; }
  .conteudo-modal {
    width: 95%;
    padding: 1.5rem;
    max-height: 80vh;
  }
  #imagem-modal-produto {
    max-width: 90%;
    max-height: 40vh;
  }
  .grade-produtos {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  /* Ajustes para a página do carrinho em mobile */
  .cart-page {
    padding: 1.5rem;
  }
  .resumo-carrinho-pagina {
    align-items: center; 
  }
  #finalizar-whatsapp-btn-pagina,
  .continuar-comprando-btn {
    max-width: 90%; 
  }
  .filter-group {
    flex-direction: column; 
    align-items: center;
  }
  .filter-group input[type="text"] {
    width: 100%; 
    max-width: 250px; 
  }
}

/* Mobile Pequeno (max-width: 480px) */
@media (max-width: 480px) {
  header { padding: 1.8rem 1rem; }
  .grade-produtos {
    grid-template-columns: 1fr;
  }
  .cartao-produto {
    max-width: 90%;
    margin: 0 auto;
  }
  .conteudo-modal {
    padding: 1.5rem;
    width: 100%;
    max-height: 90vh;
  }
  #imagem-modal-produto {
    max-width: 90%;
    max-height: 30vh;
  }
}
