/* ==========================================================================
   LÍNEA FOLD · las cuatro páginas de sector (19/10/2026)
   Las piezas comunes viven en linea.css; aquí solo lo propio de cada sector y su
   animación (una distinta por página, David: «cada página con la suya»). Mismas reglas
   que linea.css: todo visible sin JavaScript, las animaciones solo añaden y se paran con
   «reducir movimiento», clases con el prefijo lf-.
     Gestorías   · .lf-facturas   el sello «Revisada» cae sobre la factura que cuadra y la que
                                  lleva retención se aparta a «revisar a mano».
     Transporte  · .lf-ruta       el camión hace la ruta de la tarifa y, al llegar, salta el precio.
     Talleres    · .lf-cal-zona   el calendario pasa hojas hasta la de la ITV.
     Comercio    · .lf-stock      el contador de stock baja, cruza el mínimo y salta el aviso.
   Sin animación (o sin script) se ve siempre el estado final: la factura sellada y la otra
   apartada, el camión en destino, la hoja de la ITV, el stock en 6 con el aviso encendido.
   ========================================================================== */

/* ------------------------------------------------------------------ comunes */
.lf-sector .lf-cabeza { align-items: center; }
.lf-sector .lf-lista b { font-weight: 800; }
.lf-sector .lf-lista .nv-estado { margin-left: 4px; }
.lf-sector .lf-lista + .lf-nota, .lf-sector .lf-ramales + .lf-nota, .lf-sector .lf-posits-pregunta + .lf-nota { margin-top: 22px; }
.lf-sector .lf-posits-pregunta { margin: 0 0 6px; }
.lf-sector .lf-tramo > .lf-lista { max-width: 62ch; }
.lf-sector .lf-ramal .lf-posit { font-size: 20px; }
.lf-sector .lf-ramal .lf-contesta { font-size: 17px; margin-top: 14px; }
.lf-ejemplo { margin-top: 12px; font-size: 14px; color: var(--lf-gris); text-align: center; }

/* ------------------------------------------------------------------ gestorías: el sello y la que se aparta */
.lf-facturas { position: relative; width: 100%; max-width: 560px; height: 470px; margin-inline: auto; }
.lf-factura { position: absolute; width: min(340px, 72%); background: #fff; border: 3px solid var(--lf-tinta); border-radius: 10px; padding: 14px 18px 18px; box-shadow: 0 18px 24px -18px rgba(17, 19, 24, .45); }
.lf-factura-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 800; font-size: 18px; border-bottom: 3px solid var(--lf-tinta); padding-bottom: 8px; margin: 0 0 10px; }
.lf-factura-cab small { font-size: 14px; font-weight: 700; color: var(--lf-gris); }
.lf-factura dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; font-variant-numeric: tabular-nums; font-size: 17px; }
.lf-factura dt { color: #2B2E36; }
.lf-factura dd { margin: 0; font-weight: 700; text-align: right; }
.lf-factura .lf-f-total { border-top: 2px dashed rgba(17, 19, 24, .35); padding-top: 6px; font-weight: 800; color: var(--lf-tinta); }
.lf-f-buena { left: 0; top: 0; transform: rotate(-2deg); z-index: 1; }
.lf-f-aparte { right: 8px; top: 172px; transform: rotate(4deg); z-index: 2; background: #FFFDF8; }
.lf-revisada { position: absolute; left: 12px; bottom: -22px; z-index: 3; transform: rotate(-10deg); border: 4px solid var(--lf-l2); color: var(--lf-l2); font-weight: 800; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 12px; border-radius: 8px; background: rgba(255, 255, 255, .92); }
.lf-f-motivo { position: absolute; left: -22px; bottom: -66px; font-size: 20px; max-width: 220px; }

@keyframes lf-aparta { from { transform: translate(-40%, -54%) rotate(-1deg); } 65% { transform: translate(3%, 2%) rotate(6deg); } to { transform: rotate(4deg); } }
@keyframes lf-cae-sello { 0% { transform: translate(-24px, -150px) rotate(-32deg) scale(1.4); } 72% { transform: translate(0, 3px) rotate(-9deg) scale(.95); } 100% { transform: rotate(-10deg); } }
@keyframes lf-golpe { 0%, 100% { transform: rotate(-2deg); } 45% { transform: rotate(-2deg) scale(.985, .965); } }
html.lf-anima .lf-facturas.lf-ve .lf-f-aparte { animation: lf-aparta 1s cubic-bezier(.3, .7, .3, 1) .4s both; }
html.lf-anima .lf-facturas.lf-ve .lf-revisada { animation: lf-cae-sello .55s cubic-bezier(.55, 0, .85, .45) 1.5s both; }
html.lf-anima .lf-facturas.lf-ve .lf-f-buena { animation: lf-golpe .3s ease-out 2.02s both; }

/* ------------------------------------------------------------------ transporte: el camión de la tarifa */
.lf-ruta { width: 100%; max-width: 560px; margin-inline: auto; border: 3px solid var(--lf-tinta); border-radius: 14px; padding: 22px 22px 18px; background: #fff; }
.lf-ruta .lf-pregunta { font-size: 18px; }
.lf-carretera { position: relative; height: 58px; margin: 30px 0 10px; border-radius: 29px;
  background: linear-gradient(90deg, #FFD25A 0 55%, transparent 55%) 0 50% / 40px 4px repeat-x, var(--lf-tinta); }
.lf-carretera::before, .lf-carretera::after { content: ''; position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: #fff; border: 6px solid var(--lf-l1); z-index: 1; }
.lf-carretera::before { left: 16px; }
.lf-carretera::after { right: 16px; }
.lf-camion { position: absolute; top: 50%; left: calc(100% - 126px); width: 42px; height: 26px; margin-top: -19px; background: var(--lf-l1); border: 3px solid #fff; border-radius: 4px; z-index: 2; }
.lf-camion::before { content: ''; position: absolute; right: -22px; bottom: -3px; width: 18px; height: 19px; background: #fff; border-radius: 2px 9px 2px 2px; box-shadow: inset -5px 5px 0 -1px var(--lf-azul); }
.lf-camion::after { content: ''; position: absolute; left: 3px; bottom: -11px; width: 11px; height: 11px; border-radius: 50%; background: #C9CCD6; box-shadow: 34px 0 0 #C9CCD6; }
.lf-ruta-pies { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 16px; }
.lf-ticket { display: flex; justify-content: flex-end; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-top: 18px !important; padding-top: 14px; border-top: 3px dashed var(--lf-tinta); }
.lf-ticket small { font-size: 15px; font-weight: 700; color: var(--lf-gris); }
.lf-ticket b { display: inline-block; font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--lf-l1); font-variant-numeric: tabular-nums; transform-origin: right center; }

@keyframes lf-hace-ruta { from { left: 50px; } to { left: calc(100% - 126px); } }
@keyframes lf-bache { 0%, 100% { margin-top: -19px; } 50% { margin-top: -21px; } }
@keyframes lf-precio { 0%, 84% { transform: none; } 92% { transform: scale(1.12) rotate(-2deg); } 100% { transform: none; } }
html.lf-anima .lf-ruta.lf-ve .lf-camion { animation: lf-hace-ruta 2.6s cubic-bezier(.5, 0, .3, 1) .3s both, lf-bache .26s ease-in-out .3s 10; }
html.lf-anima .lf-ruta.lf-ve .lf-ticket b { animation: lf-precio 3.4s ease-out both; }

/* ------------------------------------------------------------------ talleres: el calendario hasta la ITV */
.lf-cal-zona { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px 28px; }
.lf-calendario { position: relative; width: 300px; perspective: 900px; flex: none; }
.lf-cal-anillas { display: block; position: relative; height: 30px; background: var(--lf-tinta); border-radius: 12px 12px 0 0; }
.lf-cal-anillas::before, .lf-cal-anillas::after { content: ''; position: absolute; top: -12px; left: 26%; width: 12px; height: 28px; border-radius: 6px; background: #fff; border: 3px solid var(--lf-tinta); }
.lf-cal-anillas::after { left: auto; right: 26%; }
.lf-cal-hojas { position: relative; height: 270px; }
.lf-cal-hoja { position: absolute; inset: 0; background: #fff; border: 3px solid var(--lf-tinta); border-top: 0; border-radius: 0 0 12px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 44px 12px 14px; text-align: center; transform-origin: top center; backface-visibility: hidden; }
.lf-cal-mes { position: absolute; top: 0; left: 0; right: 0; background: var(--lf-l3); color: var(--lf-tinta); font-weight: 800; font-size: 16px; padding: 7px 10px; }
.lf-cal-hoja b { font-size: 100px; font-weight: 800; line-height: .95; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.lf-cal-etq { display: inline-block; background: var(--lf-tinta); color: #fff; font-weight: 800; font-size: 18px; padding: 4px 14px; border-radius: 6px; }
.lf-cal-listo { font-weight: 700; font-size: 16px; color: var(--lf-l2); }
.lf-cal-antes { display: none; }
.lf-cal-antes b { color: #3D414B; }
.lf-cal-posit { max-width: 210px; }
html.lf-anima .lf-cal-antes { display: flex; }
@keyframes lf-arranca { 0% { transform: none; } 30% { transform: rotateX(-8deg); } 100% { transform: rotateX(105deg) translateY(-14px); opacity: 0; visibility: hidden; } }
html.lf-anima .lf-cal-zona.lf-ve .lf-cal-antes { animation: lf-arranca .75s cubic-bezier(.5, 0, .75, .2) calc(var(--n, 0) * .85s + .6s) forwards; }

/* ------------------------------------------------------------------ comercio: el stock que baja hasta el aviso */
.lf-stock { width: 100%; max-width: 480px; margin-inline: auto; border: 3px solid var(--lf-tinta); border-radius: 14px; padding: 20px 22px 22px; background: #fff; }
.lf-stock-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 800; font-size: 18px; border-bottom: 3px solid var(--lf-tinta); padding-bottom: 10px; }
.lf-stock-cab small { font-size: 14px; font-weight: 700; color: var(--lf-gris); }
.lf-stock-cifra { display: flex; align-items: flex-end; gap: 12px; margin: 18px 0 14px !important; }
.lf-contador { display: inline-block; height: 1em; overflow: hidden; font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--lf-tinta); }
.lf-cinta { display: flex; flex-direction: column; text-align: right; transform: translateY(-4em); }
.lf-cinta span { display: block; height: 1em; }
.lf-stock-cifra small { font-size: 18px; font-weight: 700; color: var(--lf-gris); padding-bottom: 12px; }
.lf-nivel { position: relative; height: 26px; border: 3px solid var(--lf-tinta); border-radius: 13px; background: #F1F0EC; overflow: hidden; }
.lf-nivel-barra { position: absolute; left: 0; top: 0; bottom: 0; width: 15%; background: var(--lf-l3); }
.lf-nivel-min { position: absolute; left: 25%; top: -3px; bottom: -3px; border-left: 3px dashed var(--lf-tinta); }
.lf-nivel-pie { position: relative; height: 22px; margin: 6px 0 16px !important; font-size: 14px; font-weight: 700; }
.lf-nivel-pie span { position: absolute; left: 25%; transform: translateX(-50%); white-space: nowrap; }
.lf-stock-aviso { transition: none; }

@keyframes lf-baja { from { transform: translateY(0); } to { transform: translateY(-4em); } }
@keyframes lf-vacia { from { width: 100%; background: var(--lf-l2); } 74% { background: var(--lf-l2); } to { width: 15%; background: var(--lf-l3); } }
@keyframes lf-salta { 0%, 86% { background: #F1F0EC; border-left-color: #A3A7B3; transform: none; } 90% { transform: translateX(-6px); } 94% { transform: translateX(5px); } 97% { transform: translateX(-3px); } 100% { background: #FFF4E0; border-left-color: var(--lf-l3); transform: none; } }
html.lf-anima .lf-stock.lf-ve .lf-cinta { animation: lf-baja 2.4s steps(4, end) .4s both; }
html.lf-anima .lf-stock.lf-ve .lf-nivel-barra { animation: lf-vacia 2.4s steps(4, end) .4s both; }
html.lf-anima .lf-stock.lf-ve .lf-stock-aviso { animation: lf-salta 3.2s linear both; }

/* ------------------------------------------------------------------ móvil */
@media (max-width: 640px) {
  .lf-facturas { height: 480px; }
  .lf-factura { padding: 12px 14px 16px; }
  .lf-factura dl { font-size: 16px; }
  .lf-f-aparte { top: 196px; }
  .lf-f-motivo { left: -10px; bottom: -62px; font-size: 19px; }
  .lf-ruta { padding: 18px 16px 16px; }
  .lf-ticket b { font-size: 38px; }
  .lf-calendario { width: 230px; }
  .lf-cal-hojas { height: 216px; }
  .lf-cal-hoja b { font-size: 72px; }
  .lf-contador { font-size: 80px; }
}

/* ------------------------------------------------------------------ reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  .lf-facturas *, .lf-ruta *, .lf-cal-zona *, .lf-stock * { animation: none !important; }
  .lf-cal-antes { display: none !important; }
}
@media print {
  .lf-cal-antes { display: none !important; }
}
