/* ============ Kallpayni — estilos ============ */
:root {
  --cream: #faf6ee;
  --cream-2: #f2ecdd;
  --ink: #2c2115;
  --brown: #3e2b1c;
  --green: #5c7042;
  --green-2: #7c8f5a;
  --sage: #a8b98a;
  --terracotta: #c4622d;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(44, 33, 21, .12);
  --radius: 18px;
  --font-display: "Fraunces", serif;
  --font-body: "Work Sans", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; }

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--brown);
  color: var(--cream);
  text-align: center;
  font-size: .8rem;
  padding: .45rem 1rem;
  letter-spacing: .02em;
}

/* ---------- Encabezado ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  background: rgba(250, 246, 238, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(44, 33, 21, .08);
  transition: box-shadow .3s;
}
.header.scrolled { box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: .65rem; }
.brand-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-2);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: .01em;
}
.brand-name span { color: var(--green); }
.nav { display: flex; gap: clamp(.8rem, 2vw, 1.8rem); font-weight: 500; font-size: .95rem; }
.nav a { position: relative; padding: .3rem 0; color: var(--ink); }
.nav a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--green);
  transition: width .25s;
}
.nav a:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: .6rem; }

.cart-btn {
  position: relative;
  background: var(--green);
  color: var(--white);
  border: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .2s, background .2s;
}
.cart-btn:hover { background: var(--brown); transform: scale(1.06); }
.cart-btn svg { width: 21px; height: 21px; }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--terracotta);
  color: #fff;
  font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px;
  border-radius: 10px;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 2px solid var(--cream);
}
.menu-btn { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.menu-btn span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: .3s; }

/* ---------- Héroe ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
}
.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  animation: heroZoom 18s ease-out forwards;
}
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 15, 8, .45) 0%, rgba(20, 15, 8, .25) 45%, rgba(44, 33, 21, .72) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  padding: 6rem 1.5rem 4rem;
  animation: fadeUp 1s ease-out .2s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.hero-kicker {
  display: inline-block;
  background: rgba(250, 246, 238, .16);
  border: 1px solid rgba(250, 246, 238, .45);
  backdrop-filter: blur(4px);
  padding: .35rem 1.1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.3rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.3rem);
  font-weight: 700;
  text-shadow: 0 3px 24px rgba(0, 0, 0, .35);
  margin-bottom: 1.2rem;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 640px;
  margin: 0 auto 2rem;
  color: #f4efe4;
}
.hero-sub em { font-style: italic; color: var(--sage); font-weight: 600; }
.hero-actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; bottom: 1.4rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,8px);} }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: .85rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--green); color: var(--white); box-shadow: 0 6px 18px rgba(92, 112, 66, .35); }
.btn-primary:hover { background: var(--brown); transform: translateY(-2px); }
.btn-ghost {
  background: rgba(250, 246, 238, .12);
  color: var(--white);
  border: 1.5px solid rgba(250, 246, 238, .7);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { background: rgba(250, 246, 238, .25); transform: translateY(-2px); }
.btn-block { width: 100%; text-align: center; }

/* ---------- Franja de valores ---------- */
.usp {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 5vw, 4rem);
  background: var(--cream);
}
.usp-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(44, 33, 21, .06);
  border: 1px solid rgba(44, 33, 21, .05);
  transition: transform .25s, box-shadow .25s;
}
.usp-item:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.usp-icon { font-size: 2rem; margin-bottom: .6rem; }
.usp-item h3 { font-size: 1.1rem; margin-bottom: .4rem; color: var(--brown); }
.usp-item p { font-size: .88rem; color: #5c5245; }

/* ---------- Secciones ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem); }
.section-cream { background: var(--cream-2); }
.section-dark { background: var(--brown); color: var(--cream); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 3rem; }
.section-kicker {
  color: var(--terracotta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
  margin-bottom: .6rem;
}
.section-kicker.light { color: var(--sage); }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: .8rem; }
.section-dark .section-head h2 { color: var(--cream); }
.section-sub { color: #6b6154; font-size: 1.02rem; }
.section-dark .section-sub { color: #d8cfbc; }

/* ---------- Filtros y productos ---------- */
.filters { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.4rem; }
.chip {
  background: var(--white);
  border: 1.5px solid rgba(44, 33, 21, .15);
  color: var(--ink);
  padding: .5rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-body);
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active { background: var(--green); border-color: var(--green); color: var(--white); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 1.6rem;
  max-width: 1240px;
  margin: 0 auto;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(44, 33, 21, .07);
  border: 1px solid rgba(44, 33, 21, .05);
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-img img { transform: scale(1.07); }
.card-badge {
  position: absolute; top: .8rem; left: .8rem;
  background: rgba(250, 246, 238, .94);
  color: var(--brown);
  font-size: .72rem;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card-body h3 { font-size: 1.15rem; color: var(--brown); }
.card-farmer { font-size: .85rem; color: var(--green); font-weight: 600; }
.card-desc { font-size: .86rem; color: #6b6154; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; gap: .6rem; }
.card-price { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.card-price small { font-family: var(--font-body); font-size: .72rem; font-weight: 500; color: #8a8073; display: block; }
.card-add {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .55rem 1.15rem;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .2s, transform .2s;
  white-space: nowrap;
}
.card-add:hover { background: var(--brown); transform: scale(1.04); }
.card.hidden { display: none; }

/* ---------- Historia / esfuerzo ---------- */
.story { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: clamp(2.5rem, 6vw, 4.5rem); }
.story-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.story-row.reverse .story-img { order: 2; }
.story-row.reverse .story-text { order: 1; }
.story-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.story-img img { width: 100%; height: 100%; max-height: 440px; object-fit: cover; transition: transform .6s; }
.story-row:hover .story-img img { transform: scale(1.04); }
.story-num {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--sage);
  opacity: .55;
  font-weight: 700;
  line-height: 1;
  display: block;
  margin-bottom: .5rem;
}
.story-text h3 { font-size: clamp(1.35rem, 3vw, 1.8rem); color: var(--cream); margin-bottom: .8rem; }
.story-text p { color: #d8cfbc; font-size: .98rem; }
.story-cta { text-align: center; margin-top: 3.5rem; }
.story-cta p { font-family: var(--font-display); font-size: 1.35rem; color: var(--sage); margin-bottom: 1.2rem; font-style: italic; }

/* ---------- Agricultores ---------- */
.farmers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.6rem;
  max-width: 1240px;
  margin: 0 auto;
}
.farmer-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(44, 33, 21, .07);
  transition: transform .25s, box-shadow .25s;
}
.farmer-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.farmer-card > img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center 25%; }
.farmer-info { padding: 1.2rem 1.3rem 1.4rem; }
.farmer-info h3 { font-size: 1.2rem; color: var(--brown); margin-bottom: .25rem; }
.farmer-crop { font-size: .84rem; font-weight: 600; color: var(--green); margin-bottom: .55rem; }
.farmer-info p:last-child { font-size: .9rem; color: #6b6154; font-style: italic; }

/* ---------- Pasos ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.6rem;
  max-width: 1100px;
  margin: 0 auto;
}
.step {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.2rem 1.6rem 1.8rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(44, 33, 21, .06);
  position: relative;
}
.step-num {
  width: 52px; height: 52px;
  margin: 0 auto 1.1rem;
  background: var(--green);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(92, 112, 66, .4);
}
.step h3 { font-size: 1.15rem; color: var(--brown); margin-bottom: .55rem; }
.step p { font-size: .9rem; color: #6b6154; }

/* ---------- Impacto ---------- */
.impact { position: relative; padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 5vw, 4rem); color: var(--white); overflow: hidden; }
.impact-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.impact-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 22, 12, .68), rgba(30, 22, 12, .55)); }
.impact-content { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; text-align: center; }
.impact-content h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 2.6rem; text-shadow: 0 2px 16px rgba(0,0,0,.4); }
.impact-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.8rem; }
.stat-num { font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 700; color: var(--sage); line-height: 1; }
.stat-unit { font-size: 1rem; font-weight: 600; margin-left: .3rem; color: var(--cream); }
.stat p { margin-top: .4rem; font-size: .92rem; color: #e6ddca; }

/* ---------- Galería ---------- */
.gallery-strip { overflow: hidden; background: var(--brown); padding: 1rem 0; }
.gallery-track { display: flex; gap: 1rem; animation: slide 42s linear infinite; width: max-content; }
.gallery-strip:hover .gallery-track { animation-play-state: paused; }
.gallery-track img {
  width: 320px; height: 220px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Boletín ---------- */
.newsletter {
  max-width: 900px;
  margin: 0 auto;
  background: var(--white);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(2rem, 5vw, 3.2rem);
  box-shadow: var(--shadow);
  text-align: center;
}
.newsletter h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); color: var(--brown); margin-bottom: .6rem; }
.newsletter p { color: #6b6154; max-width: 520px; margin: 0 auto 1.6rem; }
.newsletter-form { display: flex; gap: .7rem; max-width: 480px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.newsletter-form input {
  flex: 1;
  min-width: 230px;
  padding: .85rem 1.2rem;
  border: 1.5px solid rgba(44, 33, 21, .18);
  border-radius: 999px;
  font-size: .95rem;
  font-family: var(--font-body);
  background: var(--cream);
  outline: none;
  transition: border-color .2s;
}
.newsletter-form input:focus { border-color: var(--green); }
.newsletter-ok { display: none; color: var(--green); font-weight: 600; margin-top: 1rem; }
.newsletter-ok.show { display: block; }

/* ---------- Pie ---------- */
.footer { background: var(--brown); color: var(--cream); }
.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 5vw, 4rem);
  max-width: 1240px;
  margin: 0 auto;
}
.footer-brand img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; margin-bottom: 1rem; border: 2px solid var(--sage); }
.footer-brand p { font-size: .92rem; color: #d8cfbc; }
.footer-col h4 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: .9rem; color: var(--sage); }
.footer-col a, .footer-col span { display: block; font-size: .92rem; color: #d8cfbc; margin-bottom: .5rem; transition: color .2s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  text-align: center;
  padding: 1.1rem;
  font-size: .82rem;
  color: #b7ab93;
  border-top: 1px solid rgba(250, 246, 238, .12);
}

/* ---------- Carrito ---------- */
.cart-backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 22, 12, .5);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  z-index: 90;
}
.cart-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0;
  width: min(420px, 100vw);
  height: 100dvh;
  background: var(--cream);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .2);
}
.cart-drawer.open { transform: none; }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid rgba(44, 33, 21, .1);
}
.cart-head h3 { font-size: 1.35rem; color: var(--brown); }
.cart-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--ink); padding: .4rem; }
.cart-items { flex: 1; overflow-y: auto; padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.cart-empty { text-align: center; color: #8a8073; margin-top: 2.5rem; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: .9rem;
  align-items: center;
  background: var(--white);
  border-radius: 14px;
  padding: .7rem;
  box-shadow: 0 2px 10px rgba(44, 33, 21, .06);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.cart-item-name { font-weight: 600; font-size: .9rem; color: var(--brown); }
.cart-item-price { font-size: .82rem; color: #6b6154; }
.cart-qty { display: flex; align-items: center; gap: .45rem; margin-top: .3rem; }
.cart-qty button {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  background: none;
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.cart-qty button:hover { background: var(--green); color: #fff; }
.cart-qty span { font-size: .88rem; font-weight: 600; min-width: 18px; text-align: center; }
.cart-remove { background: none; border: none; color: #b0a695; cursor: pointer; font-size: 1rem; padding: .3rem; }
.cart-remove:hover { color: var(--terracotta); }
.cart-foot { padding: 1.2rem 1.4rem 1.6rem; border-top: 1px solid rgba(44, 33, 21, .1); background: var(--white); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: 1.05rem; }
.cart-total strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--brown); }
.cart-note { font-size: .78rem; color: #8a8073; text-align: center; margin-top: .7rem; }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed;
  bottom: 1.6rem; left: 50%;
  transform: translate(-50%, 20px);
  background: var(--brown);
  color: var(--cream);
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 120;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animaciones al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .nav {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(300px, 80vw);
    background: var(--cream);
    flex-direction: column;
    padding: 5.5rem 2rem 2rem;
    gap: 1.4rem;
    font-size: 1.1rem;
    transform: translateX(105%);
    transition: transform .3s;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .15);
    z-index: 70;
  }
  .nav.open { transform: none; }
  .menu-btn { display: flex; z-index: 80; }
  .menu-btn.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .menu-btn.open span:nth-child(2) { opacity: 0; }
  .menu-btn.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  .story-row { grid-template-columns: 1fr; }
  .story-row.reverse .story-img { order: 0; }
  .story-row.reverse .story-text { order: 1; }
  .footer-main { grid-template-columns: 1fr; gap: 2rem; }
  .gallery-track img { width: 240px; height: 170px; }
}
