/* =====================================================================
   Estilos comunes · Alfredo De Federico Mesa · Mobiliario del hogar
   Paleta: blanco ↔ marrón clarito, con acentos de nogal.
   ===================================================================== */

:root {
  --white: #ffffff;
  --cream: #faf6f0;
  --tan: #ecdfcd;          /* marrón clarito de las secciones */
  --tan-2: #dcc6a8;
  --wood: #b08560;
  --brown: #8b5e3c;        /* color principal */
  --brown-dark: #6e4728;
  --ink: #3b2a1e;          /* texto */
  --muted: #7d6a5a;
  --line: #e6d8c6;
  --ok: #3f7d4f;
  --err: #a8402e;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(59, 42, 30, .10);
  --shadow-lg: 0 24px 60px rgba(59, 42, 30, .18);
  --header-h: 76px;
  --fade: 140px;           /* altura del degradado entre secciones */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brown); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--brown); font-weight: 500;
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }

/* ---------------- Botones ---------------- */
.btn {
  --bg: var(--brown); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; border: 1.5px solid var(--bg);
  background: var(--bg); color: var(--fg); font: 500 .98rem var(--sans); letter-spacing: .02em;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--brown-dark); border-color: var(--brown-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: transparent; color: var(--brown); }
.btn-outline:hover { background: var(--brown); color: #fff; }
.btn-light { --bg: #fff; --fg: var(--brown); }
.btn-light:hover { background: var(--cream); border-color: var(--cream); color: var(--brown-dark); }
.btn-sm { padding: 8px 16px; font-size: .88rem; }
.btn-danger { --bg: var(--err); }
.btn-danger:hover { background: #8a3324; border-color: #8a3324; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brown); }
.btn-ghost:hover { background: var(--cream); border-color: var(--cream); color: var(--brown-dark); box-shadow: none; }

/* ---------------- Cabecera ---------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.site-header.scrolled { background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.brand span { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.05; }
.brand small { display: block; font-family: var(--sans); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 400; }

.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); font-size: .95rem; border-radius: 8px; }
.main-nav a:hover, .main-nav a.active { color: var(--brown); }
.main-nav .btn { color: #fff; margin-left: 8px; padding: 9px 18px; }
.main-nav .btn:hover { color: #fff; }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; border-radius: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .3s, opacity .3s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto; background: #fff; box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav-open .main-nav { max-height: 80vh; }
  .nav-open .site-header { background: #fff; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 10px 20px 22px; gap: 0; }
  .main-nav a { padding: 13px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .main-nav .btn { margin: 14px 0 0; justify-content: center; border-radius: 999px; border-bottom: 0; }
}

/* ---------------- Secciones y transiciones de color ---------------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.bg-white { background: var(--white); }
/* Las secciones marrón clarito se funden con el blanco arriba y abajo */
.bg-tan {
  background: linear-gradient(180deg,
    var(--white) 0,
    var(--tan) var(--fade),
    var(--tan) calc(100% - var(--fade)),
    var(--white) 100%);
}
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; }

/* ---------------- Portada ---------------- */
.hero {
  min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 0 100px;
  background:
    radial-gradient(1200px 600px at 85% 20%, rgba(255,255,255,.65), transparent 60%),
    linear-gradient(180deg, var(--tan) 0, var(--tan) 70%, var(--white) 100%);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--brown); }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-grid { grid-template-columns: .9fr 1.1fr; }
.hero-visual { position: relative; margin: 0; isolation: isolate; }
.hero-visual img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; border-radius: 24px; box-shadow: 0 30px 60px -12px rgba(59, 42, 30, .35), 0 12px 24px -8px rgba(59, 42, 30, .18); background: var(--tan-2); }
/* Eslogan dentro de la foto */
.hero-slogan {
  position: absolute; top: 26px; left: 30px; right: 30px;
  font-family: var(--serif); font-style: italic; font-weight: 700; line-height: 1.15;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem); color: #111;
  text-shadow: 0 0 18px rgba(255, 255, 255, .9), 0 0 4px rgba(255, 255, 255, .8);
}
.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); color: var(--muted); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue::after { content: ""; width: 1px; height: 36px; background: linear-gradient(var(--brown), transparent); animation: cue 2s infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-slogan { top: 16px; left: 18px; right: 18px; font-size: clamp(1.05rem, 4.6vw, 1.4rem); }
  .scroll-cue { display: none; }
}

/* ---------------- Empresa ---------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.feature { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform .25s, box-shadow .25s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature svg { width: 34px; height: 34px; color: var(--brown); margin-bottom: 12px; }
.feature h3 { font-size: 1.3rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .96rem; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ---------------- Alfredo ---------------- */
.owner { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: center; }
.owner-photo { position: relative; isolation: isolate; }
.owner-photo img { border-radius: 24px; box-shadow: var(--shadow-lg); aspect-ratio: 4/5; object-fit: cover; width: 100%; height: auto; background: var(--tan-2); }
/* Marco fino desplazado detrás de la foto */
.owner-photo::before { content: ""; position: absolute; inset: 22px -22px -22px 22px; border: 1.5px solid var(--wood); border-radius: 24px; z-index: -1; }
.owner blockquote { margin: 26px 0; padding-left: 22px; border-left: 3px solid var(--wood); font-family: var(--serif); font-size: 1.5rem; font-style: italic; line-height: 1.4; color: var(--brown-dark); }
.owner-sign { font-family: var(--serif); font-size: 1.3rem; }
.owner-sign small { display: block; font-family: var(--sans); font-size: .85rem; color: var(--muted); }
@media (max-width: 900px) {
  .owner { grid-template-columns: 1fr; gap: 50px; }
  .owner-photo { max-width: 380px; margin-inline: auto; width: calc(100% - 22px); }
}

/* ---------------- Trabajos (galería) ---------------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: clamp(200px, 22vw, 290px); gap: 18px; }
.gallery figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius); cursor: zoom-in; background: var(--tan); }
/* Mosaico (solo con 6, 12, 18… fotos), se repite cada 6: la 1.ª, 4.ª y 6.ª ocupan dos columnas → filas completas */
.gallery.mosaic figure:nth-child(6n+1), .gallery.mosaic figure:nth-child(6n+4), .gallery.mosaic figure:nth-child(6n) { grid-column: span 2; }
/* Con un número de fotos que no es múltiplo de 6 se usa una cuadrícula normal */
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption {
  position: absolute; inset: auto 0 0; padding: 40px 18px 14px; color: #fff; font-size: .95rem;
  background: linear-gradient(transparent, rgba(40, 26, 16, .72)); opacity: 0; transform: translateY(8px); transition: .3s;
}
.gallery figure:hover figcaption, .gallery figure:focus-visible figcaption { opacity: 1; transform: none; }
.gallery figure:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
@media (max-width: 900px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 220px; }
  .gallery.mosaic figure:nth-child(6n+4) { grid-column: auto; }
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; grid-auto-rows: 240px; }
  .gallery.mosaic figure:nth-child(6n+1), .gallery.mosaic figure:nth-child(6n) { grid-column: auto; }
  .gallery figcaption { opacity: 1; transform: none; }
}

/* Visor de fotos */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(28, 19, 12, .92); display: none; align-items: center; justify-content: center; padding: 60px 70px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 82vh; max-width: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox p { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #f3e8da; margin: 0; padding: 0 20px; }
.lb-btn { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 560px) { .lightbox { padding: 60px 10px; } .lb-prev, .lb-next { top: auto; bottom: 60px; transform: none; } }

/* ---------------- Fabricantes ---------------- */
.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.brand-card {
  background: #fff; border-radius: var(--radius); aspect-ratio: 3/2; display: grid; place-items: center; padding: 22px;
  box-shadow: 0 2px 10px rgba(59, 42, 30, .06); text-decoration: none; transition: transform .25s, box-shadow .25s;
}
a.brand-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.brand-card img { max-height: 70px; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .8; transition: filter .3s, opacity .3s; }
.brand-card:hover img { filter: none; opacity: 1; }
.brand-card span { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); text-align: center; }
.brands-empty { text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* ---------------- Contacto ---------------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; }
.contact-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 20px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list .ic { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--tan); display: grid; place-items: center; color: var(--brown); }
.contact-list .ic svg { width: 20px; height: 20px; }
.contact-list strong { display: block; font-weight: 500; }
.contact-list a, .contact-list span { color: var(--muted); text-decoration: none; }
.contact-list a:hover { color: var(--brown); }
.card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: clamp(24px, 4vw, 40px); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------------- Formularios ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--cream);
  font: 400 1rem var(--sans); color: var(--ink); transition: border-color .2s, background .2s, box-shadow .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--wood); background: #fff; box-shadow: 0 0 0 4px rgba(176, 133, 96, .15); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brown); flex: none; }
.legal-note { font-size: .78rem; color: var(--muted); line-height: 1.5; margin-top: 16px; padding: 12px 14px; background: var(--cream); border-radius: 10px; }
.legal-note p { margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: .95rem; margin-top: 16px; display: none; }
.alert.show { display: block; }
.alert.ok { background: #e6f2e8; color: var(--ok); }
.alert.err { background: #f7e4e0; color: var(--err); }

/* ---------------- Pie ---------------- */
.site-footer { background: var(--ink); color: #d8c7b4; padding: 54px 0 28px; font-size: .92rem; }
.site-footer .container { display: grid; gap: 24px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.site-footer .brand span { color: #fff; }
.site-footer .brand small { color: #b9a58f; }
.site-footer a { color: #f0e2d0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: #a8937d; font-size: .84rem; }

/* ---------------- Botón volver arriba ---------------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 50px; height: 50px; border-radius: 50%;
  border: 0; background: var(--brown); color: #fff; cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center; opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .3s, transform .3s, visibility .3s, background .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--brown-dark); }
.to-top svg { width: 22px; height: 22px; }

/* ---------------- Aparición suave al hacer scroll ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------------- Página legal ---------------- */
.legal { padding: calc(var(--header-h) + 50px) 0 90px; background: linear-gradient(180deg, var(--tan) 0, var(--white) 320px); }
.legal .container { max-width: 860px; }
.legal h2 { font-size: 1.7rem; margin-top: 2em; }
.legal table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: .95rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }
.legal th { background: var(--cream); width: 32%; font-weight: 500; }
@media (max-width: 560px) { .legal th, .legal td { display: block; width: 100%; } .legal td { border-top: 0; } }
