/* =================================
   RESET BÁSICO E CONFIGS GLOBAIS
   ================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  scroll-behavior: smooth;
}

body {
  background: #f7f9fc;
  color: #222;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
  flex-grow: 1;
}

h1, h2 {
  color: #111d3a;
  margin-bottom: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* =================================
   HEADER, BANNER E NAVEGAÇÃO
   ================================= */
header {
  background: #111d3a;
  color: #fff;
  padding-top: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  position: sticky; /* Fica fixo no topo em telas grandes */
  top: 0;
  z-index: 100;
}

#banner {
  position: relative;
  background: linear-gradient(135deg, #2E5902 0%, #A62963 100%);
  background-size: 200% 200%;
  animation: brilho 8s ease infinite;
  height: 200px;
  border-radius: 16px;
  margin: 0 auto 20px auto;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  overflow: hidden;
  user-select: none;
}

.banner-conteudo h1 {
  font-size: 3.6rem;
  margin-bottom: 12px;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 2px 2px 8px rgba(230, 233, 35, 0.6);
}

.banner-conteudo p {
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.btn-banner {
  background: #F23D91;
  padding: 10px 10px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(242, 61, 145, 0.6);
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn-banner:hover {
  background-color: #f137b3;
  transform: scale(1.1);
}

.banner-icons {
  display: flex;
  gap: 30px;
}
.banner-icons .icon {
  width: 80px;
  height: 80px;
  opacity: 0.85;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.banner-icons .icon:hover {
  transform: scale(1.2) rotate(10deg);
  opacity: 1;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#menuToggle {
  display: none;
  font-size: 1.8rem;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
}

.menu-principal {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.menu-principal li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}
.menu-principal li a:hover,
.menu-principal li a.active {
  color: #f95738;
}
.menu-principal li a.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 3px;
  background: #f95738;
  border-radius: 3px;
}

/* =================================
   CONTEÚDO PRINCIPAL (PRODUTOS, ETC)
   ================================= */
.produtos-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.filtros {
  flex: 0 0 250px;
  background: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  position: sticky;
  top: 100px;
}
.filtros h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.categorias, .subcategorias {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.categorias button {
  width: 100%;
  text-align: left;
  background: #e1e7f0;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  color: #111d3a;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.categorias button:hover,
.categorias button.active-filter {
  background: #f95738;
  color: #fff;
}
.subcategorias {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
}

.produtos-main {
  flex-grow: 1;
}

.grid-produtos {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
  gap: 1.5rem;
}

.card-produto {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-produto:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}
.card-produto img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.8rem;
}
.card-produto h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #111d3a;
  text-align: center;
}
.card-produto .preco {
  font-weight: 700;
  color: #f95738;
  margin-bottom: 1rem;
}
.btn-comprar {
  background: #f95738;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  width: 100%;
}
.btn-comprar:hover:not(:disabled) {
  background: #d84722;
  transform: scale(1.05);
}
.btn-comprar:disabled {
  background: #a04a32;
  cursor: default;
}

/* =================================
   CARRINHO E DESTAQUES
   ================================= */
.carrinho-area {
  background: #fff;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin-top: 2rem;
}
.carrinho-area ul {
  list-style: none;
  margin-bottom: 1rem;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 10px;
}
.carrinho-area li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.4rem;
}
.carrinho-area .remover {
  background: transparent;
  border: none;
  color: #f95738;
  font-weight: 700;
  cursor: pointer;
}
.carrinho-area .total-carrinho {
  font-size: 1.2rem;
  color: #f95738;
  text-align: right;
  margin-bottom: 1rem;
}
#finalizarCompraBtn {
  background: #111d3a;
  color: #fff;
  font-weight: 700;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 50px;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
#finalizarCompraBtn:hover {
  background: #f95738;
  transform: scale(1.05);
}

.grid-destaques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}
.card-destaque {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.card-destaque:hover, .card-destaque:focus {
  transform: translateY(-8px);
  box-shadow: 0 14px 35px rgba(0,0,0,0.12);
  outline: none;
}
.card-destaque img {
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 0.8rem;
}

/* =================================
   POPUPS E MODAIS
   ================================= */
.popup-fundo {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-base-conteudo {
  background-color: #fff;
  padding: 20px 30px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 14px;
  position: relative;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.popup-conteudo {
  animation: scaleIn 0.3s ease;
}
.modal-conteudo {
  max-width: 500px;
  align-items: stretch;
}

.popup-fechar {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 28px;
  color: #555;
  cursor: pointer;
}

.popup-img-principal {
  max-width: 100%;
  max-height: 40vh;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 15px;
}

.popup-imagens {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 15px;
}
.popup-imagens img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.popup-imagens img:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

#checkoutForm .form-grupo {
  margin-bottom: 15px;
}
#checkoutForm label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
#checkoutForm input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.btn-enviar-pedido {
  width: 100%;
  background-color: #25D366;
  color: white;
  padding: 14px 20px;
  margin-top: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}
.btn-enviar-pedido:hover {
  background-color: #128C7E;
}

/* =================================
   PAGINAÇÃO
   ================================= */
.paginacao-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-bottom: 1rem;
}

.paginacao-container button {
  background-color: #e1e7f0;
  color: #111d3a;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  min-width: 40px;
  height: 40px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.paginacao-container button:hover,
.paginacao-container button.active {
  background-color: #f95738;
  color: #fff;
}

/* =================================
   FOOTER
   ================================= */
footer {
  background: #111d3a;
  color: #f95738;
  text-align: center;
  padding: 1.5rem 0;
  font-weight: 600;
}
.wrap-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* =================================
   LOADER E ANIMAÇÕES
   ================================= */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}
.loader {
  border: 5px solid #e1e7f0;
  border-top: 5px solid #f95738;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}
.loader-container p {
  margin-top: 1rem;
  font-weight: 600;
  color: #111d3a;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes brilho {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* =================================
   MEDIA QUERIES (RESPONSIVIDADE)
   ================================= */
@media (max-width: 900px) {
  header {
    position: static; /* Header deixa de ser fixo */
  }
  .filtros {
    position: static; /* Filtros também deixam de ser fixos */
  }
  
  .produtos-container {
    flex-direction: column;
  }
  .filtros {
    width: 100%;
    flex-basis: auto;
  }
  #menuToggle {
    display: block;
    z-index: 102;
  }
  .menu-principal {
    flex-direction: column;
    background: #111d3a;
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    padding: 6rem 2rem;
    gap: 1.5rem;
    z-index: 101;
  }
  .menu-principal.open {
    transform: translateX(0);
  }
}

@media (max-width: 720px) {
  #banner {
    flex-direction: column;
    height: auto;
    padding: 30px 20px;
    text-align: center;
  }
  .banner-icons {
    margin-top: 20px;
    justify-content: center;
  }
  .banner-conteudo h1 {
    font-size: 2.8rem;
  }
  .banner-conteudo p {
    font-size: 1.1rem;
  }
}