/* =========================================================
   Restaurante da Mary — estilos
   Paleta: rosa da Mary (uniforme/logo) + creme + marrom café
   Estrutura: tokens → base → componentes → seções → responsivo
   ========================================================= */

:root {
  --cor-primaria: #E80C75;        /* rosa da Mary (logo, detalhes grandes) */
  --cor-primaria-texto: #D00A69;  /* rosa um tom abaixo: texto pequeno com contraste AA */
  --cor-primaria-escura: #B5095B;
  --cor-secundaria: #3E2723;      /* marrom café */
  --cor-fundo: #FFF8F0;           /* creme */
  --cor-fundo-alt: #FBEDE1;       /* creme mais quente, seções alternadas */
  --cor-texto: #3A2A22;
  --cor-texto-claro: #6E5A4E;
  --cor-whatsapp: #15803D;        /* verde WhatsApp escurecido: texto branco com contraste AA */
  --cor-whatsapp-escuro: #116B33;
  --fonte-titulo: 'Fraunces', Georgia, serif;
  --fonte-corpo: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
  --raio: 14px;
  --sombra: 0 10px 30px rgba(62, 39, 35, 0.12);
  --altura-header: 72px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fonte-corpo);
  font-size: 1rem;
  color: var(--cor-texto);
  background: var(--cor-fundo);
  line-height: 1.6;
  overflow-x: hidden; /* rede de segurança contra qualquer vazamento lateral */
}

h1, h2, h3 { font-family: var(--fonte-titulo); font-weight: 700; margin: 0 0 .5em; color: var(--cor-secundaria); line-height: 1.2; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
address { font-style: normal; }

/* compensa o header fixo ao pular para uma seção pelo menu */
section[id] { scroll-margin-top: var(--altura-header); }

/* foco visível só para teclado */
:focus-visible { outline: 3px solid var(--cor-primaria-texto); outline-offset: 3px; border-radius: 6px; }
.hero :focus-visible,
.delivery-note :focus-visible,
.site-footer :focus-visible,
.whatsapp-float:focus-visible { outline-color: #fff; }

/* texto só para leitores de tela */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--cor-secundaria); color: #fff; font-weight: 700;
  padding: 12px 18px; border-radius: 10px;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }

.btn-whatsapp {
  background: var(--cor-whatsapp);
  color: #fff;
  box-shadow: 0 8px 20px rgba(21, 128, 61, .28);
}
.btn-whatsapp:hover { background: var(--cor-whatsapp-escuro); box-shadow: 0 10px 24px rgba(21, 128, 61, .36); }

.btn-outline {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.15); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 100;
  background: rgba(255, 248, 240, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(62,39,35,.08);
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--altura-header);
  padding-top: 8px;
  padding-bottom: 8px;
}
.logo {
  font-family: var(--fonte-titulo);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cor-secundaria);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.logo-accent { color: var(--cor-primaria); }
.logo-img {
  width: auto;
  height: 56px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  margin-right: 12px;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--cor-texto);
  position: relative;
  transition: color .15s ease;
}
.main-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 10px;
  height: 2px; background: var(--cor-primaria-texto);
  transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.main-nav a:hover { color: var(--cor-primaria-texto); }
.main-nav a:hover::after { transform: scaleX(1); }

.header-cta { flex-shrink: 0; padding: 10px 20px; font-size: .9rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  margin-right: -8px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle { flex-shrink: 0; }
.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--cor-secundaria);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
/* ícone vira "X" quando o menu está aberto */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  min-height: 88svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #241713 center / cover;
  background-image: url('../images/hero-bg.jpg');
  color: #fff;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(62,39,35,.55) 0%, rgba(62,39,35,.78) 100%);
}
.hero-content { position: relative; z-index: 2; padding-top: 60px; padding-bottom: 60px; }
.hero-logo { margin: 0 0 .5em; line-height: 0; }
.hero-logo img {
  width: clamp(200px, 26vw, 320px);
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
}
.hero-slogan {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  max-width: 22ch;
  color: #fff;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
  margin-bottom: .45em;
}
.hero-sub {
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
  max-width: 46ch;
  color: #FDF1E6;
  margin-bottom: 1.6em;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 1.6em; }
.hero-hours { font-size: .9rem; color: #F3DFCB; margin: 0; }

/* ---------- Seções genéricas ---------- */
.section { padding: 90px 0; }
.section-alt { background: var(--cor-fundo-alt); }
.section-kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  font-size: .82rem;
  color: var(--cor-primaria-texto);
  margin-bottom: .6em;
}
.section h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); text-wrap: balance; }
.section-lead { color: var(--cor-texto-claro); max-width: 620px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Sobre ---------- */
.about-text-only {
  max-width: 760px;
  text-align: center;
}
.about-text-only p:not(.section-kicker) { text-align: left; }

/* ---------- Cardápio (cards de preço) ---------- */
.menu-grid {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.menu-card {
  background: #fff;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 22px 24px;
}
.menu-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.menu-card-head h3 {
  font-size: 1.05rem;
  margin: 0;
}
.menu-price {
  font-weight: 700;
  color: var(--cor-primaria-escura);
  font-size: 1.05rem;
  white-space: nowrap;
}
.menu-price small { font-size: .75rem; font-weight: 600; }
.menu-card p { color: var(--cor-texto-claro); font-size: .92rem; margin: 0; }

.delivery-note {
  margin-top: 36px;
  padding: 24px 28px;
  background: var(--cor-secundaria);
  color: #F3E4D6;
  border-radius: var(--raio);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.delivery-note p { margin: 0; font-size: 1rem; }
.delivery-note strong { color: #fff; }
.delivery-note-actions { display: flex; gap: 14px; flex-wrap: wrap; flex-shrink: 0; }

/* ---------- Galeria de pratos ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.gallery-grid-3 { max-width: 980px; margin-left: auto; margin-right: auto; }
.gallery-item {
  margin: 0;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
  background: #fff;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform .35s ease;
}
.gallery-grid-3 .gallery-item img { aspect-ratio: 3/4; }
.gallery-item figcaption,
.ambiente-item figcaption {
  padding: 12px 14px;
  font-weight: 700;
  font-size: .92rem;
  color: var(--cor-secundaria);
}
/* zoom leve só em quem tem mouse (evita "zoom preso" no toque) */
@media (hover: hover) {
  .gallery-item:hover img { transform: scale(1.05); }
}

/* ---------- Carrossel do Ambiente (rolagem automática) ---------- */
.ambiente-carousel {
  margin-top: 40px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}
.ambiente-track {
  display: flex;
  width: max-content;
  animation: ambiente-scroll 28s linear infinite;
  will-change: transform;
}
/* pausa: mouse por cima, toque (classe via JS) ou fora da tela */
.ambiente-carousel:hover .ambiente-track,
.ambiente-carousel.is-paused .ambiente-track { animation-play-state: paused; }
.ambiente-item {
  flex: 0 0 auto;
  width: 300px;
  /* margem (e não gap) para o loop de -50% encaixar sem "pulo" */
  margin: 0 24px 0 0;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
  background: #fff;
}
.ambiente-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
@keyframes ambiente-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Equipe ---------- */
.team-photo {
  margin: 40px auto 0;
  max-width: 760px;
  text-align: center;
}
.team-photo img {
  width: 100%;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
}
.team-photo figcaption {
  margin-top: 16px;
  font-weight: 700;
  color: var(--cor-secundaria);
  font-size: 1rem;
}

/* ---------- Localização ---------- */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: stretch;
}
.info-list { list-style: none; margin: 24px 0; padding: 0; }
.info-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(62,39,35,.1);
}
.info-list strong { color: var(--cor-primaria-texto); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.info-list .tel-link {
  display: inline-block;
  color: var(--cor-primaria-escura);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  /* área de toque de 48px sem mexer no layout */
  padding: 15px 6px;
  margin: -15px -6px;
}
.info-list .tel-link:hover { color: var(--cor-secundaria); }
.location-map {
  position: relative;
  min-height: 360px;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
  background: #E8E2D8;
}
.location-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}
.location-map-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: linear-gradient(to top, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 35%);
  border-radius: var(--raio);
}
.location-map-link span {
  background: var(--cor-primaria-texto);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--sombra);
  transition: transform .15s ease, background-color .15s ease;
}
.location-map-link:hover span { background: var(--cor-primaria-escura); transform: translateY(-2px); }
.location-map-link:focus-visible { outline-offset: -4px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cor-secundaria);
  color: #F3E4D6;
  padding: 50px 0 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.site-footer p { margin: 0 0 .5em; }
.footer-logo { margin-bottom: 12px !important; }
.footer-logo img { width: 130px; height: auto; }
.footer-title {
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .85rem;
  margin-bottom: .7em !important;
}
.footer-hours p:not(.footer-title) { color: #F3E4D6; }
.footer-social { display: flex; gap: 20px; align-items: flex-start; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.footer-social a:hover { color: #fff; text-decoration-color: currentColor; }
.footer-copy { text-align: center; font-size: .82rem; color: #C9B7A8; margin: 18px 20px 0; }

/* ---------- Botão flutuante WhatsApp ---------- */
.whatsapp-float {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--cor-whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  z-index: 200;
  transition: transform .15s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.whatsapp-float svg { width: 30px; height: 30px; }
.whatsapp-float:hover { transform: scale(1.08); background: var(--cor-whatsapp-escuro); }
.whatsapp-float:active { transform: scale(.96); }

/* =========================================================
   Responsivo (desktop → tablet → celular)
   ========================================================= */

/* Tablet: o menu vira hambúrguer aqui (antes, entre 720 e 960px, o botão
   "Pedir no WhatsApp" era empurrado para fora da tela) */
@media (max-width: 960px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cor-fundo);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    box-shadow: 0 12px 24px rgba(62,39,35,.10);
    transition: max-height .3s ease, visibility 0s linear .3s;
  }
  .main-nav.open {
    max-height: 360px;
    visibility: visible;
    transition: max-height .3s ease, visibility 0s;
  }
  .main-nav a {
    justify-content: center;
    min-height: 52px;
    border-top: 1px solid rgba(62,39,35,.06);
  }
  .main-nav a::after { display: none; }
  .nav-toggle { display: flex; }
  .header-cta { margin-left: auto; }
}

@media (max-width: 900px) {
  .location-grid { grid-template-columns: 1fr; gap: 36px; }
  .location-map { min-height: 300px; }
  .gallery-grid,
  .gallery-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .delivery-note { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  :root { --altura-header: 64px; }
  .hero { min-height: 92vh; min-height: 92svh; text-align: center; }
  .hero-slogan, .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-logo img { margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .section { padding: 72px 0; }
  .ambiente-item { width: 220px; margin-right: 16px; }
  /* espaço para o botão flutuante não cobrir o rodapé */
  .site-footer { padding-bottom: 96px; }
}

@media (max-width: 560px) {
  .header-cta { display: none; } /* o botão flutuante já cumpre esse papel */
  .gallery-grid,
  .gallery-grid-3 { grid-template-columns: 1fr; max-width: 420px; }
  .gallery-grid-3 .gallery-item img { aspect-ratio: 4/3; }
  .hero-actions .btn { width: 100%; max-width: 320px; }
}

@media (max-width: 480px) {
  .menu-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .delivery-note { padding: 22px 20px; }
  .delivery-note-actions,
  .delivery-note-actions .btn { width: 100%; }
}

@media (max-width: 440px) {
  .logo-img { height: 48px; }
}

@media (max-width: 360px) {
  .container { padding: 0 16px; }
  .logo-img { height: 44px; }
}

/* Telas muito largas: um pouco mais de respiro */
@media (min-width: 1800px) {
  .container { max-width: 1280px; }
}

/* Quem pediu "reduzir movimento" no sistema: sem animações */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .ambiente-track { animation: none; transform: none; }
  .ambiente-carousel { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-mask-image: none; mask-image: none; }
  .ambiente-item { scroll-snap-align: start; }
  .ambiente-item[aria-hidden="true"] { display: none; }
}
