/* =========================================================
   Cimapro: catálogo de soluciones
   Mundo visual: catálogo impreso de proveedor industrial.
   ========================================================= */

:root {
  /* Papel y tinta */
  --paper: #F2F3F1;
  --paper-2: #E6E8E5;
  --sheet: #FFFFFF;
  --ink: #15171A;
  --ink-2: #3A4047;
  --ink-3: #575E66;
  --rule: #BFC4C9;

  /* Pestañas de capítulo (colores de marca) */
  --navy: #1F4E7A;
  --orange: #F28C28;
  --orange-press: #DE7716;
  --orange-dark: #A3530A;
  --gold: #C8963E;
  --gold-dark: #7A5717;

  /* Tipografía: una familia, distintos anchos */
  --f: "Archivo", "Arial Narrow", system-ui, sans-serif;

  --gutter: 16px;
  --rail: 0px;
  --bar: 60px;
  --max: 1200px;
}

@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --rail: 52px; --bar: 0px; } }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 12px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2 + var(--rail));
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: calc(var(--gutter) + var(--rail));
}

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 300;
  padding: 10px 16px;
  background: var(--ink); color: #fff;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 52px;
  padding: 0 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  font-family: var(--f);
  font-stretch: 87%;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn:active { transform: translateY(1px); }

.btn-order { background: var(--orange); color: var(--ink); }
.btn-order:hover { background: var(--orange-press); }

.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* ---------- Cabecera ---------- */
.masthead { border-bottom: 1px solid var(--ink); background: var(--paper); }
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 72px;
}
.lockup img { height: 38px; width: auto; }
.masthead-tag {
  display: none;
  margin: 0 auto 0 0;
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: .9rem;
}
.masthead-phone {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-stretch: 87%;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}
.masthead-phone svg { width: 22px; height: 22px; color: #128C4B; }
.masthead-phone:hover span { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 900px) { .masthead-tag { display: block; } }
@media (max-width: 479px) {
  .lockup img { height: 32px; }
  .masthead-phone span { display: none; }
  .masthead-phone svg { width: 28px; height: 28px; }
}

/* ---------- Pestañas de capítulo ---------- */
.tabs { position: fixed; z-index: 120; display: grid; }
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  text-decoration: none;
  font-stretch: 87%;
  font-weight: 700;
  line-height: 1;
  background: var(--tab);
  color: var(--tab-ink);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;
}
.tab-l { --tab: var(--navy); --tab-ink: #fff; }
.tab-c { --tab: var(--orange); --tab-ink: var(--ink); }
.tab-a { --tab: var(--gold); --tab-ink: var(--ink); }
.tab-q { --tab: var(--ink); --tab-ink: #fff; }
.tab-key { font-stretch: 62%; font-weight: 800; font-size: 1.4rem; }
.tab-ico { width: 18px; height: 18px; }

/* Móvil y tablet: barra inferior al alcance del pulgar */
@media (max-width: 1023px) {
  .tabs {
    left: 0; right: 0; bottom: 0;
    grid-template-columns: repeat(4, 1fr);
    height: calc(var(--bar) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--ink);
  }
  .tab { flex-direction: column; font-size: .78rem; letter-spacing: .02em; text-transform: uppercase; }
  .tab.is-active { box-shadow: inset 0 4px 0 var(--ink); }
  .tab-q.is-active { box-shadow: inset 0 4px 0 var(--orange); }
}

/* Escritorio: pestañas de índice en el canto derecho */
@media (min-width: 1024px) {
  .tabs {
    right: 0; top: 50%;
    transform: translateY(-50%);
    gap: 4px;
    justify-items: end;
  }
  .tab {
    writing-mode: vertical-rl;
    width: 44px;
    padding: 1rem 0;
    min-height: 118px;
    border-radius: 6px 0 0 6px;
    font-size: .9rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: -1px 1px 3px rgba(21, 23, 26, .18);
  }
  .tab-key { margin-bottom: .5rem; }
  .tab-ico { margin-bottom: .45rem; }
  .tab:hover, .tab.is-active { transform: translateX(-8px); }
  .tab.is-active { box-shadow: -3px 2px 8px rgba(21, 23, 26, .28); }
}

/* ---------- Portada ---------- */
.cover { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.cover-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 980px) {
  .cover-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 3.5rem; }
}
.cover h1 {
  font-stretch: 75%;
  font-weight: 700;
  font-size: clamp(2.5rem, 1.3rem + 3.6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -.015em;
  max-width: 15ch;
  text-wrap: balance;
}
.h1-accent { display: block; color: var(--navy); }
.cover-lead {
  margin: 1.6rem 0 2.2rem;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 1.12rem;
}
.cover-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 479px) { .cover-actions .btn { width: 100%; } }

/* Plano */
.cover-plan {
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--ink);
}
.plan { width: 100%; height: auto; padding: 14px 14px 4px; }
.plan text { font-family: var(--f); }
.plan-dim path { stroke: var(--ink); stroke-width: 1; fill: none; }
.plan-dim .tick { stroke-width: 1.4; }
.plan-dim-text rect { fill: var(--sheet); }
.plan-dim-text text { font-size: 14px; font-stretch: 87%; font-weight: 600; fill: var(--ink); }
.plan-panel { fill: #E9EFF5; stroke: var(--ink); stroke-width: 2; }
.plan-hem { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 7 5; }
.plan-weld path { stroke: var(--navy); stroke-width: 1.2; stroke-dasharray: 2 4; fill: none; }
.plan-eyelets path { fill: none; stroke-linecap: round; }
.eye-ring { stroke: var(--ink); stroke-width: 11; }
.eye-hole { stroke: var(--sheet); stroke-width: 5; }
.eh { stroke-dasharray: 0 35.667; }
.ev { stroke-dasharray: 0 38.286; }
.plan-call path { fill: none; stroke: var(--orange-dark); stroke-width: 1.5; }
.plan-call circle { fill: none; stroke: var(--orange-dark); stroke-width: 2; }
.plan-call text { font-size: 14px; font-stretch: 87%; font-weight: 700; fill: var(--orange-dark); }
.plan-call .call-big { font-size: 40px; font-stretch: 75%; font-weight: 800; fill: var(--navy); }
.plan-call .call-sub { font-size: 14px; font-weight: 600; fill: var(--ink-2); }

.plan-block {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  border-top: 1px solid var(--ink);
  font-size: .9rem;
}
.plan-block span { padding: .55rem .9rem; display: grid; }
.plan-block span + span { border-left: 1px solid var(--ink); }
.plan-block b {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: no-preference) {
  .plan-panel { stroke-dasharray: 1440; animation: draw 1.1s cubic-bezier(.3, .7, .2, 1) both .15s; }
  .plan-hem, .plan-weld { animation: appear .5s ease-out both 1s; }
  .plan-eyelets { animation: appear .6s ease-out both 1.15s; }
  .plan-dim, .plan-dim-text, .plan-call { animation: appear .6s ease-out both 1.45s; }
}
@keyframes draw { from { stroke-dashoffset: 1440; } to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* Índice de contenido */
.toc { margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 2px solid var(--ink); }
.toc-title {
  padding: .8rem 0 .4rem;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.toc ol { display: grid; gap: .25rem 2rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .toc ol { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .toc ol { grid-template-columns: repeat(4, 1fr); } }
.toc a {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: .8rem;
  align-items: center;
  padding: .6rem 0;
  text-decoration: none;
}
.toc-key {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 3px;
  font-stretch: 62%;
  font-weight: 800;
  font-size: 1.12rem;
}
.toc-l { background: var(--navy); color: #fff; }
.toc-c { background: var(--orange); color: var(--ink); }
.toc-a { background: var(--gold); color: var(--ink); }
.toc-q { background: var(--ink); color: #fff; }
.toc-name { font-stretch: 87%; font-weight: 700; font-size: 1.12rem; line-height: 1.2; }
.toc-ref { color: var(--ink-3); font-size: .9rem; line-height: 1.3; }
.toc a:hover .toc-name { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Capítulos ---------- */
.chapter { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }
.ch-l { --sec: var(--navy); --sec-ink: #fff; --sec-dark: var(--navy); }
.ch-c { --sec: var(--orange); --sec-ink: var(--ink); --sec-dark: var(--orange-dark); }
.ch-a { --sec: var(--gold); --sec-ink: var(--ink); --sec-dark: var(--gold-dark); }
.ch-q { --sec: var(--ink); --sec-ink: #fff; --sec-dark: var(--ink); }

.band {
  background: var(--sec);
  color: var(--sec-ink);
  padding: clamp(2.2rem, 5vw, 3.5rem) 0;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.band-inner {
  display: grid;
  gap: 1rem 2.5rem;
  align-items: end;
}
@media (min-width: 900px) {
  .band-inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
.band h2, .band h1 {
  margin: 0;
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(2.2rem, 1.3rem + 3.2vw, 4rem);
  line-height: .95;
  text-transform: uppercase;
}
.band p { margin: 0; max-width: 50ch; font-size: 1.0625rem; }
.ch-l .band p, .ch-q .band p { color: #fff; }

/* ---------- Fichas ---------- */
.fichas { border-top: 2px solid var(--ink); }
.ficha {
  display: grid;
  gap: 1rem 1.6rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  grid-template-columns: 1fr;
  grid-template-areas: "code" "art" "body" "spec" "cta";
  align-items: start;
}
.ficha-code {
  grid-area: code;
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--sec-dark);
}
.ficha-art {
  grid-area: art;
  width: 100%;
  max-width: 220px;
  height: auto;
  background: var(--sheet);
}
.ficha-body { grid-area: body; }
.ficha-body h3 { font-stretch: 87%; font-weight: 700; font-size: 1.4rem; margin-bottom: .4rem; }
.ficha-body p { margin: 0; color: var(--ink-2); max-width: 56ch; }
.ficha-spec { grid-area: spec; font-size: .9rem; }
.ficha-spec div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: .5rem;
  padding: .15rem 0;
}
.ficha-spec dt { color: var(--ink-3); }
.ficha-spec dd { font-weight: 500; }
.ficha-cta {
  grid-area: cta;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  color: var(--sec-dark);
  font-stretch: 87%;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}
.ficha-cta svg { width: 18px; height: 18px; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.ficha-cta:hover { text-decoration: underline; text-underline-offset: 4px; }
.ficha-cta:hover svg { transform: translateX(4px); }

@media (min-width: 760px) {
  .ficha {
    grid-template-columns: 64px 170px minmax(0, 1fr);
    grid-template-areas: "code art body" "code art spec" "code art cta";
  }
}
@media (min-width: 1140px) {
  .ficha {
    grid-template-columns: 64px 176px minmax(0, 1fr) 290px auto;
    grid-template-areas: "code art body spec cta";
    gap: 1rem 1.8rem;
  }
}

/* Dibujos de ficha: mismo lenguaje que el plano de portada */
.ficha-art .gd { stroke: var(--ink); stroke-width: 1; fill: none; }
.ficha-art .ln { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; }
.ficha-art .tp { fill: #E9EFF5; stroke: var(--ink); stroke-width: 1.5; }
.ficha-art .cl { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.2; }
.ficha-art .ac { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; }
.ficha-art .ak { fill: var(--ink); }
.ficha-art .tk { stroke: var(--ink); stroke-width: 3.5; fill: none; }
.ficha-art .gl { stroke: var(--ink); stroke-width: .9; opacity: .45; fill: none; }
.ficha-art .fd { stroke: var(--ink); stroke-width: .9; opacity: .45; fill: none; }
.ficha-art .hm { stroke: var(--ink); stroke-width: .9; stroke-dasharray: 3 2; fill: none; }
.ficha-art .fr { stroke: var(--ink); stroke-width: 2; fill: none; }
.ficha-art .cut { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 3; fill: none; }
.ficha-art .ey-r { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; fill: none; }
.ficha-art .ey-h { stroke: var(--sheet); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.ficha-art .dm path { stroke: var(--orange-dark); stroke-width: 1; fill: none; }
.ficha-art .dt { font-family: var(--f); font-size: 11px; font-stretch: 87%; font-weight: 700; fill: var(--orange-dark); }

/* ---------- Ficha técnica y guía ---------- */
.specs {
  display: grid;
  gap: 2.5rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
@media (min-width: 980px) { .specs { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 3.5rem; } }
.specs h3 {
  font-stretch: 87%;
  font-weight: 700;
  font-size: 1.4rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid var(--ink);
}
.specs-intro { margin: .9rem 0 .4rem; color: var(--ink-2); max-width: 60ch; }
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th, .table td {
  padding: .7rem .8rem .7rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}
.table tbody th { font-weight: 600; width: 34%; }
.table thead th {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--ink);
}
.table-gauge tbody th { width: auto; }
.table-gauge td:nth-child(2) { white-space: nowrap; }
.table-gauge td:last-child { color: var(--ink-2); }
.note { margin: .9rem 0 0; max-width: 70ch; color: var(--ink-3); font-size: .9rem; }

/* ---------- Anexo técnico ---------- */
.annex-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(1.8rem, 4vw, 2.5rem);
  padding: 1.1rem 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.annex-tag {
  flex: none;
  padding: .2rem .55rem;
  border-radius: 3px;
  background: var(--navy);
  color: #fff;
  font-stretch: 87%;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.annex-text { flex: 1; font-stretch: 87%; font-weight: 600; font-size: 1.12rem; }
.annex-link svg { flex: none; width: 22px; height: 22px; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.annex-link:hover .annex-text { text-decoration: underline; text-underline-offset: 4px; }
.annex-link:hover svg { transform: translateX(4px); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  font-stretch: 87%;
  font-weight: 700;
  text-decoration: none;
}
.back-link svg { width: 18px; height: 18px; transform: rotate(180deg); }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.annex .specs { margin-top: 1.5rem; }
.annex-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
}
.annex-cta p { margin: 0; flex: 1 1 22rem; font-size: 1.12rem; max-width: 52ch; }

/* ---------- Láminas (fotos de trabajos) ---------- */
.plates {
  display: grid;
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
@media (min-width: 760px) { .plates { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .plates { grid-template-columns: 1fr 1fr 1.15fr; } }
.plate { margin: 0; }
.plate-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  cursor: zoom-in;
}
.plate-open img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.plates-a .plate-open img { aspect-ratio: 4 / 3; }
@media (min-width: 760px) {
  .plates-a { grid-template-columns: 1fr; }
  .plates-a .plate { display: grid; grid-template-columns: minmax(0, 738px) minmax(0, 1fr); gap: 1.8rem; align-items: start; }
  .plates-a figcaption { margin: 0; padding-top: .7rem; border-top: 2px solid var(--ink); font-size: 1.0625rem; max-width: 34ch; }
  .plates-a figcaption b { display: block; margin: 0 0 .3rem; font-size: 1.6rem; line-height: 1; }
}
.plate figcaption { margin-top: .6rem; font-size: .9rem; color: var(--ink-2); }
.plate figcaption b { margin-right: .5rem; font-stretch: 75%; font-weight: 800; font-size: 1.0625rem; color: var(--sec-dark); }
.plate-open:hover img { filter: contrast(1.05); }

.procedure { align-self: start; }
@media (min-width: 760px) and (max-width: 1099px) { .procedure { grid-column: 1 / -1; } }
.procedure h3 {
  font-stretch: 87%;
  font-weight: 700;
  font-size: 1.4rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid var(--ink);
}
.procedure ol { counter-reset: step; }
.procedure li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  column-gap: .6rem;
  padding: .7rem 0;
}
.procedure li::before {
  content: counter(step);
  grid-row: span 2;
  font-stretch: 62%;
  font-weight: 800;
  font-size: 2.2rem;
  line-height: .9;
  color: var(--sec-dark);
}
.procedure b { font-stretch: 87%; font-weight: 700; font-size: 1.12rem; }
.procedure span { color: var(--ink-2); font-size: .9rem; }

/* ---------- Cotizar ---------- */
.quote { display: grid; gap: 2.5rem; }
@media (min-width: 980px) { .quote { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 3.5rem; align-items: start; } }
.send h3 {
  font-stretch: 87%;
  font-weight: 700;
  font-size: 1.4rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid var(--ink);
}
.send li {
  position: relative;
  padding: .45rem 0 .45rem 1.6rem;
}
.send li::before {
  content: "";
  position: absolute;
  left: 0; top: .8rem;
  width: 10px; height: 10px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.contact { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.contact div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .8rem;
  padding: .45rem 0;
  align-items: baseline;
}
.contact dt {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contact-wa { font-stretch: 87%; font-weight: 800; font-size: 1.4rem; text-decoration: none; }
.contact-wa:hover { text-decoration: underline; text-underline-offset: 4px; }
.pending { color: var(--ink-3); font-style: italic; }

/* Hoja de cotización */
.sheet { background: var(--sheet); border: 2px solid var(--ink); }
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .9rem 1.1rem;
  border-bottom: 2px solid var(--ink);
}
.sheet-head h3 { font-stretch: 75%; font-weight: 800; font-size: 1.6rem; text-transform: uppercase; }
.sheet-date { font-size: .9rem; color: var(--ink-3); white-space: nowrap; }
.sheet-date b { color: var(--ink); font-weight: 600; margin-left: .3rem; }
.sheet-row {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--rule);
}
.sheet-row label {
  padding: .8rem 1.1rem 0;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-3); }
.sheet input, .sheet select, .sheet textarea {
  width: 100%;
  min-height: 48px;
  padding: .55rem 1.1rem .8rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}
.sheet textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.sheet textarea::placeholder { color: var(--ink-3); }
.sheet select {
  appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315171A' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 18px;
  cursor: pointer;
}
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { outline: none; background-color: #FFF4E8; }
.sheet-row:focus-within { box-shadow: inset 0 -2px 0 var(--orange-dark); }
.sheet-row:has([aria-invalid="true"]) { background: #FDEDED; }
.sheet-row:has([aria-invalid="true"]) label { color: #9B1C1C; }
@media (min-width: 640px) {
  .sheet-row { grid-template-columns: 11rem 1fr; }
  .sheet-row label { padding: 1rem 0 1rem 1.1rem; }
  .sheet input, .sheet select, .sheet textarea { padding: .9rem 1.1rem; }
}
.form-error {
  margin: 0;
  padding: .8rem 1.1rem;
  background: #FDEDED;
  color: #9B1C1C;
  font-weight: 600;
  font-size: .9rem;
  border-bottom: 1px solid var(--rule);
}
.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.2rem;
  padding: 1.1rem;
}
.sheet-hint { margin: 0; flex: 1 1 14rem; font-size: .9rem; color: var(--ink-3); }
@media (max-width: 479px) { .sheet-foot .btn { width: 100%; } }

/* ---------- Contraportada ---------- */
.backcover {
  background: var(--paper-2);
  border-top: 8px solid transparent;
  border-image: linear-gradient(90deg, var(--navy) 0 25%, var(--orange) 25% 50%, var(--gold) 50% 75%, var(--ink) 75% 100%) 1;
}
.backcover-inner {
  display: grid;
  gap: 1.5rem 2rem;
  align-items: center;
  padding-block: 2.5rem;
}
@media (min-width: 760px) { .backcover-inner { grid-template-columns: auto 1fr auto; } }
.backcover-iso { width: 72px; height: auto; }
.backcover-id p { margin: 0; color: var(--ink-2); }
.backcover-id .backcover-name { color: var(--ink); font-stretch: 75%; font-weight: 800; font-size: 1.6rem; text-transform: uppercase; line-height: 1.1; }
.backcover-index { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-stretch: 87%; font-weight: 700; }
.backcover-index a { text-decoration: none; }
.backcover-index a:hover { text-decoration: underline; text-underline-offset: 4px; }
.backcover-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
  font-size: .9rem;
  color: var(--ink-3);
}
.backcover-foot a { color: var(--ink); font-weight: 600; text-decoration: none; }
.backcover-foot a:hover { text-decoration: underline; }

/* ---------- Lightbox ---------- */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(92vw, 960px);
  max-height: 90vh;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(21, 23, 26, .9); }
.lightbox img { max-height: 84vh; width: auto; border: 1px solid #fff; }
.lb-close {
  position: absolute;
  top: -52px; right: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 2px solid #fff;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
.lb-close svg { width: 20px; height: 20px; }

/* ---------- Apariciones al hacer scroll ----------
   Solo con la clase .motion (la pone main.js si hay IntersectionObserver
   y no se pidió movimiento reducido). Sin JS, todo se ve de inmediato.
   Los keyframes solo definen el punto de partida: cada elemento termina
   en su estilo normal. */
:root { --out: cubic-bezier(.33, 1, .68, 1); }
@keyframes rv-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes rv-fade { from { opacity: 0; } }
@keyframes rv-slide { from { opacity: 0; transform: translateX(-28px); } }
@keyframes rv-settle { from { transform: scale(1.06); } }
@keyframes rv-draw { from { stroke-dashoffset: 1; fill-opacity: 0; } 55% { fill-opacity: 0; } }

/* Elementos simples y listas */
.motion .rv:not(.band-inner):not(.ficha):not(.plate):not(.is-in) { opacity: 0; }
.motion .rv.is-in:not(.band-inner):not(.ficha):not(.plate) { animation: rv-up .9s var(--out) var(--d, 0s) both; }

/* Banda de capítulo: el título se desliza suave desde el canto, como una pestaña */
.motion .band-inner.rv:not(.is-in) > * { opacity: 0; }
.motion .band-inner.is-in h2, .motion .band-inner.is-in h1 { animation: rv-slide 1.2s var(--out) .12s both; }
.motion .band-inner.is-in p { animation: rv-up 1s var(--out) .35s both; }

/* Ficha: el dibujo se traza como el plano de portada; el resto entra escalonado */
.motion .ficha-art .dw { stroke-dasharray: 1; }
.motion .ficha.rv:not(.is-in) > :not(.ficha-art),
.motion .ficha.rv:not(.is-in) .ficha-art .fx { opacity: 0; }
.motion .ficha.rv:not(.is-in) .ficha-art .dw { stroke-dashoffset: 1; fill-opacity: 0; }
.motion .ficha.is-in .ficha-code { animation: rv-up .8s var(--out) both; }
.motion .ficha.is-in .ficha-body { animation: rv-up .8s var(--out) .12s both; }
.motion .ficha.is-in .ficha-spec { animation: rv-up .8s var(--out) .2s both; }
.motion .ficha.is-in .ficha-cta { animation: rv-up .8s var(--out) .28s both; }
.motion .ficha.is-in .ficha-art .dw { animation: rv-draw 1.3s var(--out) both; }
.motion .ficha.is-in .ficha-art .fx { animation: rv-fade .5s ease-out .75s both; }

/* Láminas: la foto aparece con un fundido y se asienta con un leve zoom */
.motion .plate.rv:not(.is-in) > * { opacity: 0; }
.motion .plate.rv .plate-open { overflow: hidden; }
.motion .plate.is-in .plate-open { animation: rv-up 1.3s var(--out) both; }
.motion .plate.is-in .plate-open img { animation: rv-settle 1.8s var(--out) both; }
.motion .plate.is-in figcaption { animation: rv-fade .8s ease-out .5s both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
