/*
  PiSo Alfalfa — estilos
  Tipografía: Zilla Slab (títulos) + Atkinson Hyperlegible Next (texto), alojadas en /assets/fonts.
  - Zilla Slab: slab sólida con el carácter del rotulado de maquinaria y silos; da identidad sin ser decorativa.
  - Atkinson Hyperlegible Next: hecha para distinguir cada letra y cifra en pantallas chicas y con sol,
    justo donde se leerán teléfonos, correos y "550 kg".
  Color: verde medido del logo (#05502D) + naranja de cable (alambre de las pacas, acero y maquinaria de las fotos).
  El naranja solo se usa en filetes y no en texto.
*/

@font-face {
  font-family: "Zilla Slab";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/zilla-slab-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/zilla-slab-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
}

:root {
  --verde: #05502d;
  --verde-hondo: #0c2e1d;
  --polvo: #e6ebdd;
  --hoja: #fbfcf8;
  --cable: #d4481a;

  --texto: var(--verde-hondo);
  --suave: #3c5446;
  --foco: var(--verde);

  --f-titulo: "Zilla Slab", Rockwell, Georgia, serif;
  --f-texto: "Atkinson Hyperlegible Next", Verdana, sans-serif;

  --gutter: clamp(1.25rem, 4.5vw, 3rem);
  --ancho: 76rem;
  --seccion: clamp(4rem, 9vw, 7.5rem);
  --header-h: 4rem;
  --solape: 4.5rem;
}

/* Superficies oscuras: cambian el color de texto secundario y del foco */
.hero__panel,
.section--verde,
.producto--pellets,
.footer {
  --suave: #d5e0d0;
  --foco: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--hoja);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

h1,
h2,
h3,
p,
dl,
dd,
figure,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.75rem 1rem;
  background: var(--verde);
  color: #fff;
  font-weight: 700;
}
.skip:focus {
  top: 1rem;
}

/* ---------- Íconos (sprite SVG en línea en cada página) ---------- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* ---------- Estructura ---------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--ancho));
  margin-inline: auto;
}

.section {
  padding-block: var(--seccion);
}
.section--polvo {
  background: var(--polvo);
}
.section--verde {
  background: var(--verde);
  color: #fff;
}

.titulo {
  font-family: var(--f-titulo);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.1rem + 2.8vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.subtitulo {
  font-family: var(--f-titulo);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.15;
}
.texto {
  max-width: 34rem;
}
.texto p + p {
  margin-top: 1rem;
}
.suave {
  color: var(--suave);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 4px;
  font: 700 1rem/1.2 var(--f-texto);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn--solido {
  background: var(--verde);
  color: #fff;
}
.btn--solido:hover {
  background: var(--verde-hondo);
}
.btn--claro {
  background: var(--hoja);
  color: var(--verde);
}
.btn--claro:hover {
  background: var(--polvo);
}
.btn--linea {
  border-color: var(--verde);
  color: var(--verde);
}
.btn--linea:hover {
  background: var(--polvo);
}
.btn--linea-claro {
  border-color: #fff;
  color: #fff;
}
.btn--linea-claro:hover {
  background: rgba(255, 255, 255, 0.14);
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.enlace {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

/* ---------- Encabezado ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 252, 248, 0.97);
  border-bottom: 1px solid rgba(12, 46, 29, 0.12);
}
.header__in {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  width: min(100% - 2 * var(--gutter), var(--ancho));
  margin-inline: auto;
}
.logo {
  flex: none;
  display: block;
  padding-block: 0.5rem;
}
.logo img {
  height: 2.1rem;
  width: auto;
}
.nav {
  display: none;
}
.header__wa {
  display: none;
  min-height: 2.5rem;
  padding-block: 0.4rem;
}

.lang {
  display: flex;
  margin-left: auto;
  border: 2px solid var(--verde);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}
.lang__item {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  color: var(--verde);
  text-decoration: none;
}
.lang__item + .lang__item {
  border-left: 2px solid var(--verde);
}
.lang__item[aria-current] {
  background: var(--verde);
  color: #fff;
}
a.lang__item:hover {
  background: var(--polvo);
}
a.lang__item:focus-visible {
  outline-offset: -5px;
}

/* ---------- Hero ---------- */
.hero__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--polvo);
}
.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}
.hero__panel {
  position: relative;
  padding: 2rem var(--gutter) 2.5rem;
  background: var(--verde);
  color: #fff;
}
/* El alambre: un filete naranja que se tiende al cargar la página */
.hero__panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: -6px;
  width: 100%;
  height: 6px;
  background: var(--cable);
  transform-origin: left center;
  animation: alambre 0.9s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes alambre {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero__panel::before {
    animation: none;
  }
}

.hero__titulo {
  font-family: var(--f-titulo);
  font-weight: 700;
  font-size: clamp(2.15rem, 1.25rem + 4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.hero__lead {
  margin-top: 1.25rem;
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--suave);
}
.hero__panel .acciones {
  margin-top: 1.75rem;
}
.hero__tel {
  margin-top: 1.25rem;
  color: var(--suave);
}
.hero__tel a {
  display: inline-block;
  padding-block: 0.5rem;
  color: #fff;
  font-weight: 700;
}

@media (min-width: 700px) {
  .hero__media {
    aspect-ratio: 16 / 9;
  }
}

@media (min-width: 1024px) {
  .hero {
    display: grid;
    margin-bottom: var(--solape);
  }
  .hero__media {
    grid-area: 1 / 1;
    aspect-ratio: auto;
    height: clamp(34rem, 80vh, 48rem);
  }
  .hero__img {
    object-position: 50% 68%;
  }
  .hero__over {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: center;
    display: flex;
    justify-content: flex-end;
    width: min(100% - 2 * var(--gutter), var(--ancho));
    margin-bottom: calc(var(--solape) * -1);
    pointer-events: none;
  }
  .hero__panel {
    width: min(34rem, 100%);
    padding: 2.75rem 2.75rem 3rem;
    pointer-events: auto;
  }
}

/* ---------- Productos ---------- */
.productos__cabeza {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}
.productos__grid {
  display: grid;
  gap: 2rem;
}
.producto {
  display: flex;
  flex-direction: column;
}
.producto__foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.producto__cuerpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 1.5rem;
}
.producto--pellets {
  position: relative;
  overflow: hidden;
  background: var(--verde);
  color: #fff;
}
.producto--pellets .producto__cuerpo {
  position: relative;
  z-index: 1;
  padding: 2rem var(--gutter) 2.5rem;
}
.producto__marca {
  position: absolute;
  right: -3rem;
  bottom: -3.5rem;
  width: 17rem;
  opacity: 0.08;
  pointer-events: none;
}

/* Ficha: el alambre separa cada dato */
.ficha {
  display: grid;
}
.ficha__fila {
  display: grid;
  grid-template-columns: minmax(7.5rem, 9.5rem) 1fr;
  gap: 1rem;
  padding-block: 0.8rem;
  border-top: 2px solid var(--cable);
}
.ficha__fila:last-child {
  border-bottom: 2px solid var(--cable);
}
.ficha__t {
  color: var(--suave);
}
.ficha__d {
  font-weight: 700;
}

@media (min-width: 900px) {
  .productos__cabeza {
    grid-template-columns: 7fr 5fr;
    align-items: end;
    gap: 2rem;
  }
  .productos__grid {
    grid-template-columns: 7fr 5fr;
    gap: 2rem;
    align-items: stretch;
  }
  .producto--pellets .producto__cuerpo {
    padding: 2.5rem;
  }
  /* h3 arriba; ficha y enlace abajo, alineados con el pie de la tarjeta de pacas */
  .producto--pellets .ficha {
    margin-top: auto;
  }
  .producto__marca {
    top: 6.5rem;
    right: -3.5rem;
    bottom: auto;
    width: 21rem;
    opacity: 0.1;
  }
  .producto__foto {
    aspect-ratio: 3 / 2;
  }
}

/* ---------- A quién servimos ---------- */
.servimos__grid {
  display: grid;
  gap: 2.25rem;
}
.servimos__foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 40%;
}
.servimos__lista {
  margin-top: 2rem;
}
.servimos__item {
  padding-block: 1.5rem;
  border-top: 2px solid var(--cable);
}
.servimos__item:last-child {
  border-bottom: 2px solid var(--cable);
}
.servimos__item p {
  max-width: 30rem;
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .servimos__grid {
    grid-template-columns: 4fr 7fr;
    gap: clamp(2.5rem, 7vw, 6.5rem);
    align-items: center;
  }
  .servimos__foto {
    aspect-ratio: 3 / 4;
    object-position: 50% 50%;
  }
}

/* ---------- Nosotros ---------- */
.nosotros__grid {
  display: grid;
  gap: 2.5rem;
}
.nosotros__fotos {
  display: grid;
}
.nosotros__foto-a {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.nosotros__foto-b {
  width: 64%;
  margin: -3.5rem 0 0 auto;
  border: 6px solid var(--hoja);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  position: relative;
}

@media (min-width: 900px) {
  .nosotros__grid {
    grid-template-columns: 5fr 7fr;
    gap: clamp(2.5rem, 6vw, 5.5rem);
    align-items: center;
  }
}

/* ---------- Ventas internacionales (solo página en inglés) ---------- */
.intl__grid {
  display: grid;
  gap: 2.5rem;
}
.intl .acciones {
  margin-top: 2rem;
}
@media (min-width: 900px) {
  .intl__grid {
    grid-template-columns: 6fr 5fr;
    gap: clamp(2.5rem, 6vw, 5.5rem);
    align-items: center;
  }
}

/* ---------- Contacto ---------- */
.contacto__grid {
  display: grid;
  gap: 3rem;
}
.contacto .acciones {
  margin-top: 2rem;
}
.contacto__lista {
  margin-top: 2.5rem;
  display: grid;
}
.dato {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.9rem;
  padding-block: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}
.dato:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}
.dato .icon {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
}
.dato__t {
  color: var(--suave);
  font-size: 0.95rem;
  line-height: 1.4;
}
.dato__d {
  font-weight: 700;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}
.dato__d a {
  display: inline-block;
  padding-block: 0.4rem;
}
.contacto__foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 40% 50%;
}

@media (min-width: 900px) {
  .contacto__grid {
    grid-template-columns: 7fr 5fr;
    gap: clamp(2.5rem, 6vw, 5.5rem);
    align-items: center;
  }
  .contacto__foto {
    aspect-ratio: 4 / 5;
  }
}

/* ---------- Pie ---------- */
.footer {
  background: var(--verde-hondo);
  color: #fff;
  padding-block: 3rem 2.25rem;
}
.footer__in {
  display: grid;
  gap: 1.75rem;
}
.footer__logo img {
  height: 2.1rem;
  width: auto;
}
.footer__enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}
.footer__enlaces a {
  padding-block: 0.6rem;
}
.footer__legal {
  color: var(--suave);
  font-size: 0.95rem;
}
@media (min-width: 900px) {
  .footer__in {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2.5rem;
  }
  .footer__enlaces {
    justify-content: center;
  }
}

/* ---------- Botón flotante de WhatsApp (solo móvil) ---------- */
.flotante {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  box-shadow: 0 2px 10px rgba(12, 46, 29, 0.35);
  visibility: hidden;
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.2s, transform 0.2s, visibility 0s 0.2s;
}
.flotante .icon {
  width: 1.65rem;
  height: 1.65rem;
}
.flotante.is-visible {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}
.flotante:focus-visible {
  outline-color: var(--verde);
}

/* Tableta: las fotos de ancho completo no necesitan tanta altura */
@media (min-width: 700px) and (max-width: 899px) {
  .servimos__foto,
  .contacto__foto {
    aspect-ratio: 16 / 9;
  }
}

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  .nav {
    display: flex;
    gap: clamp(1rem, 2.2vw, 1.75rem);
    margin-left: auto;
    font-weight: 700;
    font-size: 0.98rem;
  }
  .nav a {
    padding-block: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .nav a:hover {
    border-bottom-color: var(--cable);
  }
  .lang {
    margin-left: 0;
  }
  .flotante {
    display: none;
  }
}

/* El botón de WhatsApp del encabezado solo cuando hay espacio de sobra */
@media (min-width: 1100px) {
  .header__wa {
    display: inline-flex;
  }
}

@media print {
  .header,
  .flotante {
    display: none;
  }
}

/* Bajada: texto que va justo debajo de un título de sección */
.bajada {
  margin-top: 1.25rem;
}
.intl .ficha {
  margin-top: 1.25rem;
}
