/* Fabián, construcción en seco — placa de yeso, perfil galvanizado y la cinta amarilla de obra. */
:root {
  --yeso: #f1efe9;
  --yeso-2: #e4e1d8;
  --blanco: #fffefb;
  --grafito: #1d1f22;
  --grafito-2: #2c2f33;
  --gris: #5d6166;
  --perfil: #aeb3b9;
  --cinta: #f2c230;
  --cinta-suave: #fbf3d6;
  --wa: #1f8f4e;
  --wa-hover: #187a42;
  --radio: 16px;
  --display: 'Satoshi', system-ui, sans-serif;
  --cuerpo: 'Switzer', system-ui, sans-serif;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--yeso);
  color: var(--grafito);
  font: 400 1.0625rem/1.55 var(--cuerpo);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.fb-visual-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.fb-saltar { position: absolute; left: -999px; top: 8px; background: var(--grafito); color: var(--yeso); padding: 8px 12px; border-radius: 8px; z-index: 30; }
.fb-saltar:focus { left: 8px; }

/* --- Arriba --- */
.fb-arriba { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
.fb-marca { font-family: var(--display); font-weight: 900; font-size: 1.2rem; line-height: 1.1; }
.fb-marca span { display: block; font-family: var(--cuerpo); font-weight: 500; font-size: 0.8rem; color: var(--gris); }
.fb-arriba-wa {
  font-weight: 600; font-size: 0.9rem; text-decoration: none; padding: 9px 14px; border-radius: 999px;
  border: 2px solid var(--grafito);
}
.fb-arriba-wa:hover { background: var(--grafito); color: var(--yeso); }
.fb-instalar { display: inline-flex; align-items: center; gap: 6px; background: var(--cinta); cursor: pointer; }
.fb-instalar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Hoja con los pasos para instalar en iPhone */
.fb-hoja-fondo { position: fixed; inset: 0; z-index: 40; background: rgba(29, 31, 34, 0.55); display: flex; align-items: flex-end; }
.fb-hoja {
  width: 100%; background: var(--blanco); border-radius: 24px 24px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  animation: sube 350ms var(--ease-expo);
}
.fb-hoja-titulo { font-family: var(--display); font-weight: 900; font-size: 1.4rem; }
.fb-hoja ol { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 8px; }
@keyframes sube { from { transform: translateY(100%); } }
@media (min-width: 880px) { .fb-hoja-fondo { align-items: center; justify-content: center; } .fb-hoja { max-width: 420px; border-radius: 24px; } }

/* --- Portada --- */
.fb-portada { padding: 12px 20px 8px; display: grid; gap: 8px; }
.fb-zona {
  display: inline-block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--cinta); padding: 5px 10px; border-radius: 6px; margin-bottom: 12px;
}.fb-portada h1 { font-size: clamp(2.1rem, 9.2vw, 4.4rem); }
.fb-portada h1 em {
  font-style: normal; display: inline;
  background: linear-gradient(transparent 64%, var(--cinta) 64%, var(--cinta) 92%, transparent 92%);
}
.fb-bajada { margin-top: 14px; font-size: 1rem; color: var(--gris); max-width: 32em; }
.fb-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px;
  padding: 17px 26px; border-radius: var(--radio); background: var(--grafito); color: var(--yeso);
  font-weight: 600; font-size: 1.05rem; text-decoration: none; transition: background-color 200ms var(--ease);
}
.fb-boton:hover { background: var(--grafito-2); }
.fb-boton span { transition: transform 200ms var(--ease); }
.fb-boton:hover span { transform: translateX(3px); }
.fb-boton--ancho { display: flex; margin: 0; }
.fb-promesas { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.88rem; color: var(--gris); }
.fb-promesas li { display: flex; align-items: center; gap: 6px; }
.fb-promesas li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cinta); box-shadow: 0 0 0 2px var(--grafito); }

/* Dibujo de la obra: se arman los perfiles y después se cierran las placas */
.fb-dibujo { order: -1; margin: 0 auto; width: 100%; max-width: 190px; }
@media (max-height: 600px) { .fb-dibujo { max-width: 120px; } }
.fb-obra { width: 100%; height: auto; display: block; }
.fb-obra polygon, .fb-obra rect { stroke: var(--grafito); stroke-width: 2.5; stroke-linejoin: round; }
.o-piso { fill: var(--yeso-2); }
.o-pared-izq, .o-pared-der { fill: var(--blanco); }
.o-fondo { fill: #f7f5f0; }
.o-ventana { fill: #dfe7ec; }
.o-perfiles line { stroke: var(--perfil); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: trazar 900ms var(--ease) forwards; }
.o-perfiles line:nth-child(2) { animation-delay: 80ms; }
.o-perfiles line:nth-child(3) { animation-delay: 160ms; }
.o-perfiles line:nth-child(4) { animation-delay: 240ms; }
.o-perfiles line:nth-child(n+5) { animation-delay: 380ms; }
.o-placas polygon { fill: var(--cinta); opacity: 0; transform: translateY(-14px); animation: cerrar 700ms var(--ease-expo) forwards; }
.o-placas polygon:first-child { animation-delay: 1150ms; }
.o-placas polygon:last-child { animation-delay: 1400ms; }
.o-cota line { stroke: var(--grafito); stroke-width: 1.5; }
.o-cota text { font: 600 14px var(--cuerpo); fill: var(--grafito); }
@keyframes trazar { to { stroke-dashoffset: 0; } }
@keyframes cerrar { to { opacity: 1; transform: none; } }

/* --- Asistente --- */
.fb-calcular { padding: 28px 12px 36px; scroll-margin-top: 12px; }
.fb-asistente {
  background: var(--blanco); border-radius: 24px; padding: 18px 16px 22px; scroll-margin-top: 12px;
  box-shadow: 0 1px 0 var(--yeso-2), 0 24px 48px -28px rgba(29, 31, 34, 0.45);
}
.fb-progreso { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; min-height: 40px; }
.fb-atras {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--yeso); cursor: pointer;
  font-size: 1.2rem; display: grid; place-items: center;
}
.fb-atras:hover { background: var(--yeso-2); }
.fb-puntos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: 1; }
.fb-puntos li { font-size: 0.72rem; font-weight: 600; color: var(--perfil); padding-top: 9px; position: relative; text-align: center; }
.fb-puntos li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--yeso-2); transition: background-color 300ms var(--ease); }
.fb-puntos li.hecho::before { background: var(--grafito); }
.fb-puntos li.activo { color: var(--grafito); }
.fb-puntos li.activo::before { background: var(--cinta); }
.fb-puntos li.hecho { color: var(--gris); }

.fb-paso h3 { font-size: 1.65rem; margin-bottom: 16px; outline: none; }
.fb-paso.entra { animation: entra 420ms var(--ease-expo); }
.fb-paso.vuelve { animation: vuelve 420ms var(--ease-expo); }
@keyframes entra { from { opacity: 0; transform: translateX(24px); } }
@keyframes vuelve { from { opacity: 0; transform: translateX(-24px); } }

.fb-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-opcion {
  display: grid; justify-items: start; align-content: start; gap: 2px; text-align: left; cursor: pointer;
  padding: 14px; border: 2px solid var(--yeso-2); border-radius: var(--radio); background: var(--blanco);
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease), transform 200ms var(--ease);
}
.fb-opcion:hover { border-color: var(--perfil); }
.fb-opcion:active { transform: scale(0.98); }
.fb-opcion[aria-checked="true"], .fb-opcion[aria-pressed="true"] { border-color: var(--grafito); background: var(--cinta-suave); }
.fb-opcion svg { width: 52px; height: 52px; margin-bottom: 8px; }
.fb-opcion b { font-family: var(--display); font-size: 1.08rem; line-height: 1.15; }
.fb-opcion small { color: var(--gris); font-size: 0.85rem; line-height: 1.3; }
.fb-opciones--dos .fb-opcion { min-height: 170px; }
.i-base { fill: none; stroke: var(--grafito); stroke-width: 2.5; stroke-linejoin: round; }
.i-linea { fill: none; stroke: var(--grafito); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.i-acento { fill: var(--cinta); stroke: var(--grafito); stroke-width: 2.5; stroke-linejoin: round; }
.i-placa { fill: var(--blanco); stroke: var(--grafito); stroke-width: 2.5; }
.i-placa--2 { fill: var(--cinta); }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--cinta); outline-offset: 2px; }

/* Plano en vivo */
.fb-plano { background: var(--yeso); border-radius: var(--radio); padding: 6px; margin-bottom: 16px; }
.fb-plano svg { width: 100%; height: auto; display: block; max-height: 190px; }
.p-rect {
  fill: var(--cinta-suave); stroke: var(--grafito); stroke-width: 2.5;
  transition: x 250ms var(--ease), y 250ms var(--ease), width 250ms var(--ease), height 250ms var(--ease);
}
.p-m2 { font: 900 22px var(--display); fill: var(--grafito); }
.p-cota { font: 600 11px var(--cuerpo); fill: var(--gris); }

.fb-medidas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fb-medida label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.fb-stepper { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 4px; background: var(--yeso); border-radius: var(--radio); padding: 4px; }
.fb-stepper button {
  width: 44px; height: 48px; border: 0; border-radius: 12px; background: var(--blanco); cursor: pointer;
  font-size: 1.4rem; font-weight: 600; box-shadow: 0 1px 0 var(--yeso-2);
}
.fb-stepper button:active { transform: scale(0.94); }
.fb-campo { display: flex; align-items: baseline; justify-content: center; gap: 2px; min-width: 0; }
.fb-campo input {
  width: 100%; min-width: 0; border: 0; background: transparent; text-align: right; padding: 0;
  font: 900 1.45rem var(--display); color: var(--grafito);
}
.fb-campo span { font-weight: 600; color: var(--gris); font-size: 0.95rem; padding-right: 4px; }
.fb-ayuda { margin-top: 12px; font-size: 0.9rem; color: var(--gris); }
.fb-atajos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fb-chip {
  border: 1.5px solid var(--yeso-2); background: var(--blanco); border-radius: 999px; padding: 8px 13px;
  font-size: 0.88rem; font-weight: 500; cursor: pointer;
}
.fb-chip:hover { border-color: var(--grafito); }
textarea {
  width: 100%; margin-top: 14px; border: 2px solid var(--yeso-2); border-radius: var(--radio); padding: 14px;
  font: 400 1rem/1.45 var(--cuerpo); color: var(--grafito); background: var(--yeso); resize: vertical;
}
.fb-seguir {
  width: 100%; margin-top: 22px; padding: 17px; border: 0; border-radius: var(--radio); cursor: pointer;
  background: var(--grafito); color: var(--yeso); font-weight: 600; font-size: 1.05rem;
}
.fb-seguir:hover { background: var(--grafito-2); }
.fb-seguir:disabled { background: var(--perfil); cursor: not-allowed; }

/* Interruptor de aislación */
.fb-interruptor {
  width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px; border: 2px solid var(--yeso-2); border-radius: var(--radio); background: var(--blanco);
  cursor: pointer; text-align: left;
}
.fb-interruptor-texto b { display: block; font-family: var(--display); font-size: 1.05rem; }
.fb-interruptor-texto small { display: block; color: var(--gris); font-size: 0.85rem; line-height: 1.35; margin-top: 2px; }
.fb-interruptor-perilla { flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--yeso-2); position: relative; transition: background-color 200ms var(--ease); }
.fb-interruptor-perilla::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--blanco); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 250ms var(--ease);
}
.fb-interruptor[aria-checked="true"] { border-color: var(--grafito); background: var(--cinta-suave); }
.fb-interruptor[aria-checked="true"] .fb-interruptor-perilla { background: var(--grafito); }
.fb-interruptor[aria-checked="true"] .fb-interruptor-perilla::after { transform: translateX(22px); }

/* Precio */
.fb-precio-caja { background: var(--grafito); color: var(--yeso); border-radius: 20px; padding: 20px 18px; }
.fb-precio-rotulo { font-size: 0.88rem; color: var(--perfil); outline: none; }
.fb-precio { font-family: var(--display); font-weight: 900; font-size: clamp(1.75rem, 8.4vw, 2.4rem); line-height: 1.08; margin-top: 6px; }
.fb-desglose { list-style: none; padding: 14px 0 0; margin: 14px 0 0; border-top: 1px dashed rgba(174, 179, 185, 0.5); display: grid; gap: 8px; font-size: 0.92rem; }
.fb-desglose li { display: flex; justify-content: space-between; gap: 12px; }
.fb-desglose span { color: var(--perfil); }
.fb-desglose b { font-weight: 600; text-align: right; }
.fb-vista-rotulo { margin-top: 20px; font-size: 0.85rem; font-weight: 600; color: var(--gris); }
.fb-burbuja {
  margin-top: 8px; background: #dcf8c6; border-radius: 14px 14px 4px 14px; padding: 12px 14px; white-space: pre-line;
  font-size: 0.92rem; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); margin-left: 18px;
}
.fb-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; padding: 17px 20px;
  border-radius: var(--radio); background: var(--wa); color: #fff; font-weight: 600; font-size: 1.08rem; text-decoration: none;
}
.fb-wa svg { width: 22px; height: 22px; fill: currentColor; }
.fb-wa:hover { background: var(--wa-hover); }
.fb-nota { margin-top: 10px; font-size: 0.85rem; color: var(--gris); text-align: center; }
.fb-nota--izq { text-align: left; }
.fb-otra { display: block; margin: 14px auto 0; background: none; border: 0; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 8px; }

/* --- Obras --- */
.fb-hechos, .fb-como, .fb-dudas { padding: 40px 20px; }
.fb-hechos h2, .fb-como h2, .fb-dudas h2 { font-size: 1.85rem; }
.fb-texto { margin-top: 8px; color: var(--gris); }
.fb-galeria { list-style: none; padding: 0; margin: 18px 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-marco {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radio); overflow: hidden;
  background:
    linear-gradient(135deg, transparent 49.5%, rgba(174, 179, 185, 0.4) 49.5% 50.5%, transparent 50.5%),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(174, 179, 185, 0.35) 38px 40px),
    var(--yeso-2);
}
.fb-marco--despues { background: linear-gradient(180deg, var(--blanco), var(--yeso)); box-shadow: inset 0 0 0 2px var(--yeso-2); }
.fb-marco--video { grid-column: 1 / -1; aspect-ratio: 16 / 9; background: var(--grafito); }
.fb-marco--video::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-35%, -50%);
  border-style: solid; border-width: 16px 0 16px 26px; border-color: transparent transparent transparent var(--cinta);
}
.fb-marco-etiqueta { position: absolute; top: 10px; left: 10px; background: var(--grafito); color: var(--yeso); font-size: 0.75rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.fb-marco--despues .fb-marco-etiqueta { background: var(--cinta); color: var(--grafito); }
.fb-marco--video .fb-marco-etiqueta { background: var(--cinta); color: var(--grafito); }
.fb-marco-pie { position: absolute; left: 12px; bottom: 10px; font-size: 0.82rem; font-weight: 600; color: var(--gris); }
.fb-marco--video .fb-marco-pie { color: var(--perfil); }

/* --- Cómo sigue --- */
.fb-pasos { list-style: none; counter-reset: paso; padding: 0; margin: 20px 0 0; display: grid; gap: 16px; }
.fb-pasos li { counter-increment: paso; position: relative; padding: 4px 0 4px 54px; }
.fb-pasos li::before {
  content: counter(paso); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--cinta); box-shadow: 0 0 0 2px var(--grafito); font-family: var(--display); font-weight: 900;
}
.fb-pasos h3 { font-size: 1.15rem; }
.fb-pasos p { color: var(--gris); margin-top: 2px; }

/* --- Dudas --- */
.fb-preguntas { margin-top: 16px; border-top: 1px solid var(--yeso-2); }
.fb-preguntas details { border-bottom: 1px solid var(--yeso-2); }
.fb-preguntas summary { cursor: pointer; padding: 17px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.fb-preguntas summary::-webkit-details-marker { display: none; }
.fb-preguntas summary::after { content: '+'; font-size: 1.3rem; line-height: 1; }
.fb-preguntas details[open] summary::after { content: '−'; }
.fb-preguntas p { padding: 0 0 16px; color: var(--gris); }

/* --- Pie --- */
.fb-pie { background: var(--grafito); color: var(--perfil); padding: 32px 20px 110px; display: grid; gap: 6px; font-size: 0.9rem; }
.fb-pie .fb-marca { color: var(--yeso); margin-bottom: 8px; }
.fb-pie .fb-marca span { color: var(--perfil); }
.fb-firma a { color: var(--yeso); }
.fb-panel { display: inline-block; margin: 8px 0; color: var(--cinta); font-weight: 600; }

/* --- Barra de abajo --- */
.fb-barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(241, 239, 233, 0.96); border-top: 1px solid var(--yeso-2);
  transform: translateY(110%); transition: transform 400ms var(--ease);
}
.fb-barra--visible { transform: none; }

@media (min-width: 880px) {
  .fb-arriba { max-width: 1180px; margin: 0 auto; padding: 20px 40px; }
  main { max-width: 1180px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: 48px; }
  .fb-portada { grid-column: 1; align-self: start; position: sticky; top: 16px; padding: 40px 16px; }
  .fb-dibujo { order: 0; max-width: 460px; margin: 8px 0 0; }
  .fb-calcular { grid-column: 2; grid-row: 1 / span 2; padding: 32px 0 48px; }
  .fb-hechos, .fb-como, .fb-dudas { grid-column: 1 / -1; padding-left: 16px; padding-right: 16px; }
  .fb-galeria { grid-template-columns: 1fr 1fr 2fr; }
  .fb-marco--video { grid-column: auto; aspect-ratio: auto; }
  .fb-pasos { grid-template-columns: repeat(3, 1fr); }
  .fb-barra { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
