@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&family=Playfair+Display:wght@400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}

body {
  background: #F6F3EC;
  color: #333;
}

h1 {
  color: #3E4A3C;
  text-align: center;
  margin-bottom: 15px;
  font-family: "Playfair Display", serif;
  font-size: 60px;
}

.logo {
  height: 50px;
  cursor: pointer;
}

header {
  height: 60px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  background-color: #4B3A2F;
  padding: 0 10px;
}

header input {
  min-width: 30%;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid #6D5C4C;
}

header button {
  height: 40px;
  width: 40px;
  background: none;
  border: none;
  font-size: 26px;
  color: #F6F3EC;
  cursor: pointer;
  position: relative;
}


#contador-carrinho{
  position: absolute;
  top: -5px;
  right: -5px;
  background: #6D5C4C;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

main p {
  font-size: 22px;
  text-align: center;
  font-family: "Playfair Display", serif;
  margin-bottom: 20px;
}

/* Grid de produtos */
#produtos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.produto-card {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 380px;
}

.produto-card:hover {
  transform: scale(1.03);
}

.produto-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.produto-card h2 {
  font-size: 18px;
  color: #3E4A3C;
  margin: 10px 0;
}

.produto-card p {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.produto-card strong {
  display: block;
  font-size: 16px;
  color: #3E4A3C;
  margin-top: 5px;
}

.produto-card button {
  padding: 6px 10px;
  background: #3E4A3C;
  color: #F6F3EC;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.produto-card button:hover {
  background: #6D5C4C;
}

.controle-quantidade {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 8px 0;
}

.controle-quantidade button {
  background: #6D5C4C;
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  cursor: pointer;
}

.controle-quantidade button:hover {
  background: #4B3A2F;
}

/* Carrinho lateral */
.carrinho {
  position: fixed;
  top: 0;
  right: -400px;
  width: 320px;
  height: 100%;
  background: #F6F3EC;
  border-left: 2px solid #3E4A2F;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: right 0.3s;
  z-index: 1000;
}

.carrinho.aberto {
  right: 0;
}

.carrinho-header,
.carrinho-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carrinho-footer p {
  font-size: 16px;
  font-weight: 700;
}

.carrinho-footer button {
  height: 50px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background-color: #6D5C4C;
  color: #F6F3EC;
  cursor: pointer;
}

.carrinho-footer button:hover {
  background-color: #4B3A2F;
}

.carrinho-header button {
  border: none;
  cursor: pointer;
}

#carrinho-itens {
  flex: 1;
  overflow-y: auto;
  margin: 10px 0;
}

.carrinho-item {
  border-bottom: 1px solid #ccc;
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.carrinho-item img.thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
}

/* Footer atualizado */
footer {
  margin-top: 20px;
  background: #4B3A2F;
  color: #F6F3EC;
  padding: 20px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.footer-logo img {
  height: 70px;
}

.footer-social {
  display: flex;
  gap: 15px;
  align-items: center;
}

.footer-social .icon {
  width: 35px;
  height: 35px;
  filter: brightness(0) invert(1);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.footer-social .icon:hover {
  transform: scale(1.1);
}

footer .copyright {
  text-align: center;
  font-size: 16px;
  margin-top: 10px;
}

/* remove azul e sublinhado de links */
footer a {
  color: inherit;
  text-decoration: none;
}

/* ======= Responsividade ======= */

/* Telas até 1024px (tablets e notebooks pequenos) */
@media (max-width: 1024px) {
  h1 {
    font-size: 2.2rem;
  }

  header input {
    display: none;
  }

  #produtos {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .carrinho {
    width: 280px;
  }
}

/* === ADMIN ===*/

.admin-container {
  max-width: 600px;
  margin: 30px auto;
  background: #fff;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.admin-container h2 {
  text-align: center;
  font-family: "Playfair Display", serif;
  margin-bottom: 20px;
  color: #3E4A3C;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #6D5C4C;
  background: #F6F3EC;
  font-size: 15px;
  color: #3E4A3C;
  outline: none;
  transition: 0.2s;
}

form input:focus,
form textarea:focus {
  border-color: #3E4A3C;
  background: #fff;
}

form textarea {
  height: 100px;
  resize: none;
}

.btn-submit {
  width: 100%;
  background: #3E4A3C;
  padding: 12px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 10px;
}

.btn-submit:hover {
  background: #6D5C4C;
}

.logo-admin {
  display: block;
  margin: 20px auto;
  width: 140px;
}

.admin-footer {
  margin-top: 25px;
  text-align: center;
  font-size: 14px;
  color: #6D5C4C;
}

  /* ===== Botão Voltar ao Topo ===== */
  #btn-topo {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4B3A2F;
    color: #F6F3EC;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: none;
    /* começa invisível */
    z-index: 2000;
    transition: all 0.3s ease;
  }

  #btn-topo:hover {
    background-color: #3E4A2F;
    transform: translateX(-50%) scale(1.1);
  }


/* Telas até 768px (tablets verticais e celulares grandes) */
@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    justify-content: center;
    height: auto;
    padding: 10px;
  }

  header button {
    font-size: 22px;
  }

  h1 {
    font-size: 2rem;
  }

  main p {
    font-size: 1rem;
  }

  .produto-card {
    height: auto;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
  }
}

/* Telas até 480px (celulares comuns) */
@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  header {
    padding: 10px;
  }

  .logo {
    height: 40px;
  }

  #produtos {
    grid-template-columns: 1fr;
  }

  .produto-card img {
    height: 160px;
  }

  footer {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .admin-container {
    width: 92%;
    padding: 20px;
  }

  .btn-submit {
    font-size: 16px;
  }

  form input,
  form textarea {
    font-size: 14px;
  }


  /* ===== Botão Voltar ao Topo ===== */
  #btn-topo {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4B3A2F;
    color: #F6F3EC;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: none;
    /* começa invisível */
    z-index: 2000;
    transition: all 0.3s ease;
  }

  #btn-topo:hover {
    background-color: #3E4A2F;
    transform: translateX(-50%) scale(1.1);
  }


}