/* =========================================================
   Cardápio Digital – paleta "cantina": molho de tomate,
   queijo gratinado, manjericão e massa fresca.
   ========================================================= */
:root {
  --c-primary: #b23a2a;       /* molho de tomate */
  --c-primary-dark: #7e2419;
  --c-accent: #e8a33d;        /* queijo gratinado / mostarda */
  --c-accent-soft: #f7ddb0;
  --c-basil: #4e7d3a;         /* manjericão */
  --c-cream: #fff7ec;         /* massa fresca */
  --c-cream-2: #fbeedb;
  --c-brown: #3b2418;         /* café / chocolate */
  --c-muted: #7b6558;
  --c-card: #ffffff;
  --c-border: #eedfcb;
  --radius: 18px;
  --shadow: 0 6px 22px rgba(59, 36, 24, .10);
  --shadow-lg: 0 14px 40px rgba(59, 36, 24, .18);

  --bs-primary: var(--c-primary);
  --bs-primary-rgb: 178, 58, 42;
  --bs-body-color: var(--c-brown);
  --bs-body-bg: var(--c-cream);
  --bs-link-color: var(--c-primary);
  --bs-link-hover-color: var(--c-primary-dark);
}

html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--c-cream);
  color: var(--c-brown);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, .font-title { font-family: 'Playfair Display', Georgia, serif; }
h1, h2, h3, h4, h5, h6 { color: inherit; }

/* ---------- Botões ---------- */
.btn-primary {
  --bs-btn-bg: var(--c-primary); --bs-btn-border-color: var(--c-primary);
  --bs-btn-hover-bg: var(--c-primary-dark); --bs-btn-hover-border-color: var(--c-primary-dark);
  --bs-btn-active-bg: var(--c-primary-dark); --bs-btn-active-border-color: var(--c-primary-dark);
  --bs-btn-disabled-bg: #c98b82; --bs-btn-disabled-border-color: #c98b82;
  font-weight: 700;
}
.btn-outline-primary {
  --bs-btn-color: var(--c-primary); --bs-btn-border-color: var(--c-primary);
  --bs-btn-hover-bg: var(--c-primary); --bs-btn-hover-border-color: var(--c-primary);
  --bs-btn-active-bg: var(--c-primary-dark); font-weight: 700;
}
.btn-accent {
  background: var(--c-accent); color: var(--c-brown); border: none; font-weight: 800;
}
.btn-accent:hover { background: #d98f22; color: var(--c-brown); }
.btn-basil { background: var(--c-basil); color: #fff; border: none; font-weight: 700; }
.btn-basil:hover { background: #3e6a2d; color: #fff; }
.rounded-pill-btn { border-radius: 50px; padding-left: 1.3rem; padding-right: 1.3rem; }
.text-primary { color: var(--c-primary) !important; }
.text-accent { color: var(--c-accent) !important; }
.text-muted-2 { color: var(--c-muted); }
.form-control:focus, .form-select:focus {
  border-color: var(--c-accent); box-shadow: 0 0 0 .2rem rgba(232, 163, 61, .25);
}
.form-check-input:checked { background-color: var(--c-primary); border-color: var(--c-primary); }

/* ---------- Navbar ---------- */
.navbar-food {
  background: rgba(126, 36, 25, .96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0,0,0,.18);
}
.navbar-food .navbar-brand { font-family: 'Playfair Display', serif; font-weight: 700; color: #fff; }
.navbar-food .navbar-brand img { height: 40px; width: 40px; object-fit: cover; border-radius: 50%; border: 2px solid var(--c-accent); }
.navbar-food .nav-link { color: #fbe9d6; font-weight: 600; }
.navbar-food .nav-link:hover { color: var(--c-accent); }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -8px; background: var(--c-accent); color: var(--c-brown);
  font-size: .72rem; font-weight: 800; border-radius: 50px; min-width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; padding: 0 6px;
}

/* ---------- Hero (fachada) ---------- */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: flex-end;
  background: var(--c-primary-dark) center / cover no-repeat; color: #fff; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40,18,10,.15) 0%, rgba(40,18,10,.55) 55%, rgba(40,18,10,.92) 100%);
}
.hero .hero-content { position: relative; z-index: 2; padding: 90px 0 60px; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 800; text-shadow: 0 4px 18px rgba(0,0,0,.4); }
.hero .lead { font-size: clamp(1rem, 2.4vw, 1.3rem); color: #fde9d2; max-width: 640px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25); padding: .35rem .9rem; border-radius: 50px; font-size: .9rem;
  backdrop-filter: blur(4px);
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-open { background: #7ddc5a; box-shadow: 0 0 0 4px rgba(125,220,90,.25); }
.status-closed { background: #ff6b5b; }

/* Faixa decorativa estilo toalha xadrez */
.checker {
  height: 14px;
  background:
    linear-gradient(45deg, var(--c-primary) 25%, transparent 25%, transparent 75%, var(--c-primary) 75%),
    linear-gradient(45deg, var(--c-primary) 25%, #fff 25%, #fff 75%, var(--c-primary) 75%);
  background-size: 14px 14px; background-position: 0 0, 7px 7px; opacity: .9;
}

/* ---------- Seções ---------- */
.section { padding: 56px 0; }
.section-title { font-weight: 800; color: var(--c-primary-dark); }
.section-title::after {
  content: ""; display: block; width: 64px; height: 4px; border-radius: 4px;
  background: var(--c-accent); margin-top: .5rem;
}
.text-center .section-title::after { margin-left: auto; margin-right: auto; }

/* ---------- Filtro de categorias ---------- */
.cat-bar {
  position: sticky; top: 62px; z-index: 1010; background: var(--c-cream);
  padding: .75rem 0; border-bottom: 1px solid var(--c-border);
}
.cat-scroll { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-pill {
  white-space: nowrap; border: 1.5px solid var(--c-border); background: #fff; color: var(--c-brown);
  border-radius: 50px; padding: .45rem 1.05rem; font-weight: 700; font-size: .92rem; transition: .2s;
}
.cat-pill:hover { border-color: var(--c-accent); }
.cat-pill.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.search-box { position: relative; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.search-box input { padding-left: 40px; border-radius: 50px; border: 1.5px solid var(--c-border); }

/* ---------- Cards de pratos ---------- */
.dish-card {
  background: var(--c-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  height: 100%; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--c-border);
}
.dish-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.dish-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-cream-2); cursor: pointer; }
.dish-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.dish-card:hover .dish-img img { transform: scale(1.06); }
.dish-badge {
  position: absolute; top: 12px; left: 12px; background: var(--c-accent); color: var(--c-brown);
  font-weight: 800; font-size: .75rem; padding: .3rem .7rem; border-radius: 50px; box-shadow: var(--shadow);
}
.dish-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.dish-body h3 { color: var(--c-brown); font-size: 1.18rem; font-weight: 700; margin-bottom: .35rem; }
.dish-desc { color: var(--c-muted); font-size: .92rem; flex: 1; margin-bottom: .9rem; }
.dish-price { font-size: 1.3rem; font-weight: 800; color: var(--c-primary); }
.qty-stepper {
  display: inline-flex; align-items: center; background: var(--c-cream-2); border-radius: 50px; overflow: hidden;
}
.qty-stepper button {
  border: none; background: transparent; width: 36px; height: 36px; font-size: 1.1rem; color: var(--c-primary);
  font-weight: 800;
}
.qty-stepper button:hover { background: var(--c-accent-soft); }
.qty-stepper span { min-width: 28px; text-align: center; font-weight: 800; }
.dish-card.unavailable { opacity: .6; }
.dish-card.unavailable .dish-img::after {
  content: "Esgotado hoje"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(59,36,24,.55); color: #fff; font-weight: 800; font-size: 1.2rem;
}

/* Destaques (carrossel horizontal) */
.highlight-scroll { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.highlight-scroll > * { scroll-snap-align: start; flex: 0 0 min(300px, 80%); }

/* ---------- Carrinho ---------- */
.offcanvas-cart { width: 420px !important; max-width: 100%; background: var(--c-cream); }
.offcanvas-cart .offcanvas-header { background: var(--c-primary-dark); color: #fff; }
.cart-item {
  display: flex; gap: .8rem; align-items: center; background: #fff; border-radius: 14px; padding: .6rem;
  margin-bottom: .6rem; border: 1px solid var(--c-border);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.cart-item .name { font-weight: 700; line-height: 1.2; }
.cart-empty { text-align: center; color: var(--c-muted); padding: 50px 10px; }
.cart-empty i { font-size: 3.5rem; color: var(--c-accent); }

.floating-cart {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1030; display: none;
  background: var(--c-primary); color: #fff; border-radius: 16px; padding: .85rem 1.1rem;
  box-shadow: var(--shadow-lg); border: none; font-weight: 800; text-align: left;
  animation: slideUp .3s ease;
}
.floating-cart.show { display: flex; align-items: center; justify-content: space-between; }
@keyframes slideUp { from { transform: translateY(120%); } to { transform: translateY(0); } }
@media (min-width: 992px) { .floating-cart { left: auto; right: 24px; bottom: 24px; width: 360px; } }

/* ---------- Checkout / Pedido ---------- */
.page-header {
  background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary)); color: #fff; padding: 96px 0 30px;
}
.box {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem;
  border: 1px solid var(--c-border);
}
.option-card {
  border: 2px solid var(--c-border); border-radius: 14px; padding: .9rem 1rem; cursor: pointer; transition: .2s;
  display: flex; align-items: center; gap: .7rem; background: #fff; height: 100%;
}
.option-card i { font-size: 1.5rem; color: var(--c-primary); }
.btn-check:checked + .option-card { border-color: var(--c-primary); background: #fff3ef; }
.summary-line { display: flex; justify-content: space-between; margin-bottom: .35rem; }
.summary-total { font-size: 1.35rem; font-weight: 800; color: var(--c-primary); }
.pix-box { text-align: center; }
.pix-box #qrcode { display: inline-block; padding: 14px; background: #fff; border-radius: 14px; border: 2px dashed var(--c-accent); }
.pix-box #qrcode img, .pix-box #qrcode canvas { max-width: 100%; height: auto !important; }
.pix-code { font-family: monospace; font-size: .78rem; word-break: break-all; background: var(--c-cream-2); border-radius: 10px; padding: .6rem; }
.order-steps { display: flex; justify-content: space-between; position: relative; margin: 1.2rem 0; }
.order-steps::before { content: ""; position: absolute; top: 16px; left: 6%; right: 6%; height: 3px; background: var(--c-border); }
.order-step { position: relative; text-align: center; flex: 1; font-size: .75rem; color: var(--c-muted); }
.order-step .dot {
  width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--c-border);
  display: flex; align-items: center; justify-content: center; margin: 0 auto .3rem; position: relative; z-index: 1;
}
.order-step.done .dot { background: var(--c-basil); border-color: var(--c-basil); color: #fff; }
.order-step.done { color: var(--c-brown); font-weight: 700; }

/* ---------- Rodapé ---------- */
.footer { background: var(--c-brown); color: #e9d6c3; padding: 44px 0 90px; }
.footer a { color: var(--c-accent); text-decoration: none; }
.footer h5 { color: #fff; }
.info-card { background: #fff; border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); height: 100%; border: 1px solid var(--c-border); }
.info-card i { font-size: 1.8rem; color: var(--c-primary); }

/* Modal prato */
.modal-content { border-radius: var(--radius); overflow: hidden; border: none; }
.modal-dish-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

/* Toast */
.toast-food { background: var(--c-basil); color: #fff; border-radius: 12px; }

/* Botão instalar PWA */
#installBtn { display: none; }

@media (max-width: 575.98px) {
  .section { padding: 40px 0; }
  .hero { min-height: 68vh; }
  .dish-body h3 { font-size: 1.05rem; }
  .dish-price { font-size: 1.12rem; }
  .cat-bar { top: 56px; }
  .order-step { font-size: .64rem; }
  .order-step .dot { width: 28px; height: 28px; }
  .order-steps::before { top: 13px; }
}
