/* Barra COTIZA TU PÁGINA WEB — alto impacto visual */

.gf-cotiza-web-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 8;
  display: block;
  width: clamp(280px, 52vw, 920px);
  max-width: calc(100% - 0.5rem);
  text-decoration: none;
  opacity: 0;
  transform: translate3d(calc(-105% - 48px), calc(100% + 40px), 0) scale(0.88);
  filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.45));
  will-change: transform, opacity, filter;
}

.gf-cotiza-web-bar.is-inview {
  animation: gf-cotiza-bar-enter 1.15s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

@keyframes gf-cotiza-bar-enter {
  0% {
    opacity: 0;
    transform: translate3d(calc(-105% - 48px), calc(100% + 40px), 0) scale(0.88);
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.2));
  }
  55% {
    opacity: 1;
    transform: translate3d(10px, -10px, 0) scale(1.03);
    filter: drop-shadow(0 22px 44px rgba(37, 99, 235, 0.65));
  }
  72% {
    transform: translate3d(-4px, 4px, 0) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: drop-shadow(0 16px 36px rgba(37, 99, 235, 0.55));
  }
}

.gf-cotiza-web-bar.is-inview:hover,
.gf-cotiza-web-bar.is-inview:focus-visible {
  transform: translate3d(0, -6px, 0) scale(1.02);
  filter: drop-shadow(0 24px 48px rgba(37, 99, 235, 0.7));
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

.gf-cotiza-web-bar__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.2vw, 1rem);
  padding: clamp(0.45rem, 1vw, 0.65rem) clamp(0.5rem, 1vw, 0.75rem);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(105deg, #1e40af 0%, #2563eb 38%, #3b82f6 62%, #60a5fa 100%);
  background-size: 220% 100%;
  border: 2px solid rgba(147, 197, 253, 0.95);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.55),
    0 0 28px rgba(59, 130, 246, 0.65),
    0 0 48px rgba(37, 99, 235, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  animation: gf-cotiza-bar-glow 3.2s ease-in-out 1.2s infinite;
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__inner {
  animation:
    gf-cotiza-bar-bg-flow 5s linear infinite,
    gf-cotiza-bar-glow 3.2s ease-in-out 1.2s infinite;
}

@keyframes gf-cotiza-bar-bg-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

@keyframes gf-cotiza-bar-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(59, 130, 246, 0.55),
      0 0 22px rgba(59, 130, 246, 0.5),
      0 0 40px rgba(37, 99, 235, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(147, 197, 253, 0.75),
      0 0 36px rgba(96, 165, 250, 0.85),
      0 0 60px rgba(37, 99, 235, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
}

.gf-cotiza-web-bar__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 32%,
    rgba(255, 255, 255, 0.22) 46%,
    transparent 58%
  );
  transform: translateX(-130%) skewX(-14deg);
  pointer-events: none;
  opacity: 0;
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__inner::after {
  animation: gf-cotiza-bar-shine 2.8s ease-in-out 0.9s infinite;
}

@keyframes gf-cotiza-bar-shine {
  0%,
  72% {
    opacity: 0;
    transform: translateX(-130%) skewX(-14deg);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(130%) skewX(-14deg);
  }
}

.gf-cotiza-web-bar__globe {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(36px, 5vw, 48px);
  height: clamp(36px, 5vw, 48px);
  border-radius: 8px;
  background: rgba(30, 64, 175, 0.75);
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.35rem);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.45);
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__globe {
  animation: gf-cotiza-globe-pop 0.75s cubic-bezier(0.34, 1.45, 0.64, 1) 0.35s backwards,
    gf-cotiza-globe-float 2.4s ease-in-out 1.1s infinite;
}

@keyframes gf-cotiza-globe-pop {
  0% {
    opacity: 0;
    transform: scale(0.4) rotate(-20deg);
  }
  70% {
    transform: scale(1.12) rotate(6deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes gf-cotiza-globe-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.gf-cotiza-web-bar__copy {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-right: 0.25rem;
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__title {
  animation: gf-cotiza-text-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.42s backwards;
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__sub {
  animation: gf-cotiza-text-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.52s backwards;
}

@keyframes gf-cotiza-text-in {
  0% {
    opacity: 0;
    transform: translateX(-16px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.gf-cotiza-web-bar__title {
  font-family: "Audiowide", "Segoe UI", sans-serif;
  font-size: clamp(0.58rem, 1.35vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(30, 64, 175, 0.45);
}

.gf-cotiza-web-bar__sub {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: clamp(0.48rem, 1vw, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #dbeafe;
  line-height: 1.2;
}

.gf-cotiza-web-bar__cta {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: clamp(0.42rem, 0.95vw, 0.6rem) clamp(0.6rem, 1.3vw, 1rem);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  color: #1d4ed8;
  font-family: "Audiowide", "Segoe UI", sans-serif;
  font-size: clamp(0.5rem, 1.15vw, 0.82rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 6px 20px rgba(15, 23, 42, 0.22),
    0 0 0 0 rgba(255, 255, 255, 0.4);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    color 0.25s ease;
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__cta {
  animation:
    gf-cotiza-cta-pop 0.7s cubic-bezier(0.34, 1.5, 0.64, 1) 0.58s backwards,
    gf-cotiza-cta-pulse 2.5s ease-in-out 1.3s infinite;
}

@keyframes gf-cotiza-cta-pop {
  0% {
    opacity: 0;
    transform: scale(0.65) translateY(12px);
  }
  65% {
    transform: scale(1.08) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes gf-cotiza-cta-pulse {
  0%,
  100% {
    box-shadow:
      0 6px 20px rgba(15, 23, 42, 0.22),
      0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow:
      0 10px 28px rgba(29, 78, 216, 0.35),
      0 0 0 8px rgba(255, 255, 255, 0.2);
  }
}

.gf-cotiza-web-bar__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.85) 48%,
    transparent 62%
  );
  transform: translateX(-140%) skewX(-12deg);
  pointer-events: none;
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__cta::after {
  animation: gf-cotiza-cta-shine 2.2s ease-in-out 1.1s infinite;
}

@keyframes gf-cotiza-cta-shine {
  0%,
  65% {
    transform: translateX(-140%) skewX(-12deg);
  }
  100% {
    transform: translateX(140%) skewX(-12deg);
  }
}

.gf-cotiza-web-bar__cta i {
  font-size: 0.9em;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__cta i {
  animation: gf-cotiza-arrow-nudge 1.6s ease-in-out 1.4s infinite;
}

@keyframes gf-cotiza-arrow-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

.gf-cotiza-web-bar:hover .gf-cotiza-web-bar__cta,
.gf-cotiza-web-bar:focus-visible .gf-cotiza-web-bar__cta {
  transform: scale(1.06);
  color: #1e3a8a;
  box-shadow:
    0 12px 32px rgba(29, 78, 216, 0.4),
    0 0 0 10px rgba(255, 255, 255, 0.25);
}

.gf-cotiza-web-bar:hover .gf-cotiza-web-bar__cta i,
.gf-cotiza-web-bar:focus-visible .gf-cotiza-web-bar__cta i {
  transform: translateX(6px);
  animation: none;
}

@media (max-width: 767.98px) {
  .gf-home-promo-banner-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 8px 0 4px;
  }

  .gf-home-promo-banner {
    order: 1;
    flex: 0 0 auto;
  }

  .gf-cotiza-web-bar {
    position: relative;
    left: auto;
    bottom: auto;
    order: 2;
    z-index: 5;
    width: 100%;
    max-width: 100%;
    margin-top: 0.65rem;
    transform: translate3d(0, 28px, 0) scale(0.96);
  }

  .gf-cotiza-web-bar.is-inview {
    animation: gf-cotiza-bar-enter-mobile 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
  }

  @keyframes gf-cotiza-bar-enter-mobile {
    0% {
      opacity: 0;
      transform: translate3d(0, 28px, 0) scale(0.96);
    }
    60% {
      transform: translate3d(0, -6px, 0) scale(1.02);
    }
    100% {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }
  }

  .gf-cotiza-web-bar.is-inview:hover,
  .gf-cotiza-web-bar.is-inview:focus-visible {
    transform: translate3d(0, -3px, 0) scale(1.01);
  }

  .gf-cotiza-web-bar__inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
  }

  .gf-cotiza-web-bar__copy {
    flex: 1 1 100%;
    order: 2;
    align-items: center;
  }

  .gf-cotiza-web-bar__title {
    font-size: clamp(0.62rem, 3.2vw, 0.82rem);
  }

  .gf-cotiza-web-bar__sub {
    font-size: clamp(0.52rem, 2.6vw, 0.68rem);
  }

  .gf-cotiza-web-bar__cta {
    order: 3;
    width: 100%;
    justify-content: center;
    font-size: clamp(0.58rem, 3vw, 0.75rem);
    padding: 0.55rem 0.85rem;
  }

  .gf-cotiza-web-bar__globe {
    order: 1;
  }
}

/* Si el JS no carga, la barra igual se ve tras unos segundos */
.gf-cotiza-web-bar:not(.is-inview) {
  animation: gf-cotiza-bar-fallback-show 0.01s 2s forwards;
}

@keyframes gf-cotiza-bar-fallback-show {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: drop-shadow(0 16px 36px rgba(37, 99, 235, 0.55));
  }
}

@media (prefers-reduced-motion: reduce) {
  .gf-cotiza-web-bar,
  .gf-cotiza-web-bar.is-inview {
    opacity: 1;
    transform: none;
    animation: none;
    filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.45));
    transition: none;
  }

  .gf-cotiza-web-bar__inner,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__inner,
  .gf-cotiza-web-bar__inner::after,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__inner::after,
  .gf-cotiza-web-bar__globe,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__globe,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__title,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__sub,
  .gf-cotiza-web-bar__cta,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__cta,
  .gf-cotiza-web-bar__cta::after,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__cta::after,
  .gf-cotiza-web-bar__cta i,
  .gf-cotiza-web-bar.is-inview .gf-cotiza-web-bar__cta i {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
