/* ============================================================
   Agropecuaria Los Llanos 2016 · styles.css

   Sitio tradicional de negocio: barra superior, encabezado con menú,
   portada, secciones con título, tarjetas de productos, mapa y pie.
   Los colores vienen del rótulo de la tienda: azul para títulos y
   enlaces, amarillo como acento, verde para WhatsApp.
   ============================================================ */

/* ---------- 1. Variables ---------- */
:root {
  --blue: #15318a;
  --blue-dark: #0f2466;
  --yellow: #f3c21b;
  --green: #1b7a3e;
  --green-dark: #155f30;
  --ink: #1d2024;
  --text: #2f3439;
  --muted: #5f666d;
  --line: #e2e5e8;
  --bg: #ffffff;
  --tint: #f5f7f9;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(20, 30, 50, 0.08);
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1140px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--bg); }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { color: var(--blue); line-height: 1.2; font-weight: 800; }
h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 12px; }
h3 { font-size: 19px; }
p + p { margin-top: 12px; }
a { color: var(--blue); }
img { display: block; max-width: 100%; height: auto; }
ul { padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.small { font-size: 15px; color: var(--muted); }
mark.pending { background: var(--yellow); color: var(--ink); padding: 0 0.3em; border-radius: 3px; font-weight: 600; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none; border: 2px solid transparent; white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--wa { background: var(--green); color: #fff; }
.btn--wa:hover { background: var(--green-dark); }
.btn--ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--ghost:hover { background: var(--blue); color: #fff; }
.btn--add { background: var(--yellow); color: var(--ink); width: 100%; }
.btn--add:hover { background: #e0b010; }
.btn--add.is-in { background: var(--green); color: #fff; }

/* ---------- 3. Franja de demostración, barra superior y encabezado ---------- */
.demo-banner { background: var(--yellow); color: var(--ink); text-align: center; font-size: 14px; font-weight: 600; padding: 6px 16px; }

.topbar { background: var(--blue); color: #fff; font-size: 14px; }
.topbar a { color: #fff; font-weight: 600; }
.topbar__in { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; flex-wrap: wrap; }
.open { font-weight: 700; color: var(--yellow); }
.open.is-closed { color: #fff; opacity: 0.85; }

.header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: #fff; box-shadow: var(--shadow); }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand__logo { width: 48px; height: 48px; border-radius: 50%; }
.brand__name { font-size: 17px; line-height: 1.15; }
.brand__name strong { display: block; color: var(--blue); font-weight: 800; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { text-decoration: none; font-weight: 600; color: var(--ink); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); }
.nav .btn { color: #fff; }
.menu-btn { display: none; background: none; border: 2px solid var(--blue); color: var(--blue); border-radius: var(--radius); padding: 8px 14px; font-weight: 600; }

/* ---------- 4. Portada ---------- */
.hero { background: var(--tint); padding: 56px 0; }
.hero__in { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero__lead { font-size: 19px; margin-top: 16px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero__facts { margin-top: 28px; display: grid; gap: 8px; font-size: 16px; }
.hero__facts strong { color: var(--blue); }
.hero__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ---------- 5. Secciones ---------- */
.section { padding: 64px 0; }
.section--tint { background: var(--tint); }
.section--first { padding-bottom: 24px; }
.section__lead { font-size: 18px; max-width: 70ch; margin-bottom: 28px; }

/* Tarjetas de familias (inicio) */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: box-shadow 150ms ease, transform 150ms ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__link { margin-top: auto; color: var(--blue); font-weight: 700; }
.card--all { background: var(--blue); color: #fff; justify-content: center; }
.card--all h3, .card--all .card__link { color: var(--yellow); }

/* Razones */
.reasons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.reason { background: #fff; border-left: 4px solid var(--yellow); border-radius: var(--radius); padding: 20px; }
.reason h3 { margin-bottom: 8px; }

/* Nosotros */
.about { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.about__text p { margin-top: 12px; }
.about__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }

/* Dónde estamos */
.where { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
address { font-style: normal; margin-bottom: 20px; }
.facts { display: grid; gap: 10px; margin-bottom: 24px; }
.facts > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 700; color: var(--blue); }
.where__map iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius); }

/* ---------- 6. Catálogo (productos.html) ---------- */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters a { text-decoration: none; font-weight: 600; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--blue); color: var(--blue); }
.filters a.is-on, .filters a:hover { background: var(--blue); color: #fff; }
.catalog { padding-bottom: 120px; }
.family { padding: 32px 0 8px; }
.family.is-hidden { display: none; }
.family h2 { margin-bottom: 6px; }
.family__note { color: var(--muted); margin-bottom: 16px; max-width: 70ch; }
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 16px; }
.product { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.product img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; font-size: 15px; }
.product__body h3 { font-size: 17px; color: var(--ink); }
.product__brand { font-weight: 600; color: var(--blue); }
.product__price { color: var(--muted); margin-top: auto; }
.product .btn--add { margin-top: 10px; min-height: 42px; }

/* El pedido */
.cart[hidden] { display: none; }
.cart { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--ink); color: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,0.2); }
.cart__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.cart__bar strong { color: var(--yellow); font-size: 20px; }
.cart__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cart .btn--ghost { color: #fff; border-color: #fff; }
.cart .btn--ghost:hover { background: #fff; color: var(--ink); }
.cart__panel[hidden] { display: none; }
.cart__panel { padding: 8px 0 20px; max-height: 50vh; overflow: auto; border-top: 1px solid rgba(255,255,255,0.15); }
.cart__list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #fff; background: none; color: #fff; font-weight: 700; }
.qty output { min-width: 24px; text-align: center; font-weight: 700; }
.cart__remove { background: none; border: 0; color: #fff; text-decoration: underline; font-size: 14px; }
.cart__note { display: grid; gap: 6px; margin-top: 16px; font-size: 14px; }
.cart__note textarea { font: inherit; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line); }
.cart__clear { margin-top: 12px; background: none; border: 0; color: #fff; text-decoration: underline; font-size: 14px; }

/* ---------- 7. Pie y botón flotante ---------- */
.footer { background: var(--blue-dark); color: #fff; padding: 48px 0 24px; font-size: 15px; }
.footer a { color: #fff; }
.footer__in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer__brand { font-size: 20px; font-weight: 800; color: var(--yellow); margin-bottom: 8px; }
.footer__title { font-weight: 700; color: var(--yellow); margin-bottom: 8px; }
.footer li + li { margin-top: 6px; }
.footer__legal { margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.2); font-size: 14px; opacity: 0.85; }
.footer mark.pending { color: var(--ink); }

.wa-float { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 55; width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.wa-float:hover { background: var(--green-dark); }

/* ---------- 8. Tableta y teléfono ---------- */
@media (max-width: 1023px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .reasons { grid-template-columns: repeat(2, 1fr); }
  .products { grid-template-columns: repeat(3, 1fr); }
  .hero__in, .about, .where { grid-template-columns: 1fr; gap: 32px; }
  .footer__in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .topbar__in { justify-content: center; text-align: center; }
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 16px; box-shadow: var(--shadow); }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 12px; border: 0; }
  .hero { padding: 32px 0; }
  .hero__actions .btn { flex: 1; }
  .cards, .reasons, .products { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cards { grid-template-columns: 1fr; }
  .product__body { padding: 10px 12px 12px; font-size: 14px; }
  .product__body h3 { font-size: 15px; }
  .product .btn--add { padding: 0 8px; font-size: 14px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .footer__in { grid-template-columns: 1fr; }
  .cart__bar { justify-content: center; text-align: center; }
  .cart__actions { width: 100%; }
  .cart__actions .btn { flex: 1; }
  .wa-float { bottom: 88px; }
}

/* Caja que reemplaza al mapa donde no se pueden incrustar iframes. */
.map-link { display: grid; place-items: center; text-align: center; gap: 8px; aspect-ratio: 4 / 3; border-radius: var(--radius); background: #e8efe9; color: var(--blue); text-decoration: none; padding: 24px; font-weight: 600; }
.map-link span { font-weight: 400; color: var(--text); }
