/* Capa de movimiento de Alu-Tan (acompaña a motion.js). Todo se detiene con prefers-reduced-motion. */

/* Barra de progreso de lectura */
.scroll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 300; pointer-events: none; transform-origin: left center; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), #f0b574); }

/* Recuadros azules: línea que une los pasos */
.dvh-steps { position: relative; }
.dvh-steps::before, .dvh-steps::after { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; }
.dvh-steps::before { background: rgba(255,255,255,0.12); }
.dvh-steps::after { background: var(--accent); transform-origin: top center; transform: scaleY(var(--p, 1)); }
.dvh-step { position: relative; z-index: 1; }

/* "Cómo trabajamos": la línea naranja se dibuja */
.process-step { border-top: 0; }
.process-step::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); transform-origin: left center; transform: scaleX(var(--l, 1)); }

/* Gráficos animados: pausados mientras no se ven */
.mg:not(.is-playing) * { animation-play-state: paused !important; }

/* ---------- Pictogramas animados de formas de apertura ---------- */
.tone-anim { background: #eef1f6 !important; }
.pg { display: block; width: 100%; height: 100%; }
.pg-wall { fill: #e3e8ef; }
.pg-frame { fill: #c3cbdb; }
.pg-frame-in { fill: #b4bdcc; }
.pg-open { fill: #d6e4f2; }
.pg-glass { fill: #bcd6ee; fill-opacity: 0.72; stroke: #8a96a8; stroke-width: 4; stroke-linejoin: round; }
.pg-handle { fill: var(--accent); }
.pg-shine { fill: #ffffff; opacity: 0.55; }
.pg-rail { fill: #8a96a8; }
.pg-g { transform-box: fill-box; }
.pg-awning { transform-origin: 50% 0%; animation: pg-awning 5s ease-in-out infinite; }
.pg-hingeR { transform-origin: 100% 50%; animation: pg-turn 5s ease-in-out infinite; }
.pg-oturn { transform-origin: 0% 50%; animation: pg-oturn 9s ease-in-out infinite; }
.pg-otilt { transform-origin: 50% 100%; animation: pg-otilt 9s ease-in-out infinite; }
.pg-slide { animation: pg-slide 5s ease-in-out infinite; }
.pg-flag { transform-origin: 50% 50%; animation: pg-flag 5s ease-in-out infinite; }
.pg-dL { transform-origin: 0% 50%; animation: pg-turn 5s ease-in-out infinite; }
.pg-dR { transform-origin: 100% 50%; animation: pg-turn 5s ease-in-out infinite; }
.pg-sweep { animation: pg-sweep 4.5s ease-in-out infinite; }
@keyframes pg-awning { 0%, 14% { transform: scaleY(1); } 40%, 62% { transform: scaleY(0.78); } 88%, 100% { transform: scaleY(1); } }
@keyframes pg-turn { 0%, 14% { transform: scaleX(1); } 40%, 62% { transform: scaleX(0.34); } 88%, 100% { transform: scaleX(1); } }
@keyframes pg-oturn { 0%, 8% { transform: scaleX(1); } 22%, 34% { transform: scaleX(0.34); } 46%, 100% { transform: scaleX(1); } }
@keyframes pg-otilt { 0%, 52% { transform: scaleY(1); } 64%, 80% { transform: scaleY(0.8); } 92%, 100% { transform: scaleY(1); } }
@keyframes pg-slide { 0%, 14% { transform: translateX(0); } 42%, 62% { transform: translateX(-42px); } 90%, 100% { transform: translateX(0); } }
@keyframes pg-flag { 0%, 14% { transform: scaleY(1); } 40%, 62% { transform: scaleY(0.4); } 88%, 100% { transform: scaleY(1); } }
@keyframes pg-sweep { 0%, 20% { transform: translateX(-60px); } 70%, 100% { transform: translateX(110px); } }

@media (prefers-reduced-motion: reduce) {
  .pg-awning, .pg-hingeR, .pg-oturn, .pg-otilt, .pg-slide, .pg-flag, .pg-dL, .pg-dR, .pg-sweep { animation: none; }
  .scroll-progress { transition: none; }
}
.pg-awning, .pg-hingeR, .pg-oturn, .pg-otilt, .pg-slide, .pg-flag, .pg-dL, .pg-dR { transform-box: fill-box; }

/* ---------- Persiana que sube y baja ---------- */
.shutter-card { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 34px; align-items: center; background: var(--white); border: 1px solid var(--steel-light); border-radius: 16px; padding: 22px; margin-top: 34px; }
.shutter-svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.shutter-text .tag-mini { display: block; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.shutter-text strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--navy); margin-bottom: 8px; }
.shutter-text p { margin: 0 0 8px; color: var(--text-soft); }
.shutter-text em { font-size: 0.8rem; color: var(--text-soft); font-style: normal; }
.sh-slats { animation: sh-down 8s ease-in-out infinite; }
.sh-room { animation: sh-light 8s ease-in-out infinite; }
.sh-beam { opacity: 0.35; animation: sh-beam 8s ease-in-out infinite; }
.sh-rays { transform-box: fill-box; transform-origin: center; animation: sh-spin 16s linear infinite; }
@keyframes sh-down { 0%, 12% { transform: translateY(0); } 38%, 60% { transform: translateY(150px); } 86%, 100% { transform: translateY(0); } }
@keyframes sh-light { 0%, 12% { opacity: 1; } 38%, 60% { opacity: 0.12; } 86%, 100% { opacity: 1; } }
@keyframes sh-beam { 0%, 12% { opacity: 0.38; } 38%, 60% { opacity: 0.05; } 86%, 100% { opacity: 0.38; } }
@keyframes sh-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .shutter-card { grid-template-columns: 1fr; gap: 18px; padding: 16px; } }
@media (prefers-reduced-motion: reduce) { .sh-slats, .sh-room, .sh-beam, .sh-rays { animation: none; } }

/* ---------- Inicio y microinteracciones ---------- */
.herraje-card .herraje-icon, .quicknav-card .quicknav-icon { transition: transform .35s ease; }
.herraje-card:hover .herraje-icon, .quicknav-card:hover .quicknav-icon { transform: translateY(-3px) scale(1.08); }
.quicknav-card .quicknav-link { transition: gap .25s ease; }
.quicknav-card:hover .quicknav-link { gap: 12px; }
.btn { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(16,29,51,0.18); }
@media (prefers-reduced-motion: reduce) {
  .herraje-card:hover .herraje-icon, .quicknav-card:hover .quicknav-icon, .btn:hover { transform: none; }
}

/* ---------- Escenas animadas (techos, mosquiteros, mamparas, cercos, cerramientos, portones, puerta) ---------- */
.scene-svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.porton-foto.mg { border: 1px solid var(--steel-light); background: #e3e8ef; }
.porton-foto.mg .gate-svg { width: 100%; height: 100%; display: block; }
.sc-drop, .ms-drop { stroke: #6aa0d8; stroke-width: 2; stroke-linecap: round; opacity: 0; }
.sc-drop { animation: sc-fall 1.8s linear infinite; animation-delay: var(--dl, 0s); }
.ms-drop { animation: ms-fall 1s linear infinite; animation-delay: var(--dl, 0s); }
.sc-beam { opacity: 0.22; animation: sc-beam 4s ease-in-out infinite; }
.sc-beam2 { animation-delay: -2s; }
.sc-wind { animation: sc-dash 2.4s linear infinite; }
.sc-wind2 { animation-duration: 3.1s; }
.mq-air { animation: sc-flow 2.6s linear infinite; }
.mq-air2 { animation-duration: 3.2s; }
.mq-air3 { animation-duration: 2.9s; }
.mq-ins { opacity: 0; animation: mq-fly 5s ease-in-out infinite; animation-delay: var(--dl, 0s); }
.ms-spl { fill: #6aa0d8; opacity: 0; animation: ms-spray 2.2s ease-out infinite; animation-delay: var(--dl, 0s); }
.ms-streak { fill: #ffffff; opacity: 0; animation: ms-slide 2.6s ease-in infinite; animation-delay: var(--dl, 0s); }
.cp-wave { animation: cp-wave 4s linear infinite; }
.cp-wave2 { animation-duration: 5.5s; animation-direction: reverse; }
.cp-shine { animation: cp-sweep 5s ease-in-out infinite; }
.cz-p { animation: cz-slide 7s ease-in-out infinite; }
.cz-p1 { animation-delay: 0.12s; } .cz-p2 { animation-delay: 0.24s; } .cz-p3 { animation-delay: 0.36s; }
.gt-dL { transform-origin: 0% 50%; animation: pg-turn 5s ease-in-out infinite; }
.gt-dR { transform-origin: 100% 50%; animation: pg-turn 5s ease-in-out infinite; }
.gt-slide { animation: gt-slide 6s ease-in-out infinite; }
.gt-lift { animation: gt-lift 6s ease-in-out infinite; }
.gt-roll { animation: gt-roll 6s ease-in-out infinite; }
.pd-leaf { transform-origin: 0% 50%; animation: pg-turn 6s ease-in-out infinite; }
.pd-frame { fill: #f4f4f2; animation: pd-col 12s steps(1, end) infinite; }
.gt-dL, .gt-dR, .pd-leaf { transform-box: fill-box; }
@keyframes sc-fall { 0% { opacity: 0; transform: translateY(0); } 8% { opacity: 1; } 84% { opacity: 1; transform: translateY(var(--d)); } 100% { opacity: 0; transform: translateY(var(--d)); } }
@keyframes ms-fall { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: 1; } 88% { opacity: 1; transform: translateY(132px); } 100% { opacity: 0; transform: translateY(132px); } }
@keyframes sc-beam { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.34; } }
@keyframes sc-dash { to { stroke-dashoffset: -44; } }
@keyframes sc-flow { to { stroke-dashoffset: -36; } }
@keyframes mq-fly { 0% { opacity: 0; transform: translateX(0); } 8% { opacity: 1; } 52% { opacity: 1; transform: translateX(var(--x)); } 62% { transform: translateX(calc(var(--x) - 16px)); } 100% { opacity: 0; transform: translateX(calc(var(--x) - 90px)); } }
@keyframes ms-spray { 0% { opacity: 0; transform: translate(0, 0); } 12% { opacity: 1; } 60% { opacity: 1; transform: translate(70px, 8px); } 76%, 100% { opacity: 0; transform: translate(74px, 8px); } }
@keyframes ms-slide { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 0.85; } 100% { opacity: 0; transform: translateY(74px); } }
@keyframes cp-wave { to { transform: translateX(40px); } }
@keyframes cp-sweep { 0%, 12% { transform: translateX(0); } 70%, 100% { transform: translateX(380px); } }
@keyframes cz-slide { 0%, 12% { transform: translateX(0); } 40%, 64% { transform: translateX(var(--tx)); } 92%, 100% { transform: translateX(0); } }
@keyframes gt-slide { 0%, 14% { transform: translateX(0); } 42%, 62% { transform: translateX(130px); } 90%, 100% { transform: translateX(0); } }
@keyframes gt-lift { 0%, 14% { transform: translateY(0); } 42%, 62% { transform: translateY(-92px); } 90%, 100% { transform: translateY(0); } }
@keyframes gt-roll { 0%, 14% { transform: translateY(0); } 42%, 62% { transform: translateY(90px); } 90%, 100% { transform: translateY(0); } }
@keyframes pd-col { 0%, 49% { fill: #f4f4f2; } 50%, 99% { fill: #1c1d1f; } }
@media (prefers-reduced-motion: reduce) {
  .sc-drop, .ms-drop, .sc-beam, .sc-wind, .mq-air, .mq-ins, .ms-spl, .ms-streak, .cp-wave, .cp-shine, .cz-p, .gt-dL, .gt-dR, .gt-slide, .gt-lift, .gt-roll, .pd-leaf, .pd-frame { animation: none; }
  .sc-beam { opacity: 0.25; }
}
