/*
 * Clipo Awwwards Effects MU
 * Efectos avanzados pero contenidos: no bloquean enlaces, formularios ni navegación.
 */

:root {
  --clipo-cursor-size: 18px;
  --clipo-cursor-big: 52px;
  --clipo-blue: #467ff7;
  --clipo-dark: #111827;
  --clipo-soft: rgba(17, 24, 39, .08);
  --clipo-ease: cubic-bezier(.19, 1, .22, 1);
}

html {
  scroll-behavior: smooth;
}

body.clipo-awwwards-effects-enabled {
  overflow-x: clip;
}

/* Barra de progreso de lectura/scroll */
.clipo-scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--clipo-blue), #9dbbff);
  z-index: 99999;
  pointer-events: none;
}

/* Cursor personalizado: solo desktop con puntero fino */
@media (pointer: fine) and (hover: hover) {
  .clipo-cursor,
  .clipo-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99998;
    pointer-events: none;
    border-radius: 999px;
    transform: translate3d(-50%, -50%, 0);
    mix-blend-mode: difference;
  }

  .clipo-cursor {
    width: var(--clipo-cursor-big);
    height: var(--clipo-cursor-big);
    border: 1px solid rgba(255,255,255,.8);
    opacity: .75;
    transition: width .35s var(--clipo-ease), height .35s var(--clipo-ease), opacity .35s var(--clipo-ease), border-color .35s var(--clipo-ease);
  }

  .clipo-cursor-dot {
    width: var(--clipo-cursor-size);
    height: var(--clipo-cursor-size);
    background: #fff;
    opacity: .9;
  }

  body.clipo-cursor-active .clipo-cursor {
    width: 76px;
    height: 76px;
    opacity: .95;
    border-color: rgba(255,255,255,1);
  }
}

/* Reveals limpios */
[data-clipo-reveal] {
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(.985);
  filter: blur(10px);
  transition:
    opacity .9s var(--clipo-ease),
    transform .9s var(--clipo-ease),
    filter .9s var(--clipo-ease);
  transition-delay: var(--clipo-delay, 0ms);
  will-change: opacity, transform, filter;
}

[data-clipo-reveal].is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

[data-clipo-reveal="split"] .clipo-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, .8em, 0) rotateX(18deg);
  transform-origin: left bottom;
  transition:
    opacity .75s var(--clipo-ease),
    transform .75s var(--clipo-ease);
  transition-delay: calc(var(--word-index, 0) * 38ms + var(--clipo-delay, 0ms));
  will-change: opacity, transform;
}

[data-clipo-reveal="split"].is-inview .clipo-word {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotateX(0deg);
}

/* Tarjetas premium para servicios / icon boxes Elementor */
.clipo-awwwards-effects-enabled .elementor-widget-image-box,
.clipo-awwwards-effects-enabled .elementor-widget-icon-box {
  position: relative;
  border-radius: 22px;
  isolation: isolate;
  transition: transform .45s var(--clipo-ease), filter .45s var(--clipo-ease);
  will-change: transform;
}

.clipo-awwwards-effects-enabled .elementor-widget-image-box::before,
.clipo-awwwards-effects-enabled .elementor-widget-icon-box::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(70,127,247,.16), transparent 46%);
  opacity: 0;
  transition: opacity .35s var(--clipo-ease);
  z-index: -1;
  pointer-events: none;
}

.clipo-awwwards-effects-enabled .elementor-widget-image-box:hover,
.clipo-awwwards-effects-enabled .elementor-widget-icon-box:hover {
  transform: translate3d(0, -6px, 0);
}

.clipo-awwwards-effects-enabled .elementor-widget-image-box:hover::before,
.clipo-awwwards-effects-enabled .elementor-widget-icon-box:hover::before {
  opacity: 1;
}

.clipo-awwwards-effects-enabled .elementor-button {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.clipo-awwwards-effects-enabled .elementor-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.28) 45%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .75s var(--clipo-ease);
  pointer-events: none;
}

.clipo-awwwards-effects-enabled .elementor-button:hover::after,
.clipo-awwwards-effects-enabled .elementor-button:focus-visible::after {
  transform: translateX(130%);
}

/* Parallax sutil, aplicado por JS */
[data-clipo-parallax] {
  will-change: transform;
  transform: translate3d(0, var(--clipo-parallax-y, 0px), 0);
}

/* Accesibilidad: reduce motion real */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  [data-clipo-reveal],
  [data-clipo-reveal] .clipo-word {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .clipo-cursor,
  .clipo-cursor-dot {
    display: none !important;
  }
}

/* v1.1: páginas interiores + nested accordion de Elementor */
.clipo-awwwards-effects-enabled .elementor[data-elementor-type="wp-page"] {
  isolation: isolate;
}

.clipo-awwwards-effects-enabled .e-con.e-parent {
  scroll-margin-top: 96px;
}

.clipo-awwwards-effects-enabled .elementor-widget-n-accordion {
  position: relative;
}

.clipo-awwwards-effects-enabled .e-n-accordion-item {
  border-radius: 18px;
  overflow: clip;
  transition: transform .45s var(--clipo-ease), box-shadow .45s var(--clipo-ease), background-color .45s var(--clipo-ease);
}

.clipo-awwwards-effects-enabled .e-n-accordion-item + .e-n-accordion-item {
  margin-top: 10px;
}

.clipo-awwwards-effects-enabled .e-n-accordion-item:hover,
.clipo-awwwards-effects-enabled .e-n-accordion-item[open] {
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 18px 44px rgba(17, 24, 39, .08);
}

.clipo-awwwards-effects-enabled .e-n-accordion-item-title {
  cursor: pointer;
  transition: transform .35s var(--clipo-ease), opacity .35s var(--clipo-ease);
}

.clipo-awwwards-effects-enabled .e-n-accordion-item-title:focus-visible {
  outline: 2px solid var(--clipo-blue);
  outline-offset: 4px;
}

.clipo-awwwards-effects-enabled .e-n-accordion-item [role="region"] {
  animation: clipoAccordionIn .45s var(--clipo-ease) both;
}

@keyframes clipoAccordionIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

/* Evita saturar móviles: más limpio, menos efecto */
@media screen and (max-width: 767px) {
  [data-clipo-reveal] {
    transform: translate3d(0, 22px, 0);
    filter: blur(6px);
  }

  .clipo-awwwards-effects-enabled .elementor-widget-image-box:hover,
  .clipo-awwwards-effects-enabled .elementor-widget-icon-box:hover,
  .clipo-awwwards-effects-enabled .e-n-accordion-item:hover {
    transform: none;
  }
}
