@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:wght@400;500;600&display=swap');

:root {
  --primary-color: #8c7261; /* Tom dourado/bronze mais suave como o da Vivara */
  --secondary-color: #5c4f44; /* Tom mais escuro para hover */
  --accent-color: #d4c3b5; /* Tom mais claro para detalhes */
  --text-dark: #333333;
  --text-light: #777777;
  --background-light: #f9f9f9;
  --background-white: #ffffff;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
  --border-light: #e5e0da;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  background-color: var(--background-light);
  color: var(--text-dark);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header elegante */
header-catalogo {
  background-color: var(--background-white);
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  width: 100%;
}

header-catalogo .logo img {
  height: 80px;
  width: auto;
}

header-catalogo .loja-info {
  text-align: left;
}

header-catalogo h1 {
  font-family: 'Playfair Display', serif;
  margin-bottom: 5px;
  color: var(--primary-color);
  font-size: 2.2em;
  font-weight: 500;
  letter-spacing: 1px;
}

header-catalogo p {
  color: var(--text-light);
  font-size: 0.95em;
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Layout flexível para menu e conteúdo */
.conteudo-wrapper {
  display: flex;
  flex: 1;
}

/* Menu lateral estilizado */
.menu-lateral {
  width: 260px;
  background-color: var(--background-white);
  padding: 30px 20px;
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  flex-shrink: 0;
  height: calc(100vh - 120px); /* Altura ajustável baseada no header */
  position: sticky;
  top: 0;
}

.menu-lateral h3 {
  font-family: 'Playfair Display', serif;
  color: var(--primary-color);
  font-size: 1.3em;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 500;
}

.menu-categorias {
  list-style: none;
  padding: 0;
  margin: 0;
}

.categoria-item {
  margin-bottom: 12px;
}

.categoria-botao {
  background: none;
  border: none;
  padding: 12px 0;
  text-align: left;
  width: 100%;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 0.95em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0;
  transition: all 0.2s ease;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.categoria-botao:hover {
  color: var(--primary-color);
}

.categoria-botao::after {
  content: '+';
  font-size: 1.1em;
  color: var(--text-light);
}

.categoria-botao.ativo {
  color: var(--primary-color);
}

.categoria-botao.ativo::after {
  content: '−';
  color: var(--primary-color);
}

.sub-menu {
  list-style: none;
  padding-left: 15px;
  margin-top: 8px;
  display: none;
}

.sub-menu li {
  margin-bottom: 8px;
}

.sub-menu li a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.85em;
  display: block;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.sub-menu li a:hover {
  color: var(--primary-color);
}

/* Conteúdo principal com grade de produtos */
.conteudo-principal {
  flex-grow: 1;
  padding: 40px;
}

#catalogo-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

/* Cards de produto elegantes */
.produto {
  background-color: var(--background-white);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid transparent;
}

.produto:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--border-light);
}

.produto img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.produto-info {
  padding: 25px 20px;
  text-align: center;
  background-color: var(--background-white);
}

.produto-info h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 1em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.produto-info p.descricao {
  color: var(--text-light);
  font-size: 0.85em;
  margin-bottom: 12px;
  line-height: 1.5;
  height: 40px;
  overflow: hidden;
}

.produto-info p.preco {
  color: var(--primary-color);
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 18px;
}

.produto-info button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 0;
  width: 100%;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.produto-info button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.produto-info button:active {
  transform: translateY(0);
  transition: all 0.1s ease;
}

/* WHY: efeito ripple sutil ao clicar */
.produto-info button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
  transform: translate(-50%, -50%);
}

.produto-info button:active::before {
  width: 300px;
  height: 300px;
}

/* Responsividade */
@media screen and (max-width: 1024px) {
  #catalogo-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }
  
  .conteudo-principal {
    padding: 30px;
  }
}

@media screen and (max-width: 768px) {
  .conteudo-wrapper {
    flex-direction: column;
  }
  
  .menu-lateral {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 20px;
    position: relative;
  }
  
  header-catalogo {
    padding: 15px 20px;
    flex-direction: column;
    text-align: center;
  }
  
  header-catalogo .loja-info {
    text-align: center;
  }
  
  .conteudo-principal {
    padding: 20px;
  }
}

@media screen and (max-width: 480px) {
  #catalogo-container {
    grid-template-columns: 1fr;
  }
  
  .produto img {
    height: 250px;
  }
}

/* Efeitos de transição suaves */
.transition-fade {
  transition: opacity 0.3s ease;
}

.fade-in {
  opacity: 1;
}

.fade-out {
  opacity: 0;
}

/* Estilos para o carousel */
.produto-carousel {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.produto-carousel-inner {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.produto-carousel-item {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  height: 100%;
}

.produto-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--primary-color);
}

.carousel-arrow-prev {
  left: 10px;
}

.carousel-arrow-next {
  right: 10px;
}

.carousel-controls {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 5;
}

.carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.carousel-indicator.active {
  background-color: var(--primary-color);
}

/* Estilos para o rodapé */
.rodape {
  background-color: var(--primary-color);
  color: white;
  padding: 40px 0 20px;
  margin-top: 50px;
}

.rodape-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.rodape-logo {
  flex: 1;
  min-width: 200px;
  margin-bottom: 30px;
}

.rodape-logo img {
  margin-bottom: 15px;
}

.rodape-logo h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5em;
  margin-bottom: 5px;
  font-weight: 500;
}

.rodape-logo p {
  font-size: 0.9em;
  opacity: 0.8;
}

.rodape-contato, .rodape-social {
  flex: 1;
  min-width: 200px;
  margin-bottom: 30px;
}

.rodape h4 {
  font-family: 'Playfair Display', serif;
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 1.2em;
  position: relative;
  padding-bottom: 10px;
}

.rodape h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent-color);
}

.rodape-contato ul {
  list-style: none;
  padding: 0;
}

.rodape-contato li {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
}

.rodape-contato li i {
  margin-right: 10px;
  font-size: 18px;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  font-size: 20px;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

.rodape-copyright {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85em;
  opacity: 0.7;
}

.rodape-copyright p {
  margin: 5px 0;
}

/* Estilos para a barra de pesquisa */
.search-container {
  background-color: var(--background-white);
  padding: 15px 40px;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.search-box {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  position: relative;
}

.search-box input {
  flex-grow: 1;
  padding: 12px 15px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-box input:focus {
  border-color: var(--primary-color);
}

.search-box button {
  position: absolute;
  right: 3px;
  top: 3px;
  bottom: 3px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 3px;
  width: 40px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-box button:hover {
  background-color: var(--secondary-color);
}

/* Responsividade para o rodapé e pesquisa */
@media screen and (max-width: 768px) {
  .rodape-container {
    flex-direction: column;
    padding: 0 20px;
  }
  
  .rodape-logo, .rodape-contato, .rodape-social {
    margin-bottom: 25px;
    text-align: center;
  }
  
  .rodape h4::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .rodape-contato li {
    justify-content: center;
  }
  
  .social-icons {
    justify-content: center;
  }
  
  .search-container {
    padding: 10px 20px;
  }
}

@media screen and (max-width: 480px) {
  .search-box input {
    padding: 10px;
    font-size: 13px;
  }
}

/* Carregamento de produtos*/

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: var(--text-light);
  font-size: 0.9em;
  font-weight: 500;
}

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

/* animações baseadas em scroll  */

.fade-in-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.produto {
  background-color: var(--background-white);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(20px);
}

.produto.fade-in-complete {
  opacity: 1;
  transform: translateY(0);
}

.produto:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
  border-color: var(--border-light);
}

/* WHY: layout flexível para miniaturas sem quebrar design existente */
.item-carrinho {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
  gap: 12px;
}

.item-carrinho-miniatura {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.item-carrinho-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.item-carrinho-img:hover {
  transform: scale(1.1);
}

.item-carrinho-info {
  flex-grow: 1;
  min-width: 0;
}

.item-carrinho-nome {
  font-size: 0.9em;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-carrinho-preco {
  font-size: 0.8em;
  color: var(--primary-color);
  font-weight: 600;
}

.item-carrinho-quantidade {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-quantidade {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-light);
  background: white;
  color: var(--text-dark);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8em;
}

.btn-quantidade:hover {
  background-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

/* WHY: estilos para grid de produtos - garantir exibição correta */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.produto-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.produto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.produto-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.produto-card h3 {
  padding: 15px 15px 5px;
  margin: 0;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}

.produto-card .preco {
  padding: 0 15px 10px;
  margin: 0;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--primary-color);
}

.produto-card .btn-whatsapp {
  width: 100%;
  padding: 12px;
  background-color: #25d366;
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.produto-card .btn-whatsapp:hover {
  background-color: #1da851;
}

.produto-card .btn-whatsapp i {
  font-size: 1.1em;
}

/* WHY: estilos para estados de carregamento e erro */
.erro-carregamento {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.erro-carregamento h3 {
  color: var(--text-dark);
  margin-bottom: 10px;
}

.erro-carregamento p {
  margin-bottom: 20px;
}

.btn-reload {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.btn-reload:hover {
  background-color: var(--secondary-color);
}

/* WHY: estilos para menu de categorias ativo */
.menu-categorias .categoria-ativa {
  background-color: var(--primary-color);
  color: white !important;
}

/* WHY: responsividade para dispositivos móveis */
@media (max-width: 768px) {
  .produtos-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
  }
  
  .produto-card img {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .produtos-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
  }
  
  .produto-card img {
    height: 150px;
  }
  
  .produto-card h3 {
    font-size: 0.95em;
    padding: 10px 10px 5px;
  }
  
  .produto-card .preco {
    font-size: 1.1em;
    padding: 0 10px 8px;
  }
  
  .produto-card .btn-whatsapp {
    padding: 10px;
    font-size: 0.9em;
  }
}

/* WHY: correção de visibilidade - produtos devem ser visíveis por padrão */
.produtos-grid .produto-card {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.produto-card {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* WHY: sobrescrever animações que podem deixar produtos invisíveis */
#catalogo-container .produto {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

#catalogo-container .produto-card {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* WHY: garantir que container do catálogo seja visível */
#catalogo-container {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Estilos para lupa de zoom */
.magnifier-lens {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: none;
    pointer-events: none;
    z-index: 999;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
}

.magnifier-result {
    position: absolute;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background-repeat: no-repeat;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    pointer-events: none;
}

/* Desativar lupa em mobile */
@media (max-width: 768px) {
    .magnifier-lens,
    .magnifier-result {
        display: none !important;
    }
}

/* Correção para imagens em mobile */
@media screen and (max-width: 768px) {
    .produto img,
    .produto-carousel-item img {
        height: 250px;
        object-fit: contain; /* Mudança de cover para contain */
        background-color: #f8f8f8;
    }
}

@media screen and (max-width: 480px) {
    .produto img,
    .produto-carousel-item img {
        height: 200px;
        object-fit: contain; /* Mudança de cover para contain */
        background-color: #f8f8f8;
    }
    
    /* Ajustar altura do carousel */
    .produto-carousel {
        height: 200px;
    }
}

/* Adicionar cursor de lupa nas imagens */
@media (min-width: 769px) {
    .produto img:hover,
    .produto-carousel-item img:hover {
        cursor: crosshair;
    }
}