:root {
  --monte: #2B3A29;
  --monte-dark: #1C2818;
  --paja: #C99A3E;
  --paja-light: #E8C878;
  --corteza: #3E2A1B;
  --quebracho: #6B4226;
  --lino: #F1ECDF;
  --lino-dark: #E4DCC8;
  --ladrillo: #A8481D;
  --blanco: #FFFFFF;

  --display: 'Fraunces', serif;
  --body: 'Karla', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--corteza);
  background: var(--lino);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0 0 .4em; color: var(--monte-dark); }
p { margin: 0 0 1em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- HEADER ---------- */
.site-header {
  background: var(--monte);
  color: var(--lino);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--paja);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; color: var(--monte-dark);
  font-size: 20px;
}
.brand-text { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--lino); line-height: 1.1; }
.brand-text small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--paja-light); font-weight: 500; margin-top: 3px; }

nav.main-nav { display: flex; gap: 4px; }
nav.main-nav a {
  padding: 10px 16px; border-radius: 6px; font-weight: 500; font-size: 15px;
  transition: background .15s, color .15s;
  color: var(--lino);
  opacity: .85;
}
nav.main-nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
nav.main-nav a.active { background: var(--paja); color: var(--monte-dark); opacity: 1; font-weight: 700; }
.nav-toggle { display: none; }

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(160deg, var(--monte) 0%, var(--monte-dark) 100%);
  color: var(--lino);
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px;
  padding-top: 72px; padding-bottom: 96px; align-items: center;
}
.hero-eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--paja-light); margin-bottom: 18px; display: inline-flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--paja); display: inline-block; }
.hero h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); color: var(--blanco); line-height: 1.08; max-width: 11ch; }
.hero p.lead { font-size: 1.15rem; color: var(--lino-dark); max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 4px; font-weight: 700; font-size: 15px;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s;
}
.btn-primary { background: var(--ladrillo); color: var(--blanco); }
.btn-primary:hover { transform: translateY(-2px); background: #8f3b16; }
.btn-outline { border-color: rgba(255,255,255,.4); color: var(--blanco); }
.btn-outline:hover { border-color: var(--paja); color: var(--paja-light); }

.hero-visual {
  aspect-ratio: 4/3; border-radius: 8px; overflow: hidden;
  background: var(--quebracho);
  position: relative;
  border: 1px solid rgba(255,255,255,.12);
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual .tag {
  position: absolute; left: 14px; bottom: 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  background: rgba(28,40,24,.85); color: var(--paja-light);
  padding: 6px 10px; border-radius: 3px; letter-spacing: .03em;
}
.hero-dots {
  position: absolute; bottom: 14px; right: 14px; z-index: 5;
  display: flex; gap: 8px;
}
.hero-dot {
  width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.25); cursor: pointer; padding: 0; transition: background .2s, transform .2s;
}
.hero-dot.active { background: var(--paja); border-color: var(--paja); transform: scale(1.15); }

/* ---------- TRANSICION HERO -> CONTENIDO ----------
   El hero tiene un DEGRADADO, así que su borde inferior no es un color plano
   y ninguna forma verde sólida le iba a empatar (se veían dos tonos).
   Por eso el SVG pinta el lado CLARO y se apoya encima del propio hero:
   el verde de arriba es el degradado del hero, no una copia. Sin costura.
   Ojo: el color del SVG (#F1ECDF) tiene que seguir a --lino si algún día cambia. */
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 68px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='76' viewBox='0 0 1440 76' preserveAspectRatio='none'%3E%3Cpath d='M0 14C360 74 1080 74 1440 14V76H0Z' fill='%23F1ECDF'/%3E%3Cpath d='M0 23C360 83 1080 83 1440 23' fill='none' stroke='%23C99A3E' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke' opacity='.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% 100%;
  pointer-events: none;
}
@media (max-width: 860px) { .hero::after { height: 52px; } }
@media (max-width: 560px) { .hero::after { height: 40px; } }

/* ---------- SECCIONES ---------- */
.section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ladrillo); font-weight: 600; margin-bottom: 10px; display: block;
}
.section-head h1,
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-alt { background: var(--lino-dark); }

.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.about-photo { border-radius: 8px; overflow: hidden; aspect-ratio: 5/4; background: var(--quebracho); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.stat-row { display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap; }
.stat { font-family: var(--mono); }
.stat b { display: block; font-size: 1.8rem; color: var(--monte); font-family: var(--display); }
.stat span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--quebracho); }

.products-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px;
}
.product-card {
  background: var(--blanco); border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(62,42,27,.08);
  transition: transform .18s, box-shadow .18s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(43,58,41,.14); }
.product-photo { aspect-ratio: 16/10; background: var(--quebracho); overflow: hidden; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 22px 24px 26px; }
.product-body h3 { font-size: 1.25rem; margin-bottom: 6px; }
.product-body a.link { color: var(--ladrillo); font-weight: 700; font-size: 14px; }

/* ---------- GALERÍA ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }
.filter-btn {
  font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em;
  padding: 9px 16px; border-radius: 20px; border: 1.5px solid var(--quebracho);
  background: transparent; color: var(--quebracho); cursor: pointer; font-weight: 600;
  transition: background .15s, color .15s;
}
.filter-btn.active, .filter-btn:hover { background: var(--monte); border-color: var(--monte); color: var(--blanco); }

.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.gallery-item {
  position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 4/3;
  background: var(--quebracho); cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .spec-tag {
  position: absolute; left: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: rgba(28,40,24,.88); color: var(--paja-light);
  padding: 4px 9px; border-radius: 3px; letter-spacing: .02em;
}
.gallery-item .cat-tag {
  position: absolute; right: 8px; top: 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  background: rgba(200,154,62,.92); color: var(--corteza);
  padding: 3px 8px; border-radius: 3px;
}
.empty-gallery {
  padding: 60px 20px; text-align: center; color: var(--quebracho);
  border: 1.5px dashed rgba(107,66,38,.35); border-radius: 8px;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(28,24,20,.92);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 6px; }
.lightbox .lb-caption { color: var(--lino); font-family: var(--mono); font-size: 13px; text-align: center; margin-top: 14px; }
.lightbox .lb-close {
  position: absolute; top: 24px; right: 32px; color: var(--lino);
  font-size: 34px; cursor: pointer; line-height: 1; background: none; border: none;
}
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none; color: var(--lino);
  font-size: 28px; padding: 14px 18px; cursor: pointer; border-radius: 4px;
}
.lightbox .lb-prev { left: 24px; }
.lightbox .lb-next { right: 24px; }

/* ---------- CONTACTO ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact-info-card {
  background: var(--monte); color: var(--lino); border-radius: 8px; padding: 36px;
}
.contact-info-card h3 { color: var(--blanco); }
.contact-info-item { display: flex; gap: 14px; margin-bottom: 20px; align-items: flex-start; }
.contact-info-item .ico {
  width: 34px; height: 34px; border-radius: 50%; background: var(--paja);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--mono); font-weight: 700; color: var(--monte-dark); font-size: 14px;
}
form.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--quebracho); margin-bottom: 6px; display: block; }
input, textarea {
  width: 100%; padding: 12px 14px; border-radius: 5px; border: 1.5px solid rgba(107,66,38,.25);
  font-family: var(--body); font-size: 15px; background: var(--blanco); color: var(--corteza);
}
input:focus, textarea:focus { outline: 2px solid var(--paja); outline-offset: 1px; border-color: var(--paja); }
textarea { resize: vertical; min-height: 130px; }
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-weight: 600; }
.alert-success { background: #DCEBD9; color: var(--monte-dark); border: 1px solid #b8d6b1; }
.alert-error { background: #F6DDD3; color: #7a2b0f; border: 1px solid #eab99f; }

/* ---------- FOOTER ---------- */
footer.site-footer {
  background: var(--corteza); color: var(--lino-dark); padding: 48px 0 28px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-grid h4 { color: var(--paja-light); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; font-family: var(--mono); }
.footer-grid a { display: block; padding: 4px 0; opacity: .85; }
.footer-grid a:hover { opacity: 1; color: var(--paja-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px;
  display: flex; justify-content: space-between; font-size: 13px; opacity: .7; flex-wrap: wrap; gap: 8px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .hero .container, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero .container { padding-top: 40px; padding-bottom: 56px; }
  .products-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  nav.main-nav { position: fixed; top: 76px; left: 0; right: 0; background: var(--monte-dark); flex-direction: column; padding: 8px; display: none; }
  nav.main-nav.open { display: flex; }
  .nav-toggle { display: block; background: none; border: none; color: var(--lino); font-size: 26px; cursor: pointer; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}

/* Accesibilidad: reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
:focus-visible { outline: 2px solid var(--paja); outline-offset: 2px; }

/* ---------- <picture> dentro de contenedores con object-fit ---------- */
.gallery-item picture,
.hero-slide picture,
.product-photo picture,
.about-photo picture { display: block; width: 100%; height: 100%; }

/* ---------- BOTON FLOTANTE DE WHATSAPP ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  background: #25D366; color: #0B3D25;
  padding: 13px 18px 13px 15px; border-radius: 999px;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  transition: transform .15s, box-shadow .15s;
}
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.34); }
.wa-float svg { width: 24px; height: 24px; flex-shrink: 0; fill: #0B3D25; }
.wa-float .wa-label { white-space: nowrap; }
@media (max-width: 560px) {
  .wa-float { padding: 14px; right: 14px; bottom: 14px; }
  .wa-float .wa-label { display: none; }
}

/* ---------- ENLACE DE SALTO (accesibilidad) ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--paja); color: var(--monte-dark);
  padding: 12px 20px; font-weight: 700; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

/* ---------- FORMULARIO: estados ---------- */
form.contact-form button[disabled] { opacity: .6; cursor: progress; }
.field-error { color: #8f2f10; font-size: 13px; font-weight: 600; margin-top: 5px; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #b5462a; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- LIGHTBOX: estado de carga ---------- */
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.lightbox img { background: var(--quebracho) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3C/svg%3E") center no-repeat; }

/* ---------- MAPA DE UBICACIÓN ---------- */
.map-section { padding-top: 0; }
.map-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
}
.map-head h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.map-head p { margin: 6px 0 0; color: var(--quebracho); }
.map-frame {
  position: relative;
  aspect-ratio: 16 / 7;              /* reserva el espacio: el mapa no empuja el contenido al cargar */
  border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(62,42,27,.15);
  background: var(--lino-dark);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.btn-map { background: var(--monte); color: var(--lino); flex-shrink: 0; }
.btn-map:hover { background: var(--monte-dark); color: var(--paja-light); transform: translateY(-2px); }
.btn-map svg { width: 17px; height: 17px; fill: currentColor; }
@media (max-width: 560px) {
  .map-frame { aspect-ratio: 4 / 3; }
  .btn-map { width: 100%; justify-content: center; }
}


/* ============================================================
   EFECTOS
   Todo lo de acá es decorativo: si el JavaScript no corre o el
   visitante pidió reducir movimiento, la página se ve igual de
   completa, solo que quieta.
   ============================================================ */

:root {
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

::selection { background: var(--paja); color: var(--monte-dark); }

/* ---------- Aparición al hacer scroll ----------
   La clase .reveal la agrega js/main.js. Sin JS nunca se aplica
   y el contenido se ve normalmente desde el principio. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; will-change: auto; }

/* ---------- Header que se compacta al bajar (solo escritorio) ---------- */
@media (min-width: 861px) {
  .site-header { transition: box-shadow .3s var(--ease), background .3s var(--ease); }
  .site-header .container { transition: height .3s var(--ease); }
  .site-header .brand-mark { transition: transform .3s var(--ease); }
  .site-header.is-scrolled .container { height: 60px; }
  .site-header.is-scrolled { box-shadow: 0 6px 22px rgba(0,0,0,.26); }
  .site-header.is-scrolled .brand-mark { transform: scale(.86); }
}

/* ---------- Portada: paneo lento sobre la foto activa ---------- */
@keyframes paneo-lento {
  from { transform: scale(1); }
  to   { transform: scale(1.085); }
}
.hero-slide.active img { animation: paneo-lento 17s var(--ease-out) both; }

/* ---------- Galería: velo y lupa al pasar el mouse ---------- */
.gallery-item .spec-tag, .gallery-item .cat-tag { z-index: 2; }
.gallery-item img { transition: transform .55s var(--ease-out); }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.07); }
.gallery-item::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F1ECDF' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.4 15.4 21 21M10.5 7.8v5.4M7.8 10.5h5.4'/%3E%3C/svg%3E") center no-repeat,
    linear-gradient(to top, rgba(28,40,24,.62) 0%, rgba(28,40,24,.10) 55%, rgba(28,40,24,0) 100%);
  background-size: 38px 38px, auto;
  opacity: 0;
  transition: opacity .32s var(--ease);
}
.gallery-item:hover::after, .gallery-item:focus-visible::after { opacity: 1; }

/* ---------- Galería: entrada suave al cambiar de filtro ---------- */
@keyframes entrar {
  from { opacity: 0; transform: scale(.965) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.gallery-item.recien-visible { animation: entrar .38s var(--ease-out) both; }

/* ---------- Lightbox: entra con fundido y escala ---------- */
.lightbox {
  display: flex;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .28s var(--ease), visibility .28s;
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox figure { transform: scale(.955); transition: transform .34s var(--ease-out); }
.lightbox.open figure { transform: none; }
.lightbox .lb-close, .lightbox .lb-nav { transition: background .2s var(--ease), transform .2s var(--ease); }
.lightbox .lb-nav:hover { background: rgba(255,255,255,.22); }
.lightbox .lb-close:hover { transform: rotate(90deg); }

/* ---------- Botones y tarjetas: micro-interacción ---------- */
.btn { transition: transform .2s var(--ease-out), background .2s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(168,72,29,.34); }
.btn-map:hover, .wa-float:hover { box-shadow: 0 10px 26px rgba(0,0,0,.3); }
.filter-btn { transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease-out); }
.filter-btn:active { transform: scale(.96); }
.product-card { transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out); }
.product-card:hover { transform: translateY(-6px); box-shadow: 0 18px 38px rgba(43,58,41,.16); }
.contact-info-item .ico { transition: transform .25s var(--ease-out); }
.contact-info-card:hover .ico { transform: scale(1.06); }

/* ---------- Respetar "reducir movimiento" ----------
   Se repite el bloque acá abajo para que gane sobre todo lo anterior. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-slide.active img { transform: none !important; }
}
