/* Gestos y sensación nativa de la app instalada HF WEB. */
html.hf-app-gestures,
html.hf-app-gestures body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}
html.hf-app-gestures body {
  touch-action: manipulation;
}
html.hf-app-gestures a,
html.hf-app-gestures button,
html.hf-app-gestures img,
html.hf-app-gestures nav {
  -webkit-touch-callout: none;
}
html.hf-app-gestures nav,
html.hf-app-gestures button,
html.hf-app-gestures [role="tab"] {
  -webkit-user-select: none;
  user-select: none;
}

.hf-gesture-back,
.hf-gesture-pull {
  position: fixed;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: #18181b;
  color: #f5f5f5;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  pointer-events: none;
  opacity: 0;
}
.hf-gesture-back svg,
.hf-gesture-pull svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hf-gesture-back {
  top: 0;
  left: -44px;
  transform: translate3d(var(--hf-gesture-x, 0px), calc(var(--hf-gesture-y, 50vh) - 22px), 0) scale(calc(.7 + var(--hf-gesture-progress, 0) * .3));
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1), background-color .15s ease, color .15s ease;
}
.hf-gesture-back.is-active {
  opacity: calc(.35 + var(--hf-gesture-progress, 0) * .65);
  transition: opacity .1s linear, background-color .15s ease, color .15s ease;
}
.hf-gesture-back.is-ready,
.hf-gesture-pull.is-ready,
.hf-gesture-pull.is-refreshing {
  background: #f5f5f5;
  color: #050505;
}

.hf-gesture-pull {
  top: calc(env(safe-area-inset-top, 0px) - 44px);
  left: calc(50% - 22px);
  transform: translate3d(0, var(--hf-gesture-y, 0px), 0) rotate(calc(var(--hf-gesture-progress, 0) * 270deg));
  transition: opacity .18s ease, transform .25s cubic-bezier(.2, .8, .2, 1), background-color .15s ease, color .15s ease;
}
.hf-gesture-pull.is-active {
  opacity: calc(.3 + var(--hf-gesture-progress, 0) * .7);
  transition: opacity .1s linear, background-color .15s ease, color .15s ease;
}
.hf-gesture-pull.is-refreshing {
  opacity: 1;
  transform: translate3d(0, 64px, 0);
}
.hf-gesture-pull.is-refreshing svg {
  animation: hf-gesture-spin .7s linear infinite;
}
@keyframes hf-gesture-spin {
  to { transform: rotate(360deg); }
}

.hf-gesture-dragging {
  transition: none !important;
  will-change: transform;
}
.hf-gesture-settling {
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .26s ease !important;
}

/* Transiciones entre páginas como en una app nativa (navegadores compatibles). */
@media (display-mode: standalone) and (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(root) {
    animation: hf-page-out .32s cubic-bezier(.2, .8, .2, 1) both;
  }
  ::view-transition-new(root) {
    animation: hf-page-in .32s cubic-bezier(.2, .8, .2, 1) both;
  }
  html:active-view-transition-type(back)::view-transition-old(root) {
    animation-name: hf-page-out-back;
  }
  html:active-view-transition-type(back)::view-transition-new(root) {
    animation-name: hf-page-in-back;
  }
  html:active-view-transition-type(reload)::view-transition-old(root),
  html:active-view-transition-type(reload)::view-transition-new(root) {
    animation: none;
  }
}
@keyframes hf-page-in { from { transform: translateX(32%); opacity: .4; } }
@keyframes hf-page-out { to { transform: translateX(-18%); opacity: .2; } }
@keyframes hf-page-in-back { from { transform: translateX(-18%); opacity: .2; } }
@keyframes hf-page-out-back { to { transform: translateX(32%); opacity: .4; } }

@media (prefers-reduced-motion: reduce) {
  .hf-gesture-back,
  .hf-gesture-pull,
  .hf-gesture-settling {
    transition: none !important;
  }
}
