/* ============================================================
   Tonalli — Granos, Semillas y Cereales
   Paleta derivada del logotipo: café tostado, crema, dorado,
   ocre y olivo. Display: Baloo 2 (eco del logotipo redondeado).
   ============================================================ */

:root {
  --noche: #291c10;        /* café tostado profundo (hero, pie) */
  --noche-2: #382916;
  --crema: #f7f0df;        /* papel */
  --crema-2: #efe4c9;
  --tinta: #46351f;        /* texto sobre crema */
  --dorado: #d9a441;
  --ocre: #b87b2e;
  --olivo: #7a8049;
  --olivo-osc: #5a6238;
  --wa: #1fae53;
  --wa-osc: #178a41;

  --display: "Baloo 2", "Trebuchet MS", sans-serif;
  --cuerpo: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --radio: 22px;
  --ancho: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: 76px; }

body {
  font-family: var(--cuerpo);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--tinta);
  background: var(--crema);
  overflow-x: hidden;
}

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

.contenedor {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }

.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olivo-osc);
  margin-bottom: 0.9rem;
}
.eyebrow-clara { color: var(--dorado); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  padding: 0.78rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--dorado);
  outline-offset: 3px;
}

.btn-wa {
  background: var(--wa);
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 174, 83, 0.35);
}
.btn-wa:hover { background: var(--wa-osc); }

.btn-fantasma {
  border: 2.5px solid var(--dorado);
  color: var(--dorado);
}
.btn-fantasma:hover { background: rgba(217, 164, 65, 0.12); }

.btn-grande { font-size: 1.12rem; padding: 0.95rem 1.9rem; }

.ico-wa { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Navegación ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  /* mismo color de fondo que el logotipo, para que se funda sin recuadro */
  background: #f6f4e7;
  border-bottom: 1px solid rgba(70, 53, 31, 0.12);
}
.nav-inner {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0.65rem 24px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-marca {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--tinta);
  margin-right: auto;
}
.nav-logo {
  height: 58px;
  width: auto;
  transition: transform 0.25s ease;
}
.nav-marca:hover .nav-logo { transform: scale(1.05); }
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a {
  font-family: var(--display);
  font-weight: 600;
  color: var(--tinta);
  text-decoration: none;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -4px;
  height: 3px;
  border-radius: 3px;
  background: var(--dorado);
  transition: right 0.25s ease;
}
.nav-links a:hover::after { right: 0; }
.nav-wa { padding: 0.5rem 1.1rem; font-size: 0.95rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(90rem 40rem at 75% -20%, #4a3319 0%, transparent 60%),
    var(--noche);
  color: var(--crema);
  overflow: hidden;
}
#granos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-inner {
  position: relative;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) 24px clamp(6rem, 14vh, 9rem);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: 2rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 800;
  color: #fdf6e3;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--dorado);
}
.hero-sub {
  margin-top: 1.2rem;
  max-width: 34rem;
  font-size: 1.15rem;
  color: rgba(247, 240, 223, 0.85);
}
.hero-ctas {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-sol { display: grid; place-items: center; }
.sol-grande {
  width: min(330px, 30vw);
  height: auto;
  filter: drop-shadow(0 0 38px rgba(217, 164, 65, 0.4));
  animation: flotar 6s ease-in-out infinite;
}

@keyframes flotar {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 30px rgba(217, 164, 65, 0.3)); }
  50% { transform: translateY(-10px); filter: drop-shadow(0 0 46px rgba(217, 164, 65, 0.5)); }
}

/* ---------- Cinta ---------- */
.cinta {
  background: var(--dorado);
  color: var(--noche);
  overflow: hidden;
  border-top: 3px solid var(--noche);
  border-bottom: 3px solid rgba(41, 28, 16, 0.25);
}
.cinta-pista {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  width: max-content;
  padding: 0.55rem 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: rodar 28s linear infinite;
}
.cinta-pista i { font-style: normal; opacity: 0.55; font-size: 0.8rem; }
@keyframes rodar {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Nosotros ---------- */
.nosotros { padding: clamp(4rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem); }
.nosotros-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.nosotros-logo img {
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: 0 24px 60px rgba(70, 53, 31, 0.25);
  transform: rotate(-2deg);
  transition: transform 0.4s ease;
}
.nosotros-logo img:hover { transform: rotate(0deg) scale(1.02); }
.nosotros-texto p + p { margin-top: 1rem; }
.nosotros-texto h2 { margin-bottom: 1.2rem; color: #5c4326; }
.lema {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--olivo-osc);
}

.pilares {
  margin-top: clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.pilar {
  background: #fffdf6;
  border: 1.5px solid rgba(122, 128, 73, 0.35);
  border-radius: var(--radio);
  padding: 1.8rem 1.6rem;
  box-shadow: 0 10px 30px rgba(70, 53, 31, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pilar:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(70, 53, 31, 0.14);
}
.pilar-ico { font-size: 2rem; margin-bottom: 0.6rem; }
.pilar h3 { font-size: 1.25rem; font-weight: 700; color: #5c4326; margin-bottom: 0.4rem; }
.pilar p { font-size: 0.98rem; }

/* ---------- Productos ---------- */
.productos {
  background:
    linear-gradient(180deg, var(--crema-2), var(--crema) 30%);
  padding: clamp(4rem, 9vw, 6.5rem) 0;
}
.productos h2 { color: #5c4326; }
.seccion-sub { max-width: 38rem; margin-top: 0.8rem; }

.galeria {
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.producto {
  background: #fffdf6;
  border-radius: 130px 130px var(--radio) var(--radio); /* arco de costal */
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(70, 53, 31, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.producto:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(70, 53, 31, 0.2);
}
.producto-foto {
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
}
.producto-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.producto:hover .producto-foto img { transform: scale(1.06); }
.producto figcaption { padding: 1.2rem 1.4rem 1.5rem; }
.producto h3 { font-size: 1.28rem; font-weight: 700; color: #5c4326; }
.producto figcaption p { font-size: 0.95rem; margin-top: 0.3rem; }

.galeria-nota {
  margin-top: 2.4rem;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  color: var(--olivo-osc);
}

/* ---------- Visítanos ---------- */
.visitanos {
  background:
    radial-gradient(70rem 30rem at 20% 120%, #4a3319 0%, transparent 60%),
    var(--noche);
  color: var(--crema);
  padding: clamp(4rem, 9vw, 6.5rem) 0;
}
.visitanos h2 { color: #fdf6e3; margin-bottom: 1.6rem; }
.visitanos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 2.5rem;
  align-items: center;
}
.datos { list-style: none; display: grid; gap: 1.1rem; margin-bottom: 2rem; }
.dato-etiqueta {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dorado);
  margin-bottom: 0.15rem;
}
.datos a {
  color: var(--crema);
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 240, 223, 0.3);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.datos a:hover { color: var(--dorado); border-color: var(--dorado); }

.visitanos-mapa { margin-top: clamp(2.5rem, 6vw, 4rem); }
.visitanos-mapa iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
  border-radius: var(--radio);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.visitanos-sol { text-align: center; }
.sol-contacto {
  width: min(240px, 40vw);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.35));
}
.visitanos-lema {
  margin-top: 1rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--dorado);
}

/* ---------- Pie ---------- */
.pie {
  background: #1d140b;
  color: rgba(247, 240, 223, 0.75);
  font-size: 0.92rem;
}
.pie-inner {
  padding: 1.4rem 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}
.pie a { color: var(--dorado); text-decoration: none; }
.pie a:hover { text-decoration: underline; }

/* ---------- WhatsApp flotante ---------- */
.wa-flotante {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wa);
  color: #fff;
  box-shadow: 0 8px 24px rgba(31, 174, 83, 0.45);
  transition: transform 0.2s ease;
}
.wa-flotante:hover { transform: scale(1.08); }
.wa-flotante svg { width: 32px; height: 32px; }
.wa-flotante::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--wa);
  animation: pulso 2.2s ease-out infinite;
}
@keyframes pulso {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ---------- Aparición al hacer scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.12s; }
.reveal.d2 { transition-delay: 0.24s; }
.reveal.d3 { transition-delay: 0.36s; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cinta-pista,
  .sol-grande,
  .wa-flotante::after { animation: none; }
  .btn, .pilar, .producto, .producto-foto img { transition: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-bottom: clamp(7rem, 18vh, 10rem); }
  .hero-sol { order: -1; }
  .sol-grande { width: 170px; }
  .nav-logo { height: 48px; }
  .nosotros-grid { grid-template-columns: 1fr; }
  .nosotros-logo { max-width: 300px; margin: 0 auto; }
  .pilares { grid-template-columns: 1fr; }
  .galeria { grid-template-columns: repeat(2, 1fr); }
  .visitanos-grid { grid-template-columns: 1fr; }
  .visitanos-sol { display: none; }
  .visitanos-mapa iframe { height: 320px; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .galeria { grid-template-columns: 1fr; }
  .producto { border-radius: 110px 110px var(--radio) var(--radio); }
  .hero h1 { font-size: clamp(2.3rem, 10vw, 3rem); }
}
