/* =====================================================================
   EL SHADAI MARMITARIA — estilos
   ===================================================================== */

:root {
  --laranja: #d9691e;
  --laranja-escuro: #b8501a;
  --verde: #4a7c2f;
  --verde-escuro: #3a6224;
  --creme: #fdf6e3;
  --creme-escuro: #f5e6c8;
  --marrom: #4a2c17;
  --texto: #33261a;
  --branco: #ffffff;
  --sombra: 0 4px 14px rgba(74, 44, 23, 0.15);
  --raio: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Verdana, Arial, sans-serif;
  background: var(--creme);
  color: var(--texto);
  line-height: 1.45;
}

h1, h2, h3 { margin: 0 0 4px; color: var(--marrom); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }

.oculto { display: none !important; }

/* ---------------- HEADER ---------------- */

.topo {
  background: linear-gradient(135deg, var(--laranja), var(--laranja-escuro));
  color: var(--branco);
  padding: 18px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--sombra);
}

.topo-conteudo {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.marca {
  display: flex;
  align-items: center;
  gap: 12px;
}

.marca-emoji { font-size: 2.2rem; }

.topo h1 { color: var(--branco); font-size: 1.4rem; }
.topo p { margin: 0; color: #fff2de; font-size: 0.9rem; }

.btn-carrinho-flutuante {
  position: relative;
  background: var(--verde);
  color: var(--branco);
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 1.4rem;
  box-shadow: var(--sombra);
}

.carrinho-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--laranja-escuro);
  color: var(--branco);
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--branco);
}

/* ---------------- MAIN / CARDÁPIO ---------------- */

main { max-width: 1100px; margin: 0 auto; padding: 20px; }

.intro { text-align: center; margin-bottom: 20px; color: var(--marrom); }

.cardapio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.produto-card {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--creme-escuro);
}

.galeria-thumb {
  border: none;
  padding: 0;
  background: var(--creme-escuro);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.galeria-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.galeria-thumb:hover img { transform: scale(1.06); }

.galeria-video {
  flex-direction: column;
  gap: 2px;
  background: var(--marrom);
  color: var(--branco);
  font-size: 0.7rem;
  text-align: center;
}

.galeria-video .play-icon { font-size: 1.2rem; }
.galeria-video.sem-video { background: #8a7a68; font-size: 0.62rem; }

.produto-info { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.produto-info h3 { font-size: 1.15rem; }

.acompanhamentos { font-size: 0.9rem; color: #5a4632; margin: 0; }

.brinde {
  margin: 0;
  font-size: 0.85rem;
  color: var(--verde-escuro);
  font-weight: bold;
}

.preco-fixo { margin: 4px 0; font-size: 1rem; }

/* ---------------- FORMULÁRIO DE CADA PRODUTO ---------------- */

.produto-form { display: flex; flex-direction: column; gap: 12px; }

.campo { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }

.campo legend { font-weight: bold; padding: 0; margin-bottom: 4px; font-size: 0.9rem; }

.campo input[type="text"],
.campo input[type="tel"],
.campo textarea,
.campo select,
.campo-linha select {
  border: 1px solid #dcc9a3;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--creme);
  color: var(--texto);
}

.campo textarea { resize: vertical; }

.obrigatorio { color: var(--laranja-escuro); }

fieldset.campo { border: none; padding: 0; margin: 0; }

.opcao-radio, .opcao-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 4px 0;
  cursor: pointer;
}

.opcao-radio input, .opcao-checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--laranja-escuro);
  flex-shrink: 0;
}

.campo-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.campo-linha select { flex: 1; max-width: 220px; }

.campo-qtd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.qtd-stepper { display: flex; align-items: center; gap: 8px; }

.qtd-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--laranja);
  background: var(--branco);
  color: var(--laranja-escuro);
  font-size: 1.1rem;
  font-weight: bold;
}

.qtd-stepper input {
  width: 34px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: bold;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: bold;
  text-align: center;
}

.btn-adicionar {
  background: var(--verde);
  color: var(--branco);
  margin-top: 4px;
}
.btn-adicionar:hover { background: var(--verde-escuro); }

.btn-primario { background: var(--laranja); color: var(--branco); }
.btn-primario:hover { background: var(--laranja-escuro); }
.btn-primario:disabled { background: #d8c6a8; cursor: not-allowed; }

.btn-secundario {
  background: var(--creme-escuro);
  color: var(--marrom);
}
.btn-secundario:hover { background: #eddcb4; }

/* ---------------- RODAPÉ ---------------- */

.rodape {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--marrom);
  font-size: 0.9rem;
}

/* ---------------- OVERLAY ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 18, 8, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 30;
}
.overlay.visivel { opacity: 1; pointer-events: auto; }

/* ---------------- PAINEL LATERAL (carrinho / checkout) ---------------- */

.painel-lateral {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: var(--creme);
  box-shadow: -6px 0 20px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.painel-lateral.aberto { transform: translateX(0); }

.painel-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--laranja);
  color: var(--branco);
}
.painel-topo h2 { color: var(--branco); }

.btn-fechar {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.3rem;
}

.painel-corpo {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.painel-rodape {
  padding: 16px 18px;
  border-top: 1px solid var(--creme-escuro);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.carrinho-total-linha {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  color: var(--marrom);
}

.carrinho-vazio { color: #7a6a54; text-align: center; margin-top: 40px; }

.carrinho-item {
  background: var(--branco);
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--sombra);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.carrinho-item-topo {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.carrinho-item p { margin: 0; color: #5a4632; }

.remover-item {
  background: transparent;
  border: none;
  color: var(--laranja-escuro);
  font-size: 1rem;
}

.carrinho-item-subtotal {
  margin-top: 4px !important;
  font-weight: bold;
  color: var(--marrom) !important;
}

.formulario-checkout { gap: 12px; }

.campo-duplo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ajuda { font-size: 0.78rem; color: #7a6a54; margin: -6px 0 0; }

/* ---------------- LIGHTBOX ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.lightbox.aberto { display: flex; }

.lightbox-caixa {
  background: var(--branco);
  border-radius: var(--raio);
  max-width: 640px;
  width: 100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lightbox-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lightbox-corpo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  min-height: 260px;
}

.lightbox-corpo img {
  max-height: 60vh;
  width: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.lightbox-corpo img.zoom {
  transform: scale(2.2);
  cursor: zoom-out;
}

.lightbox-corpo video {
  max-height: 60vh;
  width: 100%;
  background: #000;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: var(--branco);
  border: none;
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  z-index: 2;
}
.lightbox-nav:first-of-type { left: 8px; }
#lightbox-proximo { right: 8px; }

.lightbox-contador {
  text-align: center;
  margin: 0;
  font-size: 0.85rem;
  color: #7a6a54;
}

/* ---------------- TOAST ---------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--marrom);
  color: var(--branco);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 60;
}
.toast.visivel { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- RESPONSIVO ---------------- */

@media (max-width: 480px) {
  .campo-duplo { grid-template-columns: 1fr; }
  .marca-emoji { font-size: 1.8rem; }
  .topo h1 { font-size: 1.15rem; }
}
