/* =====================================================================
   Latitud 40 · COMPONENTES
   Botones, marcos, cifras, celdas del bento, pasos con cuerda, specs,
   acordeón, etiquetas, marquee, formulario, aviso.
   ===================================================================== */

/* ---- Botones ---- */
.btn {
  --h: 54px; display: inline-flex; align-items: center; gap: 14px; height: var(--h); padding: 0 8px 0 24px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: calc(15px * var(--k-btn)); white-space: nowrap; cursor: pointer;
  transition: transform .6s var(--ease), background .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease);
}
.btn .ic { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; flex: none; transition: transform .6s var(--ease), background .4s var(--ease); }
.btn .ic .ic-svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary .ic { background: rgba(0, 0, 0, .28); }
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:hover .ic { transform: translate(2px, -2px) scale(1.06); }
.btn-ghost { background: var(--bezel); border-color: var(--line2); color: var(--text); }
.btn-ghost .ic { background: var(--accent-soft); color: var(--accent-2); }
.btn-ghost:hover { border-color: var(--text); }
.btn-ghost:hover .ic { transform: translate(2px, -2px); }
.btn-sm { --h: 44px; font-size: calc(14px * var(--k-btn)); padding-left: 18px; gap: 10px; }
.btn-sm .ic { width: 30px; height: 30px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.link-arrow .ic-svg { width: 16px; height: 16px; color: var(--accent-2); transition: transform .5s var(--ease); }
.link-arrow:hover .ic-svg { transform: translate(2px, -2px); }

/* ---- Marco doble (imagen dentro de bandeja) ---- */
.bezel { padding: 8px; border-radius: var(--r); background: var(--bezel); border: 1px solid var(--line); box-shadow: var(--inset-hi), var(--shadow); }
.bezel > * { border-radius: var(--r-in); overflow: hidden; }
.bezel .ph { position: relative; }
.bezel .ph::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .12); border-radius: inherit; pointer-events: none; }

/* ---- Franja de cifras ---- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--band-bg); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 38px 28px 38px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-family: var(--font-display); font-variation-settings: "wdth" var(--display-wdth); font-weight: var(--display-wght); font-size: clamp(2rem, 3.4vw, 3.2rem); letter-spacing: -.02em; line-height: 1; }
.stat span { display: block; margin-top: 12px; font-size: calc(14px * var(--k-body, 1)); color: var(--muted); max-width: 26ch; line-height: 1.45; }

/* ---- Bento de servicios ---- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(220px, auto); gap: 14px; }
.cell {
  position: relative; border-radius: var(--r); background: var(--surf); border: 1px solid var(--line); overflow: hidden; padding: 28px;
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 260px; box-shadow: var(--inset-hi);
  transition: transform .8s var(--ease), border-color .5s;
}
.cell:hover { transform: translateY(-4px); border-color: var(--line2); }
.cell h3 { font-size: var(--fs-h3); letter-spacing: -.015em; line-height: 1.08; margin-bottom: 10px; }
.cell p { font-size: calc(15px * var(--k-body, 1)); color: var(--muted); max-width: 40ch; }
.cell .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; margin-bottom: auto; }
.cell .ico .ic-svg { width: 22px; height: 22px; }
.cell .more { margin-top: 16px; font-size: calc(14px * var(--k-body, 1)); }
.cell.img { color: #fff; min-height: 320px; }
.cell.img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transform: scale(1.03); transition: transform 1.4s var(--ease); }
.cell.img:hover > img { transform: scale(1.08); }
.cell.img::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(11, 12, 14, .92) 0%, rgba(11, 12, 14, .45) 45%, rgba(11, 12, 14, .05) 100%); }
.cell.img h3, .cell.img p, .cell.img .more { position: relative; z-index: 2; }
.cell.img p { color: rgba(243, 241, 236, .78); }
.cell.img .link-arrow { color: #fff; }
/* Celdas con tono propio (campo "tono" del servicio en content.json) */
.cell[class*="tono-"] { color: #fff; }
.cell[class*="tono-"] .ico { background: rgba(255, 255, 255, .14); color: #fff; }
.cell[class*="tono-"] p { color: rgba(255, 255, 255, .78); }
.cell[class*="tono-"] .link-arrow, .cell[class*="tono-"] .link-arrow .ic-svg { color: #fff; }
.cell.tono-rojo  { background: linear-gradient(135deg, var(--accent-deep), color-mix(in srgb, var(--accent-deep) 65%, #000) 60%, color-mix(in srgb, var(--accent-deep) 45%, #000)); border-color: rgba(255, 90, 96, .25); }   /* pintura */
.cell.tono-agua  { background: linear-gradient(135deg, #0f4c5c, #0b2f3d 60%, #071c26); border-color: rgba(90, 190, 210, .28); }            /* sellos e impermeabilización */
.cell.tono-ambar { background: linear-gradient(135deg, #8a5a12, #5a3a0a 60%, #34210a); border-color: rgba(240, 180, 80, .28); }           /* inspección */
.c1 { grid-column: 1 / 8; grid-row: 1 / 3; min-height: 520px; }
.c2 { grid-column: 8 / 13; } .c3 { grid-column: 8 / 13; }
.c4 { grid-column: 1 / 5; } .c5 { grid-column: 5 / 9; } .c6 { grid-column: 9 / 13; }

/* ---- Pasos con cuerda (se dibuja al entrar en pantalla) ---- */
.steps { position: relative; list-style: none; margin: 0; padding: 0 0 0 56px; }
.rope { position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--line2); }
.rope::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); transition: transform 1.8s var(--ease); }
.in .rope::after { transform: scaleY(1); }
.step { position: relative; padding: 8px 0 56px; }
.step:last-child { padding-bottom: 8px; }
.step::before { content: ""; position: absolute; left: -56px; top: 16px; width: 24px; height: 24px; border-radius: 999px; background: var(--bg2); border: 2px solid var(--line2); transition: border-color .6s var(--ease) .6s, background .6s var(--ease) .6s; }
.in .step::before { border-color: var(--accent); background: var(--accent); }
.step .n { font-family: var(--mono); font-size: calc(12px * var(--k-body, 1)); color: var(--dim); letter-spacing: .1em; display: block; margin-bottom: 10px; }
.step h3 { font-size: calc(clamp(1.5rem, 2.4vw, 2.2rem) * var(--k-h3)); letter-spacing: -.02em; margin-bottom: 12px; }
.step p { color: var(--muted); max-width: 52ch; }

/* ---- Tarjetas de especificación ---- */
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spec { padding: 24px; border-radius: var(--r-in); background: var(--surf); border: 1px solid var(--line); box-shadow: var(--inset-hi); }
.spec b { display: block; font-family: var(--mono); font-weight: 500; font-size: clamp(1.6rem, 2.4vw, 2.2rem); letter-spacing: -.03em; }
.spec span { display: block; margin-top: 8px; font-size: calc(14px * var(--k-body, 1)); color: var(--muted); line-height: 1.45; }
.spec.big b { font-family: var(--font); font-family: var(--font-display); font-variation-settings: "wdth" var(--display-wdth); font-weight: var(--display-wght); font-size: clamp(2.4rem, 4vw, 3.6rem); text-transform: uppercase; }

/* ---- Acordeón de documentación ---- */
.docs { border-radius: var(--r); background: var(--surf); border: 1px solid var(--line); padding: 8px; box-shadow: var(--inset-hi); }
/* Antecedentes: grupos siempre visibles (antes era un acordeón que se podía cerrar) */
.docs-grupo { border-top: 1px solid var(--line); padding: 16px 20px 6px; }
.docs-grupo:first-child { border-top: 0; }
.docs .docs-grupo h3 { padding: 0 0 12px; color: var(--text); font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; }
.docs ul { list-style: none; margin: 0; padding: 0 0 12px; display: grid; gap: 10px; }
.docs li { display: flex; gap: 12px; font-size: calc(14.5px * var(--k-body, 1)); color: var(--muted); line-height: 1.45; }
.docs li .ic-svg { width: 16px; height: 16px; flex: none; color: var(--accent-2); margin-top: 3px; }

/* ---- Lista con checks (fuera del acordeón) ---- */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; color: var(--muted); line-height: 1.5; }
.checks li .ic-svg { width: 18px; height: 18px; flex: none; color: var(--accent-2); margin-top: 4px; }
.checks.two { grid-template-columns: 1fr 1fr; column-gap: 24px; }

/* ---- Etiquetas ---- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--mono); font-size: calc(12px * var(--k-body, 1)); letter-spacing: .04em; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); }

/* ---- Marquee de trabajos ---- */
.marquee { --w: 240px; position: relative; overflow: hidden; mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
.track { display: flex; gap: 14px; width: max-content; animation: slide 60s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.shot { width: var(--w); aspect-ratio: 9 / 16; border-radius: var(--r-in); overflow: hidden; background: var(--surf); border: 1px solid var(--line); flex: none; position: relative; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.shot:hover img { transform: scale(1.05); }
.shot.land { width: calc(var(--w) * 1.6); aspect-ratio: 4 / 3; align-self: center; }

/* ---- Formulario ---- */
.form { border-radius: var(--r); background: var(--surf); border: 1px solid var(--line); padding: clamp(22px, 3vw, 36px); box-shadow: var(--inset-hi); display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: calc(13px * var(--k-body, 1)); font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font: inherit; font-size: calc(15px * var(--k-body, 1)); transition: border-color .3s, box-shadow .3s; }
.field textarea { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%238b8a85'><path d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/></svg>"); background-repeat: no-repeat; background-size: 16px; background-position: right 16px center; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { font-size: calc(12px * var(--k-body, 1)); color: var(--dim); }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.form-foot small { color: var(--dim); font-size: calc(12.5px * var(--k-body, 1)); max-width: 34ch; }

/* ---- Aviso flotante ---- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 70; background: var(--surf2); border: 1px solid var(--line2); color: var(--text); padding: 14px 20px; border-radius: 14px; font-size: calc(14px * var(--k-body, 1)); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), transform .5s var(--ease), visibility .5s; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .stat { padding: 26px 0 26px 20px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .bento { grid-template-columns: 1fr; }
  .cell, .c1, .c2, .c3, .c4, .c5, .c6 { grid-column: 1 / -1; grid-row: auto; min-height: 220px; }
  .c1 { min-height: 380px; }
  .form { grid-template-columns: 1fr; }
  .checks.two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .btn { --h: 50px; }
  .specs { grid-template-columns: 1fr; }
  .marquee { --w: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .rope::after { transform: scaleY(1); }
  .track { animation: none; flex-wrap: wrap; width: auto; }
}

/* Pase de fotos del hero: fundido cruzado con leve acercamiento (Ken Burns).
   Lo usan la portada y las cabeceras de Servicios, Seguridad y Trabajos. */
.slides { position: relative; }
.slides .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: 0; transform: scale(1.08); transition: opacity 1.4s var(--ease), transform 7s linear; will-change: opacity, transform; }
.slides .slide.is-on { opacity: 1; transform: scale(1); }
.slides .slide.is-off { opacity: 0; transform: scale(1); }
/* el pie del pase se funde al cambiar de foto */
.page-hero-visual figcaption #heroPie { transition: opacity .5s var(--ease); }
.page-hero-visual figcaption #heroPie.fade { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .slides .slide { transition: none; transform: none; } }
