/* =========================================================
   MERIVAL FOODS · estilos
   Paleta: gris piedra + verde oliva de la identidad de marca
   ========================================================= */
:root {
  --olive:      #4A5A35;  /* verde oliva, color principal */
  --olive-dark: #3B4829;
  --title:      #4A5A35;  /* oliva de la marca para títulos */
  --brown-soft: #443B2C;  /* café de la paleta de marca */
  --sand:       #CDBB9E;
  --lime:       #C2C97A;
  --stone:      #BEB8AB;  /* gris piedra de la opción 4 */
  --stone-light:#E4E1D9;
  --cream:      #F7F3EC;
  --black:      #141414;
  --ink:        #1F2318;
  --muted:      #686A5E;
  --line:       rgba(74, 90, 53, .18);

  --serif: "Playfair Display", Georgia, serif;
  --sans:  "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --label: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.wrap { width: min(var(--wrap), 100% - 3rem); margin-inline: auto; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--title); line-height: 1.08; letter-spacing: -.01em; }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
h1 em, h2 em { font-style: italic; font-weight: 500; color: inherit; }

/* Etiquetas de sección en Libre Franklin */
.label {
  font-family: var(--label);
  font-size: .74rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: .2em;
  text-transform: uppercase;
}
/* Subtítulos en cursiva serif */
.hero__lead, .sec__head > p:not(.label), #contacto .muted {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
}
.kicker { color: var(--olive); margin-bottom: 1.3rem; display: block; }
.muted { color: var(--muted); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 .92rem var(--sans);
  padding: 15px 30px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--olive); color: var(--cream); }
.btn--solid:hover { background: var(--olive-dark); }
.btn--line { border-color: rgba(74,90,53,.45); color: var(--title); }
.btn--line:hover { background: var(--title); color: var(--cream); border-color: var(--title); }

.link {
  display: inline-block; margin-top: 1rem;
  font-weight: 600; color: var(--olive);
  border-bottom: 1px solid var(--lime); padding-bottom: 3px;
  transition: border-color .25s;
}
.link::after { content: "  →"; }
.link:hover { border-color: var(--olive); }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  padding: 22px 0;
  transition: background .35s, padding .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(190, 184, 171, .95);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 12px 0;
  border-bottom-color: rgba(37,46,26,.1);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand img { height: 48px; width: auto; }

.nav__links { display: flex; gap: 2.4rem; }
.nav__links a { color: var(--title); font-size: .92rem; font-weight: 500; position: relative; padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--title);
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.nav__links a:hover::after { transform: scaleX(1); }

.nav__right { display: flex; align-items: center; gap: 1rem; }
.lang {
  width: 38px; height: 30px;
  background: transparent; color: var(--title);
  border: 1px solid rgba(37,46,26,.35); border-radius: 3px;
  font: 600 .7rem var(--label); letter-spacing: .08em; cursor: pointer;
}
.lang:hover { border-color: var(--title); }

.burger { display: none; width: 30px; height: 30px; background: none; border: 0; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 3px; right: 3px; height: 1.5px; background: var(--title); transition: transform .3s, top .3s; }
.burger span:first-child { top: 11px; }
.burger span:last-child { top: 18px; }
.burger.open span:first-child { top: 15px; transform: rotate(45deg); }
.burger.open span:last-child { top: 15px; transform: rotate(-45deg); }

/* ---------- Portada ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  background: var(--stone);
  overflow: hidden;
  padding: 140px 0 56px;
}
.hero__media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  /* Si agregas una foto: background: url("img/hero.jpg") center / cover; */
  background:
    radial-gradient(ellipse at 85% 15%, rgba(247,243,236,.45), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(228,225,217,.5), transparent 60%);
}
.hero__mark {
  position: absolute; right: -6vw; top: 8vh;
  height: min(78vh, 760px); width: auto;
  opacity: .08; pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: rotate(8deg) translateY(12px); } }

.hero__content { position: relative; z-index: 2; }
.hero .label { color: rgba(37,46,26,.75); }
.hero > .wrap > .label:first-child { margin-bottom: 1.8rem; display: block; }
.hero h1 { font-size: clamp(3.2rem, 8.4vw, 7.4rem); margin-bottom: 1.8rem; }
.hero h1 em { color: var(--title); }
.hero__lead { max-width: 44ch; font-size: 1.3rem; line-height: 1.5; color: var(--olive); margin-bottom: 2.4rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero__foot { margin-top: 4.5rem; padding-top: 1.6rem; border-top: 1px solid rgba(37,46,26,.2); }

/* ---------- Secciones ---------- */
.sec { padding: 130px 0; border-top: 1px solid var(--line); }
.sec--alt { background: var(--stone-light); }
.sec--dark { background: var(--olive); color: var(--cream); border-top: 0; }
.sec--dark h2, .sec--dark h3 { color: var(--cream); }
.sec--dark .kicker { color: var(--lime); }

.sec__head { max-width: 680px; margin-bottom: 64px; }
.sec__head > p:not(.label) { color: var(--olive); font-size: 1.3rem; line-height: 1.5; margin-top: 1.1rem; max-width: 50ch; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 6rem; align-items: start; }
.split__right > p { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.2rem; text-align: justify; hyphens: auto; }

/* ---------- Catálogo ---------- */
.cat { border-top: 1px solid var(--line); padding-top: 1.6rem; margin-bottom: 2.2rem; }
.cat + .grid { margin-bottom: 5rem; }
.grid:last-child { margin-bottom: 0; }
.cat__title { display: flex; align-items: baseline; gap: 1.2rem; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.cat__title .label { color: var(--olive); font-size: .8rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.6rem 2rem; }
.prod__img {
  aspect-ratio: 3 / 4; margin-bottom: 1.3rem;
  border-radius: 18px; overflow: hidden;
  background: var(--stone);
}
.prod__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.prod:hover .prod__img img { transform: scale(1.04); }
.prod h4 { font-size: 1.45rem; }
.prod i.label { display: block; color: var(--olive); font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1rem; letter-spacing: 0; text-transform: none; margin: .35rem 0 .7rem; }
.prod p { color: var(--muted); font-size: .95rem; }

/* ---------- Proceso ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); }
.steps article { padding: 2rem 2rem 0 0; border-top: 1px solid rgba(247,243,236,.25); }
.steps article + article { padding-left: 2rem; border-left: 1px solid rgba(247,243,236,.14); }
.steps .label { display: block; color: var(--lime); margin-bottom: 2.4rem; }
.steps h3 { font-size: 1.45rem; margin-bottom: .8rem; }
.steps p { color: rgba(247,243,236,.75); font-size: .95rem; }

/* ---------- Contacto ---------- */
#contacto .muted { color: var(--olive); font-size: 1.3rem; }
#contacto h2 { font-size: clamp(2.4rem, 5vw, 3.8rem); margin-bottom: 1.4rem; }
.contact { list-style: none; margin-top: 3rem; }
.contact li { padding: 1.1rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 130px 1fr; gap: 1rem; align-items: baseline; }
.contact small { color: var(--muted); font-size: .7rem; }
.contact a { font-weight: 600; color: var(--olive); }
.contact a:hover { color: var(--title); }

.form { display: grid; gap: 1.6rem; padding-top: .5rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.form label { display: grid; gap: .45rem; }
.form label > .label { font-size: .7rem; color: var(--muted); }
.form input, .form textarea, .form select {
  font: 500 1rem var(--sans); color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--stone);
  padding: .6rem 0; border-radius: 0;
  transition: border-color .25s;
}
.form select { appearance: none; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A5A35' stroke-width='1.5'/%3E%3C/svg%3E") right center no-repeat; }
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--olive); }
.form .invalid { border-color: #a3453b; }
.form .btn { justify-self: start; margin-top: .5rem; }
.form__status { font-size: .9rem; min-height: 1.3em; color: var(--olive); }

/* ---------- Pie ---------- */
.foot { background: var(--brown-soft); color: rgba(247,243,236,.8); padding: 90px 0 0; font-size: .92rem; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-bottom: 70px; }
.brand--foot img { height: 46px; }
.foot__small { margin-top: 1.4rem; max-width: 30ch; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.foot h4 { color: var(--sand); margin-bottom: 1.2rem; font-size: .7rem; }
.foot__grid a:not(.brand) { display: block; padding: .3rem 0; transition: color .2s; }
.foot__grid a:not(.brand):hover { color: var(--cream); }
.foot__bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(247,243,236,.18); padding: 26px 0; font-size: .8rem; }

/* ---------- WhatsApp ---------- */
.wa {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  transition: transform .25s;
}
.wa:hover { transform: scale(1.07); }

/* ---------- Aparición al hacer scroll ---------- */
.fade { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.fade.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 968px) {
  .sec { padding: 80px 0; }
  .split { grid-template-columns: 1fr; gap: 2.5rem; }
  .split__right > p { text-align: left; }
  .grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 3rem; }
  .steps article:nth-child(3) { padding-left: 0; border-left: 0; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__grid > div:first-child { grid-column: 1 / -1; }

  .burger { display: block; }
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 1.6rem;
    padding: 0 2rem;
    background: var(--stone);
    opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
  }
  .nav__links.open { opacity: 1; visibility: visible; }
  .nav__links a { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 2rem); }
  .sec { padding: 64px 0; }
  .brand img { height: 38px; }
  .hero { padding-bottom: 40px; }
  .hero__mark { height: 52vh; right: -22vw; top: 10vh; }
  .hero__foot { margin-top: 3rem; }
  .grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps article, .steps article + article { padding: 1.6rem 0 0; border-left: 0; }
  .steps .label { margin-bottom: 1rem; }
  .form__row { grid-template-columns: 1fr; }
  .contact li { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade { opacity: 1; transform: none; transition: none; }
  .hero__mark { animation: none; }
}
