/* ================================================= */
/* loja.css - VERSÃO FINAL CORRIGIDA        */
/* ================================================= */

/* ================================================= */
/* CABEÇALHO (HEADER)                                */
/* ================================================= */
header {
  width: 100%;
  background-color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 999;
  box-sizing: border-box;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
.brand-logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.logo {
  height: 60px;
  width: auto;
  margin-right: 10px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: "Playfair Display", serif;
  font-size: 1.6em;
  font-weight: 700;
  color: #333;
}
.brand-tagline {
  font-family: "Quicksand", sans-serif;
  font-size: 0.9em;
  font-weight: 500;
  color: #666;
  margin-top: 2px;
}
.header-direita {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}
#user-info,
.icone-carrinho {
  font-size: 1.5em;
  cursor: pointer;
  color: var(--cor-texto-escuro);
}
.auth-link,
.btn-logout {
  color: var(--cor-texto-escuro);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 1em;
  transition: color 0.2s ease;
}
.auth-link:hover,
.btn-logout:hover {
  color: var(--cor-secundaria);
}
.icone-carrinho {
  position: relative;
}
.contador-carrinho {
  position: absolute;
  top: -8px;
  right: -10px;
  background-color: var(--cor-secundaria);
  color: white;
  font-size: 0.6em;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  display: none;
}
.contador-carrinho.visible {
  display: block;
}

/* ================================================= */
/* CONTEÚDO PRINCIPAL, FILTROS E PRODUTOS (MOBILE)   */
/* ================================================= */
main {
  padding: 0 20px;
}

/* ===== CÓDIGO DO FILTRO CORRIGIDO E UNIFICADO ===== */
/* ================================================= */
/* NOVO DESIGN DOS FILTROS DE CATEGORIA              */
/* ================================================= */

.filtros-container-novo {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Esconde a barra de rolagem */
}

.filtros-container-novo::-webkit-scrollbar {
    display: none; /* Esconde a barra de rolagem */
}

.filtro-chip {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background-color: #f8f9fa; /* Cinza claro padrão */
    text-decoration: none;
    font-size: 0.8em;
    font-weight: 500;
    color: var(--cor-texto-escuro);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.filtro-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.filtro-chip.active {
    border-color: var(--cor-primaria);
    background-color: #eef9fc; /* Azul bem clarinho */
    font-weight: 600;
}

.filtro-chip i {
    font-size: 2em;
    color: var(--cor-primaria); /* Ícones em azul */
}
#titulo-categoria {
  color: var(--cor-texto-escuro);
  font-size: 1.8em;
  margin: 25px 0 10px 0;
  text-align: left;
}
/* ================================================= */
/* NOVO DESIGN DA LISTA DE PRODUTOS                  */
/* ================================================= */

.lista-doces {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.doce-item {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Alinha no topo */
    gap: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.doce-item:hover {
    background-color: #fafafa;
}

.info-produto {
    flex-grow: 1;
}

.info-produto h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--cor-texto-escuro);
}

.doce-item .descricao {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detalhes-extras {
    font-size: 0.8em;
    color: #777;
    margin-bottom: 10px;
}

.detalhes-extras i {
    margin-right: 5px;
}

.info-produto .preco {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--cor-texto-escuro);
    margin: 0;
}

.imagem-container {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.doce-item .imagem-produto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* ================================================= */
/* MODAL DE DETALHES DO PRODUTO                      */
/* ================================================= */
.modal {
  display: none;
  position: fixed;
  z-index: 1003;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
}
.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal .modal-content {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background-color: var(--cor-fundo-cinza);
  display: flex;
  flex-direction: column;
  animation: slide-up 0.4s ease-out;
}
@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.modal-header-image {
  width: 100%;
  height: 250px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.modal-fechar-novo {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2em;
}
.info-loja-flutuante {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: white;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin: -40px 20px 0 20px;
  z-index: 2;
}
.info-loja-flutuante img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.modal-body-content {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
}
.modal-body-content h2 {
  font-size: 1.8em;
  margin: 10px 0;
  color: var(--cor-texto-escuro);
  font-weight: 600;
}
.modal-body-content p {
  line-height: 1.5;
  color: #555;
  margin: 15px 0;
  font-size: 1em;
}
.modal-body-content .preco {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--cor-texto-escuro);
  margin: 10px 0;
}
.campo-observacao {
  margin-top: 20px;
}
.campo-observacao h4 {
  margin-bottom: 10px;
  font-size: 1.1em;
  color: var(--cor-texto-escuro);
  font-weight: 500;
}
.campo-observacao textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  font-size: 1em;
  resize: vertical;
  transition: border-color 0.2s;
}
.modal-footer-actions {
  display: flex;
  gap: 20px;
  padding: 15px 20px;
  background-color: #fff;
  border-top: 1px solid #f0f0f0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}
.quantidade-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ddd;
  border-radius: 5px;
  width: 120px;
  padding: 5px 10px;
  background-color: #f9f9f9;
}
.quantidade-stepper button {
  background: none;
  border: none;
  font-size: 1.8em;
  color: var(--cor-primaria);
  font-weight: 500;
  cursor: pointer;
  padding: 5px 15px;
  user-select: none;
  transition: background-color 0.2s, color 0.2s;
}
.quantidade-stepper span {
  font-size: 1.2em;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}
.btn-adicionar-grande {
  flex-grow: 1;
  background-color: var(--cor-secundaria);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  transition: background-color 0.3s;
}

/* ================================================= */
/* RODAPÉ (FOOTER)                                   */
/* ================================================= */
footer {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 10px 0;
  background-color: var(--cor-fundo-cinza);
  border-top: 1px solid #e9ecef;
}
.admin-login-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.2s;
}
.admin-login-link:hover {
  color: #343a40;
}

/* ================================================= */
/* ESTILOS DO SKELETON LOADER                        */
/* ================================================= */
.doce-item-skeleton {
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.info-produto-skeleton {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skeleton {
  background-color: #e0e0e0;
  border-radius: 4px;
  animation: shimmer 1.5s infinite linear;
  background: linear-gradient(to right, #e0e0e0 8%, #f0f0f0 18%, #e0e0e0 33%);
  background-size: 800px 104px;
}
.skeleton-text {
  width: 80%;
  height: 20px;
}
.skeleton-text-small {
  width: 100%;
  height: 12px;
}
.skeleton-text-medium {
  width: 40%;
  height: 16px;
}
.skeleton-img {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  flex-shrink: 0;
}
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}
/* ================================================= */
/* LAYOUT FINAL PARA DESKTOP (TELAS GRANDES)         */
/* ================================================= */

@media (min-width: 768px) {
  /* Centraliza a área principal do cardápio */
  .body-loja main {
    max-width: 960px;
    margin: 0 auto;
  }

  /* Cria a grade de 2 colunas para a lista de produtos */
  .lista-doces {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }

  /* Estiliza cada produto como um card */
  .doce-item {
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    border-bottom: 1px solid #f0f0f0; /* Garante a borda */
    flex-direction: row; 
    align-items: flex-start;
  }

  /* Inverte a ordem para a imagem ficar à direita */
  .info-produto {
    order: 1;
  }
  .imagem-container {
    order: 2;
  }
}
/* Estilo para o aviso de login nas páginas de Favoritos/Pedidos */
.aviso-login {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 8px;
    margin-top: 20px;
}
.aviso-login h3 {
    margin-top: 0;
}
/* ================================================= */
/* ESTILO DO ÍCONE DE FAVORITO                       */
/* ================================================= */

.imagem-container {
    position: relative; /* Essencial para posicionar o ícone dentro dele */
}

.icone-favorito {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.icone-favorito:hover {
    transform: scale(1.1);
}

.icone-favorito i {
    font-size: 1em;
    color: #ccc; /* Cor do coração vazio */
}

.icone-favorito.active i {
    color: var(--cor-secundaria); /* Cor do coração preenchido (rosa) */
}