:root {
  --bege-claro: #f9f7f2;
  --laranja-suave: #ffd8a8;
  --azul-acento: #a5d8ff;
  --azul-escuro: #2c3e50;
  --texto: #4a4a4a;
  --branco: #ffffff;
  --laranja-span: #ff9e1f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  background-color: var(--bege-claro);
  color: var(--texto);
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden; /* Impede rolagem lateral */
  width: 100%;
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8%; /* Reduzi um pouco o padding vertical */
  background: var(--branco);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: fixed;
  width: 100%;
  z-index: 1000;
  top: 0;
}
.logo {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--azul-escuro);
}
.logo span {
  color: var(--laranja-span);
}
.nav-links {
  display: flex;
  list-style: none;
}
.nav-links li {
  margin-left: 30px;
}
.nav-links a {
  text-decoration: none;
  color: var(--texto);
  font-weight: 500;
  transition: 0.3s;
}
.nav-links a:hover {
  color: var(--azul-acento);
}

/* Hero */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 5%;
  background:
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url("https://images.unsplash.com/photo-1509440159596-0249088772ff?auto=format&fit=crop&q=80&w=1600")
      center/cover;
}
.hero-content h1 {
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  margin-bottom: 10px;
}
.hero-content p {
  color: #ffffff; /* Mudamos de cinza para branco */
  font-size: 1.2rem;
  font-weight: 400;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8); /* Sombra estratégica */
  max-width: 600px;
  margin: 0 auto 20px;
}
.btn-pedido {
  padding: 15px 40px;
  font-size: 1.1rem;
  background-color: var(--azul-escuro);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
  margin-top: 30px;
}
.btn-pedido:hover {
  transform: scale(1.05);
  background-color: var(--azul-acento);
}

/* Grid e Seções */
.menu-section {
  padding: 40px 8%;
}
.bg-alt {
  background-color: #fefefe;
}
.section-title {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}
.section-title::after {
  content: "";
  width: 60px;
  height: 3px;
  background: var(--laranja-suave);
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.product-card {
  background: var(--branco);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: 0.3s;
}
.product-card:hover {
  transform: translateY(-10px);
}
.product-image-slot {
  height: 220px;
  background: #eee;
  position: relative;
  overflow: hidden;
}
.product-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Isso faz a foto preencher o espaço sem esticar/achatar */
  display: block;
}

/* Status Badges */
.badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
  display: none;
}
[data-status="promocao"] .badge {
  display: block;
  background: #e67e22;
  content: "PROMOÇÃO";
}
[data-status="esgotado"] .badge {
  display: block !important;
  background: #7f8c8d !important;
}
[data-status="esgotado"] {
  opacity: 0.6;
  filter: grayscale(1);
  pointer-events: none;
}

.product-info {
  padding: 25px;
}
.price {
  color: var(--azul-escuro);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 10px 0;
}
.order-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}
.qty-input {
  width: 50px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* BOTÕES DE TAMANHO */
.size-picker {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}
.size-btn {
  flex: 1;
  padding: 8px 2px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}
.size-btn.active {
  background: var(--azul-escuro);
  color: white;
  border-color: var(--azul-escuro);
  font-weight: 600;
}

.add-to-cart {
  flex-grow: 1;
  padding: 10px;
  background: var(--azul-acento);
  border: none;
  border-radius: 8px;
  color: var(--azul-escuro);
  font-weight: 600;
  cursor: pointer;
}

/* Sidebar e Floating */
.cart-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  background: var(--azul-escuro);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
}
.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: #e67e22;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: white;
  z-index: 2000;
  transition: 0.4s;
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
}
.cart-sidebar.open {
  right: 0;
}
.cart-header {
  padding: 30px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
}
.cart-items-container {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
}
.cart-footer {
  padding: 30px;
  background: var(--bege-claro);
}
.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.btn-checkout {
  width: 100%;
  padding: 15px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* Modais */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 62, 80, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  backdrop-filter: blur(5px);
}
.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
}
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 15px 0;
}
.pay-btn {
  padding: 10px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 8px;
  cursor: pointer;
}
.pay-btn.selected {
  background: var(--azul-acento);
  border-color: var(--azul-escuro);
  font-weight: 600;
}
.btn-final-whatsapp {
  width: 100%;
  padding: 18px;
  background: #25d366;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

/* Ajuste do Logo no Header */
.logo {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--azul-escuro);
  white-space: nowrap; /* Impede que o texto quebre linha */
}

.logo-img {
  height: 50px; /* Ajuste o tamanho conforme sua imagem */
  width: auto;
}

/* Ajuste do Logo no Hero (Topo da página) */
.hero-logo {
  width: 120px;
  height: auto;
  margin-bottom: 15px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px; /* Espaço entre a imagem e o texto */
}

/* Correção de espaçamento nos modais */
.form-group {
  margin-bottom: 15px;
  text-align: left;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: var(--azul-escuro);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
}

/* Grid de Entrega/Retirada */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.method-btn {
  padding: 10px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.method-btn.selected {
  background: var(--azul-escuro);
  color: white;
  border-color: var(--azul-escuro);
}

/* Ajuste no Modal de Aviso */
.aviso-box {
  text-align: center;
}
.aviso-box p {
  margin-bottom: 15px;
  line-height: 1.4;
  color: var(--texto);
}
.aviso-detalhe {
  font-size: 0.85rem;
  background: #fff9db;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #f0e2a8;
}
.aviso-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}
.btn-confirm {
  background: var(--azul-escuro);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}
.btn-cancel {
  background: var(--laranja-suave);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 12px;
}

.btn-clear-cart {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: #888;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.btn-clear-cart:hover {
  background: #f8f8f8;
  color: #e74c3c; /* Fica vermelho ao passar o mouse */
  border-color: #e74c3c;
}

/* Estilo do Alerta Personalizado */
.alert-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.alert-actions button {
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  border: none;
  flex: 1; /* Faz os botões terem o mesmo tamanho */
}

#btn-alert-cancel {
  background: #eee;
  color: #666;
  display: none;
}

.alert-box {
  text-align: center;
  max-width: 350px !important; /* Mais estreito que o checkout */
  padding: 30px !important;
  border-top: 5px solid var(--azul-escuro);
}

.alert-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.alert-box h3 {
  color: var(--azul-escuro);
  margin-bottom: 10px;
  font-family: "Playfair Display", serif;
}

.alert-box p {
  color: var(--texto);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* --- Banner Promocional (Slider) --- */
.promo-slider {
  width: 100%;
  /* Ajuste este margin-top para que o banner não fique escondido atrás do menu fixo */
  margin-top: 100px;
  padding: 0 5%; /* Espaçamento lateral para não colar na borda em telas grandes */
  margin-bottom: 30px; /* Espaço para o conteúdo de baixo */
  display: flex;
  justify-content: center;
}

.promo-placeholder {
  width: 100%;
  max-width: 1200px; /* Largura máxima para não ficar gigante em monitores */
  background-color: var(
    --laranja-suave
  ); /* Cor de fundo caso a imagem demore a carregar */
  border-radius: 12px; /* Bordas arredondadas */
  overflow: hidden; /* Garante que a imagem respeite as bordas arredondadas */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Sombra suave para destaque */
}

.promo-placeholder img {
  width: 100%;
  height: auto; /* Mantém a proporção da imagem */
  display: block; /* Remove espaços brancos indesejados abaixo da imagem */
  object-fit: cover; /* Garante que preencha bem o espaço */
  max-height: 540px;
  object-fit: cover;
}

/* Animação de entrada */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#custom-alert .modal-content {
  animation: fadeInScale 0.3s ease-out;
}

/* --- Footer Estilizado --- */
.main-footer {
  background-color: var(--azul-escuro);
  color: var(--branco);
  padding: 60px 8% 20px;
  margin-top: 50px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap; /* Permite quebrar linha no celular */
  max-width: 1200px;
  margin: 0 auto;
}

.footer-box {
  flex: 1;
  min-width: 250px; /* Garante que não fique muito espremido */
}

.footer-box h4 {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: var(--laranja-suave);
}

.footer-box p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 10px;
  opacity: 0.9;
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--branco);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 30px;
  transition: 0.3s;
  font-weight: 600;
}

.instagram-link:hover {
  background: var(--laranja-suave);
  color: var(--azul-escuro);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  opacity: 0.7;
}

/* --- Estilos para Endereço Separado --- */
.address-grid {
  display: flex;
  gap: 10px;
}

.field-rua {
  flex: 3; /* A rua ocupa 3 partes do espaço */
}

.field-num {
  flex: 1; /* O número ocupa 1 parte */
}

/* Garante que os inputs novos tenham o estilo padrão */
.input-padrao,
.field-rua input,
.field-num input,
#end-comp,
#end-bairro {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
}

/* Estilo para os inputs de endereço novos */
#end-bairro {
  border: 1px solid #ccc;
  background-color: #f8f9fa; /* Cinza claro para indicar que está travado */
  cursor: not-allowed;
}

/* Faz a Rua e o Número ficarem na mesma linha */
#group-endereco div {
  display: flex;
  gap: 10px;
}

/* 1. Faz o Modal de Checkout ser rolável internamente */
#modal-checkout {
  align-items: flex-start; /* Alinha no topo em vez do centro para não cortar em telas pequenas */
  padding-top: 20px;
  padding-bottom: 20px;
  overflow-y: auto; /* Permite scroll se o conteúdo for maior que a tela */
}

/* 2. Ajusta o conteúdo interno para não grudar no topo e ter respiro */
#modal-checkout .modal-content {
  margin: auto; /* Centraliza horizontalmente */
  max-height: none; /* Remove limites de altura para o scroll do overlay funcionar */
  padding: 30px 20px; /* Mais espaço interno */
}

/* 3. Dá espaço para o campo "Seu Nome" que estava grudado */
#modal-checkout h2 {
  margin-bottom: 20px;
  padding-top: 10px;
}

/* 4. Estilo para o Grid de Endereço (Rua e Número) */
.address-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.address-grid input {
  margin-bottom: 0 !important; /* Remove margem de baixo para não desalinharem */
}

/* 5. Trava o scroll do fundo (Body) quando qualquer modal estiver aberto */
body.modal-open {
  overflow: hidden;
}

.combo-info {
  width: 100%;
  overflow-wrap: break-word; /* Padrão moderno para quebrar palavras longas */
  word-wrap: break-word; /* Suporte para navegadores mais antigos */
}

/* --- MODAL DE ESCOLHAS DE COMBOS --- */
.escolhas-box {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0 !important; /* Remove o padding padrão do modal para fixar header e footer */
  overflow: hidden;
}

.escolhas-box .modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.escolhas-box .modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--azul-escuro);
}

#opcoes-container {
  padding: 20px 30px;
  overflow-y: auto;
  flex-grow: 1;
}

.categoria-section {
  margin-bottom: 25px;
}

.categoria-section h4 {
  margin-bottom: 15px;
  color: var(--azul-escuro);
  border-bottom: 2px solid var(--laranja-suave);
  padding-bottom: 5px;
}

.item-contador {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}

.nome-sabor {
  font-weight: 500;
  flex-grow: 1;
}

.controles-qtd {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-qtd {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul-escuro);
  transition: 0.2s;
}

.btn-qtd:hover {
  background: #f0f0f0;
}

.molho-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed #eee;
}

.molho-row select {
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ddd;
  outline: none;
  font-family: inherit;
  background: #f9f9f9;
}

.escolhas-box .modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #eee;
  text-align: center;
  background: #f9f9f9;
}

#escolhas-status {
  font-size: 0.95rem;
  margin-bottom: 10px;
  font-weight: 600;
  color: #e74c3c;
}

#btn-confirmar-opcoes:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.hero-horario-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.15); /* Fundo levemente translúcido */
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 50px;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  color: #fff; /* Ajuste para a cor do seu texto no hero */
  margin-top: 15px;
  margin-bottom: 20px;
}

.hero-horario-badge .horario-icon {
  stroke: #ff9800; /* Cor de destaque (ex: laranja da paleta) */
}

.hero-horario-badge strong {
  font-weight: 600;
}

/* ==========================================================
   RESPONSIVIDADE (TABLETS E CELULARES)
   ========================================================== */

/* --- TABLETS (Até 1024px) --- */
@media (max-width: 1024px) {
  .navbar {
    padding: 10px 5%;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .menu-section {
    padding: 60px 5%;
  }
}

/* --- CELULARES (Até 768px) --- */
@media (max-width: 768px) {
  /* Navbar: Logo em cima, links embaixo */
  .navbar {
    flex-direction: column;
    padding: 10px;
  }
  .nav-links {
    margin-top: 10px;
    gap: 15px;
  }
  .nav-links li {
    margin-left: 0;
  }

  /* Hero: Ajuste de altura para não cortar texto */
  .hero {
    height: auto;
    min-height: 65vh;
    padding: 120px 20px 40px;
  }
  .hero-content h1 {
    font-size: 1.7rem;
  }
  .btn-pedido {
    width: 100%;
  }

  /* Promoção: Reduz altura no mobile */
  .promo-slider {
    margin-top: 130px;
    padding: 0 15px;
  }
  .promo-placeholder img {
    max-height: 280px;
  }

  /* Cardápio: 1 coluna para fotos maiores */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .product-image-slot {
    height: 200px;
  }

  /* Carrinho: Ocupa a tela inteira */
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  /* Modais e Inputs */
  .modal-content {
    width: 95%;
    padding: 20px;
  }
  .payment-grid,
  .method-grid,
  .modal-actions {
    grid-template-columns: 1fr;
  }
  input,
  textarea {
    font-size: 16px !important;
  } /* Evita zoom no iPhone */

  /* --- FOOTER RESPONSIVO --- */
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }
  .footer-box {
    margin-bottom: 10px;
  }
  .instagram-link {
    justify-content: center;
    width: 100%;
  }

  .br-menu {
    display: none;
  }
}

/* Evita zoom no iPhone */
@media (max-width: 768px) {
  .input-padrao,
  .field-rua input,
  .field-num input,
  #end-comp {
    font-size: 16px !important;
  }
}

/* --- CELULARES PEQUENOS (Até 480px) --- */
@media (max-width: 480px) {
  .logo {
    font-size: 1.4rem;
  }
  .logo-img {
    height: 40px;
  }
  .hero-logo {
    width: 85px;
  }
  .cart-fab {
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
  }
}

#custom-alert {
  z-index: 10000 !important;
}
