/* Factoría Grupo Textil · styles.css */

/* Fuentes alojadas en el sitio (licencia SIL OFL, ver assets/fonts) */
@font-face {
  font-family: "Archivo"; src: url("/assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-var.woff2") format("woff2");
  font-weight: 100 1000; font-style: normal; font-display: swap;
}

:root {
  --ink: #17191b;
  --ink-2: #4a4f55;
  --paper: #fbf8f3;
  --cream: #f3ede3;
  --line: #e2d9cb;

  --petroleo: #1d5f73;
  --naranja: #e0552b;
  --mostaza: #e6a82a;
  --bordo: #a3173a;

  --wa: #168a4a;
  --wa-hover: #10733c;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23,25,27,.06), 0 8px 24px -12px rgba(23,25,27,.18);

  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.08; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--mostaza); outline-offset: 3px; border-radius: 6px; }

/* ── Iconos */
.ico { width: 1.15em; height: 1.15em; flex: none; }

/* ── Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .8em 1.25em; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 1rem; line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s, transform .18s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .6em 1em; font-size: .92rem; }
.btn-lg { padding: 1em 1.5em; font-size: 1.06rem; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-line { background: var(--c, var(--ink)); color: #fff; }
.btn-line:hover { filter: brightness(.88); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .35em;
  background: none; border: 0; padding: .2em 0; cursor: pointer;
  font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
  text-decoration-color: var(--mostaza);
}
.link-arrow::after { content: "→"; transition: transform .18s; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ── Costura (detalle textil) */
.stitch { position: relative; }
.stitch::after {
  content: ""; position: absolute; inset: 9px; pointer-events: none;
  border: 1.5px dashed rgba(255,255,255,.75); border-radius: calc(var(--radius) - 6px);
}

/* ── Textos comunes */
.eyebrow {
  font-family: var(--f-display); font-weight: 700; font-stretch: 100%;
  text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; color: var(--naranja);
  margin-bottom: .9rem;
}
.title {
  font-family: var(--f-display); font-weight: 900; font-stretch: 75%;
  text-transform: uppercase; font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -.005em;
}
.section-lead { color: var(--ink-2); font-size: 1.08rem; max-width: 60ch; margin-top: 1rem; }

/* ── Header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(251,248,243,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(0,0,0,.4); }
.header-row { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--f-display); font-weight: 800; font-stretch: 110%; font-size: 1.32rem; letter-spacing: .02em; }
.brand-sub { font-size: .66rem; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav > a:not(.btn) { text-decoration: none; font-weight: 600; font-size: .96rem; position: relative; }
.nav > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px; background: var(--naranja); transition: right .2s;
}
.nav > a:not(.btn):hover::after { right: 0; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .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); }

  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-open .nav { transform: none; opacity: 1; visibility: visible; }
  .nav > a:not(.btn) { padding: 14px 0; border-bottom: 1px dashed var(--line); font-size: 1.05rem; }
  .nav > a:not(.btn)::after { display: none; }
  .nav .btn { margin-top: 16px; }
}

/* ── Hero */
.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 6vw, 80px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 64px); align-items: center; }

.display {
  font-family: var(--f-display); font-weight: 900; font-stretch: 72%;
  text-transform: uppercase; font-size: clamp(2.5rem, 6.6vw, 5.2rem); line-height: .95; letter-spacing: -.01em;
}
.hl {
  display: inline-block; background: var(--mostaza); color: var(--ink);
  padding: .02em .14em .04em; margin-left: -.06em; transform: rotate(-1deg); box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.display-sub {
  display: block; margin-top: .55em;
  font-family: var(--f-body); font-weight: 700; font-size: clamp(.95rem, 1.7vw, 1.2rem);
  letter-spacing: .32em; color: var(--ink-2);
}
.lead { font-size: clamp(1.05rem, 1.5vw, 1.18rem); color: var(--ink-2); max-width: 54ch; margin-top: 1.4rem; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }

.checks { list-style: none; padding: 0; margin: 1.8rem 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.checks li { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.checks li::before {
  content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: var(--petroleo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}

.hero-art { margin: 0; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); transform: rotate(1.2deg); }
.hero-art::after { border-color: rgba(23,25,27,.22); }
.hero-art img { width: 100%; }

@media (max-width: 600px) { .display { font-size: 12vw; } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { transform: none; max-width: 520px; }
}

/* ── Públicos */
.audiences { padding-bottom: clamp(48px, 7vw, 88px); }
.aud-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.aud { border-radius: var(--radius); padding: clamp(24px, 3.5vw, 40px); display: flex; flex-direction: column; gap: 12px; }
.aud h2 { font-family: var(--f-display); font-weight: 800; font-stretch: 85%; font-size: clamp(1.5rem, 2.6vw, 2rem); text-transform: uppercase; }
.aud p:not(.aud-tag) { color: inherit; opacity: .88; max-width: 48ch; }
.aud .link-arrow { margin-top: auto; align-self: flex-start; }
.aud-tag { font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; }
.aud-a { background: var(--petroleo); color: #fff; }
.aud-a .aud-tag { color: var(--mostaza); }
.aud-b { background: var(--naranja); color: #fff; }
.aud-b .aud-tag { color: #fff2d6; }
.aud .link-arrow { text-decoration-color: currentColor; }

@media (max-width: 760px) { .aud-grid { grid-template-columns: 1fr; } }

/* ── Secciones */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--cream); }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }

/* ── Líneas */
.lines { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 72px); }
.line { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.line:nth-child(even) .line-media { order: 2; }

.line-media {
  border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow);
  justify-self: center; width: 100%; max-width: 440px;
}
.line-media img { width: 100%; max-height: 560px; object-fit: cover; object-position: top; cursor: zoom-in; }
.line-media::after { border-color: color-mix(in srgb, var(--c) 55%, transparent); }

.line-body { position: relative; padding-left: 22px; border-left: 4px solid var(--c); }
.line-logo { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 14px; }
.line h3 { font-family: var(--f-display); font-weight: 900; font-stretch: 80%; text-transform: uppercase; font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.line-tag { color: var(--c); font-weight: 700; font-size: 1.1rem; margin-top: 4px; }

.bullets { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 26px; }
.bullets li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 14px; height: 0;
  border-top: 2px dashed var(--c);
}
.line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

@media (max-width: 820px) {
  .line { grid-template-columns: 1fr; }
  .line:nth-child(even) .line-media { order: 0; }
  .line-media { max-width: 520px; justify-self: start; }
  .line-media img { max-height: 420px; }
}

/* ── Catálogo */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  border: 1.5px solid var(--ink); background: transparent; border-radius: 999px;
  padding: .45em 1em; font-weight: 600; font-size: .92rem; cursor: pointer; transition: background-color .15s, color .15s;
}
.chip:hover { background: rgba(23,25,27,.06); }
.chip[aria-selected="true"] { background: var(--ink); color: var(--paper); }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.product {
  background: #fff; border-radius: var(--radius-sm); padding: 20px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px; transition: transform .18s, box-shadow .18s;
}
.product:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.p-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--naranja); }
.p-name { font-family: var(--f-display); font-weight: 800; font-stretch: 90%; font-size: 1.12rem; line-height: 1.2; }
.p-desc { color: var(--ink-2); font-size: .94rem; }
.p-sizes { list-style: none; padding: 0; margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.p-sizes li {
  font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  background: var(--cream); border: 1px dashed #cdbfa9;
}
.more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.p-actions { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

/* ── Proceso */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.step { position: relative; padding: 28px 24px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 46px; right: -21px; width: 22px; border-top: 2px dashed var(--naranja);
}
.step-n { font-family: var(--f-display); font-weight: 900; font-stretch: 75%; font-size: 2.6rem; line-height: 1; color: var(--naranja); }
.step h3 { font-family: var(--f-display); font-weight: 800; font-stretch: 85%; text-transform: uppercase; font-size: 1.3rem; margin: 12px 0 8px; }
.step p { color: var(--ink-2); font-size: .97rem; }

@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2)::after { display: none; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .step::after { display: none; }
}

/* ── Trabajos (sección oscura) */
.section-dark { background: #141618; color: #f3ede3; }
.section-dark .eyebrow { color: var(--mostaza); }

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 240px; grid-auto-flow: dense; gap: 12px;
}
.g-item {
  position: relative; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in;
  background: #222; text-align: left;
}
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.g-item:hover img { transform: scale(1.04); }
.g-item span {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  font-weight: 700; font-size: .86rem; color: #fff;
  background: rgba(20,22,24,.78); padding: 6px 10px; border-radius: 8px; width: fit-content; max-width: calc(100% - 20px);
}
.g-tall { grid-row: span 2; }
.g-wide { grid-column: span 2; }
@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 170px; gap: 8px; }
  .g-item span { font-size: .74rem; padding: 4px 7px; left: 6px; bottom: 6px; }
}

.gallery-cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; font-weight: 700; font-size: 1.1rem; }

/* ── Contacto */
.contact {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center;
  background: var(--petroleo); color: #fff; border-radius: calc(var(--radius) + 6px);
  padding: clamp(28px, 5vw, 64px);
}
.contact .eyebrow { color: var(--mostaza); }
.contact .section-lead { color: rgba(255,255,255,.85); margin-bottom: 1.6rem; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.05rem; }
.contact-list .ico { width: 24px; height: 24px; color: var(--mostaza); }
.contact-list a { text-decoration: none; border-bottom: 1.5px dashed rgba(255,255,255,.55); }
.contact-list a:hover { border-bottom-style: solid; }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }

/* ── Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 24px; background: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; align-items: start; }
.footer-logo { width: 200px; height: auto; mix-blend-mode: multiply; }
.f-title { font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--ink-2); margin-bottom: 12px; }
.site-footer nav { display: grid; gap: 6px; }
.site-footer nav a { text-decoration: none; font-weight: 500; }
.site-footer nav a:hover { color: var(--naranja); }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--ink); transition: background-color .15s, color .15s;
}
.socials a:hover { background: var(--ink); color: var(--paper); }
.footer-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: .88rem; color: var(--ink-2); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ── WhatsApp flotante */
.wa-float {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 18px 0 16px; border-radius: 999px;
  background: var(--wa); color: #fff; text-decoration: none; font-weight: 700;
  box-shadow: 0 10px 28px -8px rgba(16,115,60,.6);
  transition: background-color .18s, transform .18s;
}
.wa-float:hover { background: var(--wa-hover); transform: translateY(-2px); }
.wa-float svg { width: 30px; height: 30px; flex: none; }
.wa-float::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--wa);
  animation: pulse 2.4s ease-out infinite; pointer-events: none;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wa-float::before { animation: none; display: none; } }
@media (max-width: 640px) {
  .wa-float { width: 60px; padding: 0; justify-content: center; }
  .wa-float-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ── Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(92vw, 1100px); max-height: 92vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(10,11,12,.86); }
.lightbox img { max-width: min(92vw, 1100px); max-height: 82vh; width: auto; margin-inline: auto; border-radius: 10px; }
.lb-caption { color: #f3ede3; text-align: center; margin-top: 10px; font-weight: 600; }
.lb-close {
  position: absolute; top: -14px; right: -14px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #fff; color: var(--ink); font-size: 1.7rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
}
@media (max-width: 640px) { .lb-close { top: -52px; right: 0; } }

/* ── Animación de entrada */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
