/*
 * iPlug CRM — Home: posición de los modales flotantes + flotación suave
 * (cambios marcados en rojo en "CAMBIOS 3/iPlug CRM - Elevate Insurance Efficiency.pdf")
 *
 * Solo mueve modales y la franja de beneficios del hero; no cambia textos.
 * Uso: cargar en la Home después del CSS del sitio, por ejemplo en src/pages/index.astro:
 *   <link rel="stylesheet" href="/iplug-home-modales.css" />
 * La imagen io-head.webp va en la misma carpeta que este archivo (p. ej. /public).
 */

/* ---------- Flotación suave para todos los modales ---------- */
@keyframes hmFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%      { transform: translate3d(0, -10px, 0) rotate(-0.4deg); }
}
@keyframes hmFloatAlt {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%      { transform: translate3d(0, 9px, 0) rotate(0.4deg); }
}

.hero-float-a, .hero-float-b, .hero-float-c,
.sig-float-a, .sig-float-b, .sig-float-c, .io-float-a, .io-float-b,
.absolute:has([data-i18n="what-we-do.automationLabel"]):not(:has(.absolute)),
.absolute:has([data-i18n="what-we-do.perfLabel"]):not(:has(.absolute)),
.absolute:has([data-i18n="meet-io.answerTitle"]):not(:has(.absolute)) {
  animation: hmFloat 6.5s ease-in-out infinite !important;
  will-change: transform;
}
/* Alternar el ritmo para que no floten todos a la vez */
.hero-float-b, .sig-float-b, .io-float-a,
.absolute:has([data-i18n="what-we-do.perfLabel"]):not(:has(.absolute)) {
  animation-name: hmFloatAlt !important;
  animation-duration: 7.5s !important;
  animation-delay: -2s !important;
}
.hero-float-c, .sig-float-c, .io-float-b.right-3.top-3,
.absolute:has([data-i18n="meet-io.answerTitle"]):not(:has(.absolute)) {
  animation-duration: 8s !important;
  animation-delay: -4s !important;
}

/* ---------- Hero: los modales tocan solo la orilla de la laptop ---------- */
@media (min-width: 1280px) {
  /* 1. "Renovación de póliza": otro extremo, apoyado en la orilla superior derecha */
  .hero-float-a {
    left: auto !important;
    right: 5px !important;
    top: -6px !important;
  }
  /* 2. "Reporte de comisiones": subido, tocando la orilla izquierda */
  .hero-float-b {
    left: -110px !important;
    top: 170px !important;
  }
  /* "Campaña de cumpleaños": tocando la orilla inferior de la base */
  .hero-float-c {
    right: -10px !important;
    top: 395px !important;
  }
}

/* 3. Beneficios del hero: barra de vidrio alargada y flotante ("pastilla"), montada entre
      el hero y la sección oscura */

/* Común: la franja de beneficios deja de ser una caja */
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) {
  overflow: visible;
  border: 0 !important;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
}
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .absolute { display: none; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div { border: 0 !important; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div:nth-child(4n+1) { --hm-c: #4A90E2; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div:nth-child(4n+2) { --hm-c: #57A94B; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div:nth-child(4n+3) { --hm-c: #A177F4; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div:nth-child(4n+4) { --hm-c: #3E97FF; }

/* "Campaña de cumpleaños" sube por el costado derecho de la laptop para no pegar
   con la barra (se separa más en pantallas anchas y nunca se corta en las angostas) */
@media (min-width: 1280px) {
  .hero-float-c {
    left: auto !important;
    right: clamp(-150px, calc((1280px - 100vw) / 2 + 12px), -10px) !important;
    top: 235px !important;
  }
}

@keyframes hmBarFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -7px; }
}
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) {
  position: relative;
  z-index: 3;
  width: min(1240px, 100%);
  margin: 2.75rem auto 0;
}
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 10px !important;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
  -webkit-backdrop-filter: blur(22px) saturate(170%);
          backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    0 26px 60px rgba(15, 25, 50, 0.22),
    0 2px 6px rgba(15, 25, 50, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  animation: hmBarFloat 6.5s ease-in-out infinite;
}
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  align-items: center !important;
  gap: 14px !important;
  padding: 16px 22px !important;
  border-radius: 999px;
  transition: background 0.3s ease, scale 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div:hover { background: rgba(255, 255, 255, 0.75); scale: 1.03; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div + div::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: rgba(44, 62, 80, 0.12);
}
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div:hover::before, body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div:hover + div::before { opacity: 0; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div > div:first-child { width: 44px !important; height: 44px !important; border-radius: 50% !important; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div > div:first-child svg { width: 20px; height: 20px; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) h4 { font-size: 14.5px !important; line-height: 1.3; }
body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) p { margin-top: 3px !important; font-size: 12.5px !important; line-height: 1.5 !important; color: #5D7086 !important; }
@media (min-width: 1024px) {
  body > div.overflow-x-clip { position: relative; z-index: 4; }
  body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) { margin-bottom: -135px; }     /* 80px de espacio del hero + la mitad de la barra */
  body > div.overflow-x-clip + section { padding-top: calc(7rem + 40px) !important; }
}
@media (max-width: 1023px) {
  body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid { flex-wrap: wrap; border-radius: 26px; }
  body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div { flex: 1 1 calc(50% - 6px); border-radius: 18px; }
  body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div + div::before { display: none; }
}
@media (max-width: 560px) {
  body > div.overflow-x-clip > .max-w-screen-xl > .relative.z-\[3\].mt-8:has([data-i18n="hero.value1Title"]) > .grid > div { flex-basis: 100%; }
}

/* ---------- "Todo lo que tu agencia necesita": tocando la orilla del dashboard ---------- */
@media (min-width: 1024px) {
  /* 4. "Automatización completada": un poco a la izquierda, tocando la orilla superior */
  .absolute:has([data-i18n="what-we-do.automationLabel"]):not(:has(.absolute)) {
    right: 80px !important;
    top: -8px !important;
  }
  /* 5. "Reporte de rendimiento": otro extremo, tocando la esquina inferior derecha */
  .absolute:has([data-i18n="what-we-do.perfLabel"]):not(:has(.absolute)) {
    left: auto !important;
    bottom: auto !important;
    right: -82px !important;
    top: 425px !important;
  }
}

/* ---------- Features: Formularios de firma digital, en los extremos, apenas rozando el video ---------- */
@media (min-width: 1280px) {
  /* "Cliente inactivo": tocando la orilla izquierda del documento */
  .sig-float-a {
    left: -10px !important;
    top: 26px !important;
  }
  /* 6. "Firma capturada": arriba, tocando la orilla derecha del documento */
  .sig-float-c {
    right: 13px !important;
    top: 40px !important;
  }
  /* 7. "Actividad de firma": otro extremo, abajo, tocando la orilla derecha */
  .sig-float-b {
    left: auto !important;
    right: -11px !important;
    bottom: 36px !important;
  }
}

/* ---------- Conoce a IO: tocando la orilla del chat ---------- */
@media (min-width: 1024px) {
  /* 8. "Orientación rápida": otro extremo, tocando la orilla derecha del chat */
  .absolute:has([data-i18n="meet-io.answerTitle"]):not(:has(.absolute)) {
    left: auto !important;
    bottom: auto !important;
    right: clamp(-60px, calc((1280px - 100vw) / 2 + 12px), 0px) !important;
    top: 300px !important;
  }
  /* "Prueba preguntándole a IO": tocando la orilla izquierda del chat */
  .io-float-a {
    left: 77px !important;
    top: 380px !important;
  }
  /* "IO is ready": tocando la orilla superior del chat */
  .io-float-b.right-3.top-3 {
    right: 60px !important;
    top: 106px !important;
  }
}

/* ---------- Modales de las secciones claras: efecto glass ---------- */
.hero-float-a, .hero-float-b, .hero-float-c,
.sig-float-a, .sig-float-b, .sig-float-c {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.36)) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  -webkit-backdrop-filter: blur(18px) saturate(170%);
          backdrop-filter: blur(18px) saturate(170%);
  box-shadow:
    0 18px 40px rgba(30, 40, 60, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25) !important;
}

/* ---------- Modal "IO" (Todo lo que tu agencia necesita): la carita del asistente ---------- */
.absolute:has([data-i18n="what-we-do.automationLabel"]):not(:has(.absolute)) > .grid.h-9.w-9 {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0;            /* oculta las letras "IO"; el resto del texto se mantiene */
  color: transparent;
  background: url("io-head.webp") center / 112% no-repeat,
              radial-gradient(circle at 50% 60%, rgba(162, 225, 141, 0.28), rgba(74, 144, 226, 0.12) 70%) !important;
  border-radius: 14px;
}

/* ---------- "Tu CRM sabe mucho" (IO): modales en vidrio oscuro ---------- */
.io-float-a, .io-float-b {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%);
          backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    0 18px 40px rgba(3, 10, 25, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
  color: #C9D6E3 !important;
}
/* Mismos textos, en tonos claros para que se lean sobre el vidrio */
.io-float-a strong, .io-float-b b { color: #FFFFFF !important; }
.io-float-a small, .io-float-b span.block,
.io-float-b > span[data-i18n] { color: #B9CBDB !important; }
.io-float-b .grid { color: #D3C2FF !important; }

/* Los círculos de IO giran muy despacio con un punto de luz que los recorre */
@keyframes hmOrbit { to { rotate: 360deg; } }
@keyframes hmOrbitGlow {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
.io-orbit {
  animation: hmOrbit 40s linear infinite;
}
.io-orbit + .io-orbit {
  animation-duration: 28s;
  animation-direction: reverse;
}
.io-orbit::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #C7AEFF;
  box-shadow: 0 0 12px 4px rgba(199, 174, 255, 0.5);
  animation: hmOrbitGlow 3.2s ease-in-out infinite;
}

/* ---------- Última sección: los teléfonos flotan suave con su sombra debajo ---------- */
@keyframes hmPhones {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%      { transform: translate3d(0, -14px, 0) rotate(-0.6deg); }
}
@keyframes hmPhonesShadow {
  0%, 100% { transform: scale(1);    opacity: 0.9; }
  50%      { transform: scale(0.82); opacity: 0.5; }
}
#homePlanHighlight .relative.mx-auto.w-full.max-w-md > img {
  position: relative;
  z-index: 1;
  animation: hmPhones 6.5s ease-in-out infinite;
  will-change: transform;
}
#homePlanHighlight .relative.mx-auto.w-full.max-w-md:has(> img)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 16%;
  right: 16%;
  bottom: -18px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(26, 37, 70, 0.32), rgba(26, 37, 70, 0) 70%);
  filter: blur(3px);
  animation: hmPhonesShadow 6.5s ease-in-out infinite;
  pointer-events: none;
}

/* ---------- Testimonios: 3 tarjetas completas a la vista (2 en tablet, 1 en celular) ---------- */
#reviewsTrack > .review-card {
  scroll-snap-align: start !important;
  translate: var(--hm-sub, 0px) 0;   /* fracción de píxel del carrusel continuo */
  transition: scale 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}
/* Pequeño zoom en la tarjeta que tiene el cursor encima */
#reviewsTrack > .review-card:hover {
  scale: 1.035;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 30px 60px rgba(3, 10, 25, 0.32) !important;
}
#reviewsTrack {
  padding-top: 14px !important;   /* espacio para que el zoom no se recorte */
  padding-bottom: 22px !important;
}
@media (min-width: 768px) {
  #reviewsTrack > .review-card {
    width: calc((100% - 20px) / 2) !important;
  }
}
@media (min-width: 1024px) {
  #reviewsTrack > .review-card {
    width: calc((100% - 40px) / 3) !important;
    padding: 1.6rem 1.6rem 1.4rem !important;
    min-height: 290px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-float-a, .hero-float-b, .hero-float-c,
  .sig-float-a, .sig-float-b, .sig-float-c, .io-float-a, .io-float-b,
  .absolute:has([data-i18n^="what-we-do."]):not(:has(.absolute)),
  .absolute:has([data-i18n="meet-io.answerTitle"]):not(:has(.absolute)),
  .io-orbit, .io-orbit::before,
  body > div.overflow-x-clip .grid,
  #homePlanHighlight .relative.mx-auto.w-full.max-w-md > img,
  #homePlanHighlight .relative.mx-auto.w-full.max-w-md::after {
    animation: none !important;
  }
}
