.elementor-element:has(#rt-video-scroll),
.elementor-widget:has(#rt-video-scroll),
.elementor-widget-container:has(#rt-video-scroll),
.e-con:has(#rt-video-scroll),
.e-con-inner:has(#rt-video-scroll) {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#rt-video-scroll.rt-video-scroll {
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
  background: #f5f0e8;
  overflow: hidden;
  box-sizing: border-box;
  --rt-green: #1c7944;
  --rt-purple: #c652bc;
}

#rt-video-scroll,
#rt-video-scroll * {
  box-sizing: border-box;
}

#rt-video-scroll .rt-video-scroll__viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100svh;
  background: #111;
  overflow: hidden;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#rt-video-scroll .rt-video-scroll__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: block;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

#rt-video-scroll .rt-video-scroll__viewport.is-pinned {
  width: 100% !important;
  height: 100vh !important;
  height: 100svh !important;
}

@media (max-width: 768px) {
  /* lvh = viewport grande y estable (barra oculta). svh deja un hueco negro al bajar en Safari. Nunca dvh. */
  #rt-video-scroll .rt-video-scroll__viewport,
  #rt-video-scroll .rt-video-scroll__viewport.is-pinned {
    height: 100vh !important;
    height: 100svh !important;
    min-height: 100svh;
    min-height: -webkit-fill-available;
    height: 100lvh !important;
    min-height: 100lvh;
  }
}

#rt-video-scroll .rt-video-scroll__spacer {
  display: none;
  height: 0;
  pointer-events: none;
}

/* Aftertale — misma capa del pin (patrón Nebula luna-astro) */
#rt-video-scroll .rt-video-scroll__aftertale {
  position: absolute;
  inset: 0;
  z-index: 17;
  display: block;
  pointer-events: none;
  opacity: var(--after-p, 0);
  visibility: hidden;
  --after-p: 0;
  overflow: hidden;
}

#rt-video-scroll.is-aftertale .rt-video-scroll__aftertale {
  visibility: visible;
}

#rt-video-scroll .rt-video-scroll__aftertale-stage {
  position: relative;
  z-index: 2;
  height: auto;
  min-height: 100%;
  overflow: visible;
  padding: clamp(2.5rem, 8vh, 5rem) 1.25rem 3rem;
  box-sizing: border-box;
  pointer-events: none;
  will-change: transform;
}

#rt-video-scroll .rt-restaurantes__card {
  pointer-events: auto;
}

#rt-video-scroll .rt-video-scroll__aftertale-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #f5f0e8;
  transform: scale(calc(1.04 - (var(--after-p, 0) * 0.04)));
  transform-origin: center top;
  will-change: transform;
  pointer-events: none;
}

#rt-video-scroll .rt-video-scroll__aftertale-reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(7px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    filter 0.28s ease;
}

#rt-video-scroll.is-aftertale-text .rt-video-scroll__aftertale-reveal {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.75s ease;
}

#rt-video-scroll.is-aftertale-text .rt-video-scroll__aftertale-reveal[data-reveal="0"] { transition-delay: 0.12s; }
#rt-video-scroll.is-aftertale-text .rt-video-scroll__aftertale-reveal[data-reveal="1"] { transition-delay: 0.28s; }
#rt-video-scroll.is-aftertale-text .rt-video-scroll__aftertale-reveal[data-reveal="2"] { transition-delay: 0.4s; }

#rt-video-scroll .rt-menu__filters,
#rt-video-scroll .rt-menu__chip,
#rt-video-scroll .rt-restaurantes__card {
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  #rt-video-scroll .rt-video-scroll__aftertale {
    opacity: 1;
    --after-p: 1;
    pointer-events: none;
  }

  #rt-video-scroll .rt-video-scroll__aftertale-reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* Loader */
html.rt-scroll-locked,
body.rt-scroll-locked {
  overflow: hidden;
  background: #f5f0e8;
}

#rt-video-scroll.is-loading {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100lvh;
  background: #f5f0e8;
}

#rt-video-scroll.is-loading .rt-video-scroll__viewport {
  background: #f5f0e8;
}

#rt-video-scroll.is-loading .rt-video-scroll__aftertale {
  opacity: 0 !important;
  pointer-events: none !important;
}

#rt-video-scroll .rt-video-scroll__loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f0e8;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

#rt-video-scroll .rt-video-scroll__loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#rt-video-scroll .rt-video-scroll__loader-inner {
  width: min(18rem, 72vw);
  text-align: center;
  color: #1a1612;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#rt-video-scroll .rt-video-scroll__loader-logo {
  display: block;
  width: min(280px, 78vw);
  height: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

#rt-video-scroll .rt-video-scroll__loader-brand {
  margin: 0 0 1.25rem;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rt-green, #1c7944);
}

#rt-video-scroll .rt-video-scroll__loader-bar {
  position: relative;
  height: 3px;
  border-radius: 999px;
  background: rgba(26, 22, 18, 0.12);
  overflow: hidden;
}

#rt-video-scroll .rt-video-scroll__loader-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rt-green, #1c7944) 0%, var(--rt-purple, #c652bc) 100%);
  transition: width 0.2s ease-out;
}

#rt-video-scroll .rt-video-scroll__loader-meta {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(26, 22, 18, 0.62);
}

@media (prefers-reduced-motion: reduce) {
  #rt-video-scroll .rt-video-scroll__loader {
    transition: none;
  }
  #rt-video-scroll .rt-video-scroll__loader-bar-fill {
    transition: none;
  }
}
