/* ==========================================================================
   Delícia de Minas — Queijos e Laticínios Artesanais
   Design system rústico: tons terrosos + preto + dourado.
   BEM (`.bloco__elemento--modificador`), zero frameworks, sem build.
   Breakpoints: 1024 / 900 / 768.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens (CONTRATO FIXO — valores exatos, não alterar)
   -------------------------------------------------------------------------- */
:root {
  --preto:#1f1a16; --terra:#6b4a2f; --terra-clara:#a0763f; --dourado:#c9a227; --creme:#f5efe4; --creme-escuro:#e9dfcc; --texto:#2b241d;
  --fonte-titulo:'Fraunces',Georgia,serif; --fonte-corpo:'Inter',system-ui,sans-serif;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* compensa o header fixo nas âncoras */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--fonte-corpo);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto);
  background-color: var(--creme);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4 {
  font-family: var(--fonte-titulo);
  color: var(--preto);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--terra);
}

button {
  font-family: var(--fonte-corpo);
}

::selection {
  background-color: var(--dourado);
  color: var(--preto);
}

/* --------------------------------------------------------------------------
   3. Acessibilidade (base)
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 2000;
  padding: 0.75rem 1.25rem;
  background-color: var(--preto);
  color: var(--creme);
  text-decoration: none;
  border-radius: 0 0 0.75rem 0;
}

.skip-link:focus {
  left: 0;
  color: var(--creme);
}

.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;
}

:focus-visible {
  outline: 3px solid var(--dourado);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. Layout base
   -------------------------------------------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5.5rem 0;
}

.section__title {
  text-align: center;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  color: var(--preto);
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.section__title::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--dourado);
  margin: 0.9rem auto 0;
}

.section__subtitle {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
  color: var(--terra);
}

/* Ritmo alternado de fundos: creme → creme-escuro → creme → creme-escuro */
#produtos,
#contato {
  background-color: var(--creme-escuro);
}

#sobre p {
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
}

#sobre p:last-of-type {
  margin-bottom: 2rem;
}

#sobre ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 auto 2.5rem;
  padding: 0;
}

#sobre ul li {
  background-color: var(--creme);
  border-left: 3px solid var(--dourado);
  border-radius: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  color: var(--preto);
}

#sobre img {
  display: block;
  margin: 0 auto;
  width: min(100%, 720px);
  border-radius: 1rem;
  box-shadow: 0 14px 32px rgba(31, 26, 22, 0.16);
}

/* --------------------------------------------------------------------------
   5. Header fixo + navegação
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(245, 239, 228, 0.88); /* --creme translúcido */
  border-bottom: 1px solid rgba(160, 118, 63, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Variante de rolagem — classe .scrolled adicionada por JS no #menu-fixo */
.header.scrolled {
  background-color: rgba(245, 239, 228, 0.97);
  box-shadow: 0 4px 20px rgba(31, 26, 22, 0.12);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
}

.header__logo {
  font-family: var(--fonte-titulo);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--preto);
  text-decoration: none;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.header__logo small {
  display: block;
  font-family: var(--fonte-corpo);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra-clara);
}

.nav {
  margin-left: auto;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--texto);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 1px;
  background-color: var(--dourado);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav__link:hover {
  color: var(--preto);
}

.nav__link:hover::after {
  transform: scaleX(1);
}

/* CTA do menu — pílula dourada destacada */
.nav__link--cta {
  background-color: var(--dourado);
  color: var(--preto);
  font-weight: 600;
  border-radius: 999px;
}

.nav__link--cta::after {
  display: none;
}

.nav__link--cta:hover {
  background-color: var(--terra-clara);
  color: var(--creme);
  box-shadow: 0 6px 16px rgba(31, 26, 22, 0.22);
}

/* Botão hambúrguer (3 barras) — visível apenas no mobile */
#menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background-color: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
}

#menu-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  background-color: var(--preto);
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
}

#menu-toggle:hover span {
  background-color: var(--dourado);
}

#menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

#menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

#menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding: 7.5rem 0 6rem;
  background: linear-gradient(135deg, var(--preto) 0%, var(--terra) 100%);
  color: var(--creme);
  text-align: center;
}

.hero h1 {
  color: var(--creme);
  font-size: clamp(2.1rem, 4.6vw, 3.25rem);
  max-width: 20ch;
  margin: 0 auto 1.25rem;
  text-wrap: balance;
}

.hero p {
  color: var(--creme);
  font-size: 1.1rem;
  max-width: 58ch;
  margin: 0 auto 2.25rem;
  opacity: 0.92;
}

/* CTA alinhado em linha, ancorados na esquerda */
.hero .btn {
  margin: 0;
}

.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

.hero #hero-img {
  display: block;
  width: min(100%, 520px);
  border-radius: 1rem;
  box-shadow: 0 18px 44px rgba(31, 26, 22, 0.4);
  margin: 2.5rem auto 0;
}

/* --------------------------------------------------------------------------
   7. Botões
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--fonte-corpo);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--preto);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease,
    border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn--primario {
  background-color: var(--dourado);
  color: var(--preto);
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35);
}

.btn--primario:hover {
  background-color: var(--terra-clara);
  color: var(--creme);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(31, 26, 22, 0.28);
}

.btn--contorno {
  background-color: transparent;
  color: var(--creme);
  border-color: var(--dourado);
}

.btn--contorno:hover {
  background-color: var(--dourado);
  color: var(--preto);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   8. Produtos — filtros e grade
   -------------------------------------------------------------------------- */
#filtros,
.filtro {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.filtro__botao {
  padding: 0.6rem 1.3rem;
  border: 1px solid rgba(107, 74, 47, 0.45);
  border-radius: 999px;
  background-color: transparent;
  color: var(--terra);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease,
    border-color 0.25s ease, box-shadow 0.25s ease;
}

.filtro__botao:hover {
  border-color: var(--dourado);
  color: var(--preto);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.25);
}

.filtro__botao--ativo {
  background-color: var(--dourado);
  border-color: var(--dourado);
  color: var(--preto);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

#grade-produtos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   9. Card de produto
   -------------------------------------------------------------------------- */
.produto-card {
  display: flex;
  flex-direction: column;
  background-color: var(--creme);
  border: 1px solid rgba(107, 74, 47, 0.22);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.produto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(31, 26, 22, 0.16);
}

/* Imagem 4:3 cobrindo o espaço, escala suave no hover */
.produto-card__imagem {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.produto-card__imagem:hover {
  transform: scale(1.04);
}

.produto-card:hover .produto-card__imagem {
  transform: scale(1.04);
}

.produto-card__categoria {
  align-self: flex-start;
  margin: 1rem 1.25rem 0;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  background-color: rgba(160, 118, 63, 0.18);
  color: var(--terra);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.produto-card__nome {
  margin: 0.6rem 1.25rem 0;
  font-family: var(--fonte-titulo);
  font-size: 1.3rem;
  color: var(--preto);
}

.produto-card__descricao {
  margin: 0.4rem 1.25rem 0;
  font-size: 0.95rem;
  color: var(--texto);
  flex-grow: 1;
}

.produto-card__acao {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.45rem;
  margin: 1rem 1.25rem 1.25rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  background-color: var(--dourado);
  color: var(--preto);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease,
    box-shadow 0.25s ease, transform 0.25s ease;
}

.produto-card__acao:hover {
  background-color: var(--terra);
  color: var(--creme);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 26, 22, 0.25);
}

/* --------------------------------------------------------------------------
   10. Depoimentos
   -------------------------------------------------------------------------- */
.depoimento-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.75rem;
  background-color: var(--creme-escuro);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(31, 26, 22, 0.06);
  color: var(--texto);
}

/* Estrelas destacadas em dourado */
.depoimento-card__estrelas {
  color: var(--dourado);
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  line-height: 1;
}

.depoimento-card p,
.depoimento-card blockquote {
  margin: 0;
  font-size: 0.98rem;
}

.depoimento-card footer {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--terra);
}

.depoimento-card strong {
  display: block;
  font-family: var(--fonte-titulo);
  font-size: 1.05rem;
  color: var(--preto);
}

/* --------------------------------------------------------------------------
   11. Contato — mini-cards e formulário
   -------------------------------------------------------------------------- */
.contato-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem;
  background-color: var(--creme);
  border: 1px solid rgba(107, 74, 47, 0.2);
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(31, 26, 22, 0.05);
}

.contato-card strong {
  font-family: var(--fonte-titulo);
  font-size: 1.1rem;
  color: var(--preto);
}

.contato-card a {
  color: var(--terra);
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}

.contato-card a:hover {
  color: var(--dourado);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contato-card small {
  color: var(--terra-clara);
}

.form-contato {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
  padding: 2rem;
  background-color: #fff; /* campos sobre fundo branco (exceção permitida) */
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(31, 26, 22, 0.1);
}

.form-contato label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--preto);
}

.form-contato input,
.form-contato textarea,
.form-contato select {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: #fff;
  border: 1px solid var(--terra-clara);
  border-radius: 0.6rem;
  color: var(--texto);
  font-family: var(--fonte-corpo);
  font-size: 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-contato input::placeholder,
.form-contato textarea::placeholder {
  color: rgba(43, 36, 29, 0.5);
}

.form-contato input:focus,
.form-contato textarea:focus,
.form-contato select:focus {
  outline: none;
  border-color: var(--dourado);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.form-contato textarea {
  min-height: 140px;
  resize: vertical;
}

.form-contato .btn {
  align-self: flex-start;
}

#form-feedback {
  margin: 0;
  padding: 0.85rem 1.1rem;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  background-color: rgba(107, 74, 47, 0.1);
  color: var(--terra);
  border-left: 3px solid var(--dourado);
}

#form-feedback:empty {
  display: none;
}

/* --------------------------------------------------------------------------
   12. Rodapé
   -------------------------------------------------------------------------- */
.rodape {
  padding: 3.5rem 0 2.25rem;
  background-color: var(--preto);
  color: var(--creme);
  text-align: center;
}

.rodape a {
  color: var(--dourado);
  text-decoration: none;
  transition: color 0.25s ease;
}

.rodape a:hover {
  color: var(--creme);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.rodape strong {
  color: var(--creme);
}

.rodape .container > * {
  margin-bottom: 1.1rem;
}

.rodape .container > *:last-child {
  margin-bottom: 0;
}

.rodape address {
  font-style: normal;
  color: rgba(245, 239, 228, 0.85);
}

.rodape p,
.rodape li {
  color: rgba(245, 239, 228, 0.85);
}

.rodape ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

/* --------------------------------------------------------------------------
   13. Animações de entrada (IntersectionObserver adiciona .reveal--ativo)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal--ativo {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   14. Responsivo — breakpoints 1024 / 900 / 768
   -------------------------------------------------------------------------- */

/* ------------------------------------------------------------- 1024px */
@media (max-width: 1024px) {
  #grade-produtos {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero {
    padding: 6rem 0 5rem;
  }

  .section {
    padding: 4.5rem 0;
  }

  .section__subtitle {
    margin-bottom: 2.5rem;
  }
}

/* ------------------------------------------------------------- 900px */
@media (max-width: 900px) {
  .container,
  .header__inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  #grade-produtos {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: clamp(2rem, 4.2vw, 2.75rem);
  }

  .hero p {
    font-size: 1.05rem;
  }
}

/* ------------------------------------------------------------- 768px */
@media (max-width: 768px) {
  /* Header: hambúrguer visível e menu vira dropdown oculto */
  #menu-toggle {
    display: flex;
  }

  .nav {
    margin-left: 0;
  }

  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0;
    padding: 0 1.25rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    background-color: rgba(245, 239, 228, 0.98);
    box-shadow: 0 18px 30px rgba(31, 26, 22, 0.18);
    transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease, visibility 0s linear 0.35s;
  }

  /* Classe .aberto adicionada por JS via #menu-toggle */
  .nav__menu.aberto {
    max-height: 420px;
    opacity: 1;
    padding: 0.6rem 1.25rem 0.9rem;
    border-bottom: 1px solid rgba(160, 118, 63, 0.2);
    visibility: visible;
    transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease, visibility 0s linear 0s;
  }

  .nav__menu .nav__link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
  }

  .nav__menu .nav__link--cta {
    margin-top: 0.5rem;
    text-align: center;
  }

  .header__inner {
    padding: 0.75rem 1.25rem;
    gap: 1rem;
  }

  /* Hero mais compacto e centralizado */
  .hero {
    padding: 4.5rem 0 3.5rem;
    text-align: center;
  }

  .hero h1,
  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero .btn {
    margin-left: 0.4rem;
    margin-right: 0.4rem;
  }

  /* Grade de produtos em 1 coluna */
  #grade-produtos {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section__subtitle {
    margin-bottom: 2rem;
  }

  #filtros,
  .filtro {
    gap: 0.6rem;
    margin-bottom: 2rem;
  }

  /* Depoimentos e contato em 1 coluna */
  #depoimentos .container:has(> .depoimento-card),
  #depoimentos .container > div:has(> .depoimento-card),
  #contato .container:has(> .contato-card),
  #contato .container > div:has(> .contato-card) {
    grid-template-columns: 1fr;
    display: grid;
    gap: 1rem;
  }

  .form-contato {
    padding: 1.5rem;
    margin-top: 1.5rem;
  }

  .rodape {
    padding: 2.75rem 0 1.75rem;
    text-align: center;
  }

  .rodape ul {
    justify-content: center;
  }
}

/* Grades de depoimentos e contato (desktop, com fallback :has) */
@media (min-width: 769px) {
  #depoimentos .container:has(> .depoimento-card),
  #depoimentos .container > div:has(> .depoimento-card),
  #contato .container:has(> .contato-card),
  #contato .container > div:has(> .contato-card) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: start;
  }

  #depoimentos .container:has(> .depoimento-card) > .section__title,
  #depoimentos .container:has(> .depoimento-card) > .section__subtitle,
  #contato .container:has(> .contato-card) > .section__title,
  #contato .container:has(> .contato-card) > .section__subtitle {
    grid-column: 1 / -1;
  }

  #contato .container:has(> .contato-card) > .form-contato,
  #contato .container:has(> .contato-card) > #form-contato {
    grid-column: 1 / -1;
  }
}

#contato .container > div:has(> .contato-card) { grid-template-columns: minmax(0, 1fr); max-width: 480px; margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------------
   15. Acessibilidade — prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }

  /* Conteúdo sempre visível, sem deslocamento */
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal--ativo {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Hover sem transform */
  .produto-card:hover,
  .produto-card__imagem:hover,
  .produto-card:hover .produto-card__imagem,
  .produto-card__acao:hover,
  .btn:hover {
    transform: none;
  }
}