/* =============================================================
   loja.css — Estilos exclusivos da página de loja/cardápio
   Depende de: styles.css (variáveis :root já definidas lá)
   ============================================================= */

/* ── LAYOUT ── */
body { padding-top: var(--header-h); }

/* ── HEADER (override da loja) ── */
:root { --header-h: 80px; }

.header {
  height: var(--header-h);
  background: rgba(17,17,17,0.95);
  backdrop-filter: blur(10px);
  padding: 0 16px;
}

.logo { height: 28px; }

.cart-btn {
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cart-count {
  background: #fff;
  color: var(--text);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-count.hidden { display: none; }

/* ── PAGE TITLE ── */
.page-title { background: var(--primary); color: var(--secondary); padding: 28px 16px 24px; text-align: center; }
.page-title h1 { font-size: 1.6rem; letter-spacing: 0.02em; margin-bottom: 4px; }
.page-title p  { font-size: 0.9rem; opacity: 0.7; }

/* ── TABS ── */
.tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid #e8e3de;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: center;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  background: none;
  border-top: none; border-left: none; border-right: none;
  letter-spacing: 0.03em;
}
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ── SEÇÃO DO MENU ── */
.menu-section { padding: 28px 16px 12px; }
.menu-section h2 { font-size: 1rem; color: var(--text); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.menu-section .section-desc { font-size: 0.82rem; color: #888; margin-bottom: 16px; }

/* ── ITEM DO CARDÁPIO ── */
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0ece8;
  text-align: justify;
}
.item:last-child { border-bottom: none; }

.item-img { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; background: #f0ece8; flex-shrink: 0; }
.item-img--placeholder { background: #ece8e4; }

.item-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-name  { font-size: 0.92rem; font-weight: 700; color: var(--primary); }
.item-desc  { font-size: 0.75rem; color: #888; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price     { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.item-price-old { font-size: 0.72rem; color: #bbb; text-decoration: line-through; margin-right: 4px; }
.item-action    { flex-shrink: 0; }

.add-btn {
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  min-width: 32px; min-height: 32px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.qty-ctrl { display: flex; align-items: center; gap: 6px; }

.qty-btn {
  background: var(--secondary);
  border: 1px solid #e0dbd5;
  color: var(--text);
  border-radius: 50%;
  width: 28px; height: 28px;
  min-width: 28px; min-height: 28px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  font-family: Arial, sans-serif;
  padding-bottom: 1px;
}

.qty-num { font-size: 0.9rem; font-weight: bold; min-width: 16px; text-align: center; color: var(--primary); }

/* ── CART DRAWER ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.overlay.open { opacity: 1; pointer-events: auto; }

.drawer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg); border-radius: 20px 20px 0 0; padding: 20px 16px 32px; z-index: 2100; max-height: 80vh; overflow-y: auto; transform: translateY(100%); transition: transform 0.3s ease; }
.drawer.open { transform: translateY(0); }
.drawer-handle { width: 40px; height: 4px; background: #ddd; border-radius: 2px; margin: 0 auto 20px; }
.drawer h2 { font-size: 1.1rem; color: var(--primary); margin-bottom: 16px; }

.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0ece8; gap: 8px; }
.cart-item:last-of-type { border-bottom: none; }
.cart-item-name  { font-size: 0.88rem; font-weight: bold; flex: 1; }
.cart-item-price { font-size: 0.85rem; color: var(--text); font-weight: bold; white-space: nowrap; }
.cart-empty      { text-align: center; color: #bbb; font-size: 0.9rem; padding: 24px 0; }

.cart-total { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 20px; padding-top: 12px; border-top: 2px solid var(--secondary); }
.cart-total span       { font-weight: bold; font-size: 1rem; }
.cart-total .total-price { color: var(--text); font-size: 1.1rem; }

/* ── FLOATING CART ── */
.floating-cart {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 16px;
  font-weight: bold;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s;
}
.floating-cart:active { transform: scale(0.96); }
.floating-total { color: #f4d090; font-size: 0.9rem; }

.hidden { display: none !important; }

/* ── FOOTER ── */
footer { background: var(--secondary); text-align: center; padding: 20px 16px 100px; font-size: 0.82rem; color: #888; }
footer a { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; text-decoration: none; color: #888; }
footer img { width: 18px; vertical-align: middle; }

@media (min-width: 600px) {
  .menu-section { padding: 32px 24px 16px; max-width: 640px; margin: 0 auto; }
  .page-title   { padding: 36px 24px 28px; }
}
/* ═══════════════════════════════════════════════════════════════
   DESCONTO PROGRESSIVO
   ═══════════════════════════════════════════════════════════════ */

#progresso-desconto         { background: #fff; padding: 0 20px; }
#progresso-desconto[hidden] { display: none; }

.pd-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 14px 16px 12px;
  margin: 16px auto;
  max-width: 640px;
}

/* Título / mensagem */
.pd-titulo {
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
  line-height: 1.35;
}
.pd-titulo strong { color: var(--primary); }

/* Trilha */
.pd-track {
  position: relative;
  width: 100%;
  height: 10px;
  background: #ececec;
  border-radius: 999px;
  overflow: hidden;
}

/* Fill — persiste no DOM para o transition funcionar */
.pd-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--text), #a52a2a);
  border-radius: 999px;
  width: 0%;
  transition: width 0.8s cubic-bezier(.22,1,.36,1);
}

.pd-fill--done { background: linear-gradient(90deg, var(--text), #8b0000); }

/* Marcos abaixo da barra */
.pd-marcos {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.pd-marco {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.pd-marco-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: #bbb;
  transition: color 0.3s;
}

.pd-marco-n {
  font-size: 0.65rem;
  color: #ccc;
  transition: color 0.3s;
}

.pd-marco.ativo .pd-marco-pct { color: var(--text); }
.pd-marco.ativo .pd-marco-n   { color: #888; }

/* ── Toast de comemoração ── */
#pd-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
#pd-toast strong { color: #f4d090; }
#pd-toast.pd-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Linha de desconto dentro do drawer ── */
.cart-desconto-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 4px;
  font-size: 0.82rem;
  color: #888;
  border-top: 1px dashed #f0ece8;
  margin-top: 4px;
}
.cart-desconto-linha .desconto-valor {
  color: #2e7d32;
  font-weight: 700;
}
/* =============================================================
   MODAL DE IMAGEM DO PRODUTO (lightbox)
   Adicione este bloco ao seu CSS principal.
   ============================================================= */

.item-img--clicavel {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.item-img--clicavel:hover {
  opacity: 0.85;
}

.img-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.img-modal.open {
  opacity: 1;
  visibility: visible;
}

.img-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;

  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.img-modal.open .img-modal-content {
  transform: scale(1);
}

.img-modal-img {
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  display: block;
}

.img-modal-info {
  padding: 16px 20px 20px;
}

.img-modal-nome {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.img-modal-desc {
  font-size: 0.95rem;
  color: #555;
  margin: 0;
  line-height: 1.4;
}

.img-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
}

.img-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Trava o scroll do body quando o modal está aberto (opcional) */
body.img-modal-aberto {
  overflow: hidden;
}