/* Conexia — Round 3: Liquid cursor + Carousels
   Inspirado en LiquidCursor (GSAP) pero replicado en vanilla.
   Solo desktop (hover: hover, pointer: fine). */

/* ════════════ LIQUID CURSOR — DESACTIVADO ════════════ */
/* El cursor liquid se quitó por petición del usuario.
   La clase .cx-cu-active YA NO se añade al html. CSS antiguo conservado por compatibilidad pero inerte. */
@media (hover: hover) and (pointer: fine) {
  /* Mantener regla por si alguien quiere reactivar pero NO se aplica sin la clase */
  html.cx-cu-active,
  html.cx-cu-active body,
  html.cx-cu-active * {
    cursor: none !important;
  }
  html.cx-cu-active input,
  html.cx-cu-active textarea,
  html.cx-cu-active [contenteditable="true"] {
    cursor: text !important;
  }
  /* Garantizar que sin la clase, el cursor sea el del SO */
  html:not(.cx-cu-active) .cx-cu-cursor { display: none !important; }

  .cx-cu-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate3d(-50%, -50%, 0);
    /* Liquid glass: tinte azul brand + blur + saturate */
    background:
      radial-gradient(125% 106% at 32% 3%,
        rgba(47, 107, 255, 0.32) 0%,
        rgba(47, 107, 255, 0.22) 28%,
        rgba(47, 107, 255, 0.16) 50%,
        rgba(14, 165, 233, 0.14) 75%,
        rgba(14, 165, 233, 0.10) 100%);
    border: 1px solid rgba(47, 107, 255, 0.30);
    box-shadow:
      0 8px 18px rgba(15, 23, 42, 0.10),
      inset -4px -8px 12px rgba(255, 255, 255, 0.18),
      inset 3px 3px 8px rgba(255, 255, 255, 0.10),
      inset 5px 10px 14px rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(3px) saturate(180%);
    backdrop-filter: blur(3px) saturate(180%);
    opacity: 0;
    transition: opacity 200ms ease;
    will-change: transform, opacity;
    /* Sin transition en transform — animamos vía rAF para máxima fluidez */
  }
  .cx-cu-cursor.is-active {
    opacity: 1;
  }

  /* Estado hover sobre elementos interactivos: ligera ampliación + más opacidad */
  .cx-cu-cursor.is-hover {
    background:
      radial-gradient(125% 106% at 32% 3%,
        rgba(47, 107, 255, 0.48) 0%,
        rgba(47, 107, 255, 0.36) 35%,
        rgba(14, 165, 233, 0.28) 80%);
    border-color: rgba(47, 107, 255, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cx-cu-cursor { display: none !important; }
}

/* ════════════ CAROUSEL HORIZONTAL AUTO-SCROLL ════════════ */
.cx-cu-carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cx-cu-carousel__track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 107, 255, 0.3) transparent;
}
.cx-cu-carousel__track::-webkit-scrollbar { height: 8px; }
.cx-cu-carousel__track::-webkit-scrollbar-track { background: transparent; }
.cx-cu-carousel__track::-webkit-scrollbar-thumb { background: rgba(47, 107, 255, 0.3); border-radius: 999px; }
.cx-cu-carousel__track > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.cx-cu-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
.cx-cu-carousel__btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--cx-line, #e6e9f2);
  background: #fff;
  color: var(--cx-ink, #0c1430);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: all 200ms ease;
}
.cx-cu-carousel__btn:hover {
  border-color: var(--cx-blue, #2f6bff);
  color: var(--cx-blue, #2f6bff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(47, 107, 255, 0.25);
}
.cx-cu-carousel__btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.cx-cu-carousel__btn svg { width: 16px; height: 16px; }
.cx-cu-carousel__dots { display: inline-flex; gap: 6px; }
.cx-cu-carousel__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cx-line, #e6e9f2);
  border: 0; padding: 0;
  cursor: pointer;
  transition: all 200ms ease;
}
.cx-cu-carousel__dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: var(--cx-blue, #2f6bff);
}

@media (prefers-reduced-motion: reduce) {
  .cx-cu-carousel__track { scroll-behavior: auto; }
}

/* Override ce-grid cuando está dentro de un carousel */
.cx-cu-carousel__track.ce-grid {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 20px;
}
.cx-cu-carousel__track.ce-grid > .ce-card {
  flex: 0 0 calc((100% - 60px) / 4);
  min-width: 280px;
  scroll-snap-align: start;
}
@media (max-width: 1180px) {
  .cx-cu-carousel__track.ce-grid > .ce-card { flex: 0 0 calc((100% - 40px) / 3); }
}
@media (max-width: 900px) {
  .cx-cu-carousel__track.ce-grid > .ce-card { flex: 0 0 calc((100% - 20px) / 2); }
}
@media (max-width: 540px) {
  .cx-cu-carousel__track.ce-grid > .ce-card { flex: 0 0 85%; }
}
