/* ============================================================
   HQ SCROLL FX — animaciones de entrada al hacer scroll
   Uso local/edición. Se activa sólo si scroll-fx.js añade
   la clase .hq-fx-ready al <html>, sin JS el sitio se ve igual.
   ============================================================ */

:root{
  --hqfx-dist: 60px;
  --hqfx-dur: 700ms;
  --hqfx-stagger: 90ms;
  --hqfx-blur: 6px;
  --hqfx-ease: cubic-bezier(.22,.61,.36,1);
}

/* El state "oculto" lleva DOS clases (.hqfx) para no chocar nunca
   con los hover:-translate-y-1 / group-hover:scale-110 de Tailwind,
   que usan las propiedades translate/scale. Aquí sólo usamos
   transform + opacity + filter, que se componen con ellas. */
html.hq-fx-ready .hqfx{
  opacity: 0;
  transition:
    opacity var(--hqfx-dur) var(--hqfx-ease),
    transform var(--hqfx-dur) var(--hqfx-ease),
    filter var(--hqfx-dur) var(--hqfx-ease);
  transition-delay: var(--hqfx-delay, 0ms);
  will-change: opacity, transform;
}

html.hq-fx-ready .hqfx-fade  { transform: none; filter: blur(var(--hqfx-blur)); }
html.hq-fx-ready .hqfx-up    { transform: translateY(calc(var(--hqfx-dist) * .55)); filter: blur(calc(var(--hqfx-blur) * .4)); }
html.hq-fx-ready .hqfx-down  { transform: translateY(calc(var(--hqfx-dist) * -.55)); }
html.hq-fx-ready .hqfx-left  { transform: translateX(calc(var(--hqfx-dist) * -1)); }
html.hq-fx-ready .hqfx-right { transform: translateX(var(--hqfx-dist)); }
html.hq-fx-ready .hqfx-zoom  { transform: scale(.92); filter: blur(calc(var(--hqfx-blur) * .3)); }
html.hq-fx-ready .hqfx-blur  { filter: blur(var(--hqfx-blur)); }

html.hq-fx-ready .hqfx.hqfx-in{
  opacity: 1;
  transform: none;
  filter: none;
  will-change: auto;
}

/* Cortina anti-parpadeo: al re-armar (cambio de ajuste o navegacion) los
   elementos no deben animarse de vuelta a su estado oculto. */
html.hq-fx-arming .hqfx{ transition: none !important; }

/* ------------------------------------------------------------
   PANEL DE CONTROL
   ------------------------------------------------------------ */
#hqfx-btn{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: linear-gradient(135deg,#0f766e,#155e75);
  color: #fff;
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(2,44,54,.35);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
#hqfx-btn:hover{ transform: translateY(-2px); box-shadow: 0 14px 34px rgba(2,44,54,.45); }
#hqfx-btn.hqfx-off{ opacity: .55; }
#hqfx-btn svg{ width: 15px; height: 15px; }

#hqfx-panel{
  position: fixed;
  right: 18px;
  bottom: 68px;
  z-index: 2147483001;
  width: 336px;
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 16px 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(15,118,110,.16);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  color: #0f172a;
  font: 400 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 24px 60px rgba(2,44,54,.28);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
#hqfx-panel.hqfx-open{ opacity: 1; transform: none; pointer-events: auto; }
#hqfx-panel h3{
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
}
#hqfx-panel .hqfx-sub{ margin: 0 0 12px; font-size: 11.5px; color: #64748b; }

.hqfx-row{ margin: 11px 0; }
.hqfx-row > label{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
}
.hqfx-row > label b{ font-weight: 700; color: #0f766e; font-variant-numeric: tabular-nums; }
.hqfx-row input[type=range]{ width: 100%; accent-color: #0f766e; }

.hqfx-chips{ display: flex; flex-wrap: wrap; gap: 6px; }
.hqfx-chip{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all .15s ease;
}
.hqfx-chip:hover{ border-color: #0f766e; color: #0f766e; }
.hqfx-chip[aria-pressed=true]{ background: #0f766e; border-color: #0f766e; color: #fff; }

.hqfx-switch{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}
.hqfx-switch input{ position: absolute; opacity: 0; pointer-events: none; }
.hqfx-track{
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
}
.hqfx-track::after{
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.hqfx-switch input:checked + .hqfx-track{ background: #0f766e; }
.hqfx-switch input:checked + .hqfx-track::after{ transform: translateX(17px); }
.hqfx-switch input:focus-visible + .hqfx-track{ outline: 2px solid #0f766e; outline-offset: 2px; }

.hqfx-sep{ margin: 14px 0 2px; border: 0; border-top: 1px solid #e2e8f0; }
.hqfx-actions{ display: flex; gap: 7px; margin-top: 13px; }
.hqfx-actions button{
  flex: 1;
  padding: 8px 6px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all .15s ease;
}
.hqfx-actions button:hover{ border-color: #0f766e; color: #0f766e; }
.hqfx-actions button[disabled]{ opacity: .55; cursor: progress; }
#hqfx-site-row{ align-items: center; }
.hqfx-save{ background: #0f766e !important; border-color: #0f766e !important; color: #fff !important; }
.hqfx-save:hover{ background: #115e59 !important; color: #fff !important; }
.hqfx-link{ font-size: 11.5px; color: #64748b; text-decoration: none; white-space: nowrap; }
.hqfx-link:hover{ color: #0f766e; text-decoration: underline; }
.hqfx-note{ margin-top: 11px; font-size: 11px; color: #94a3b8; }
.hqfx-note.warn{ color: #b45309; }
.hqfx-count{ font-size: 11px; color: #64748b; }

@media (prefers-reduced-motion: reduce){
  #hqfx-panel, #hqfx-btn{ transition: none; }
}
@media (max-width: 480px){
  #hqfx-panel{ right: 10px; left: 10px; width: auto; }
}
@media print{
  #hqfx-panel, #hqfx-btn{ display: none !important; }
  html.hq-fx-ready .hqfx{ opacity: 1 !important; transform: none !important; filter: none !important; }
}
