/* =========================================================
   PRODUCT FUNNEL HEADER
========================================================= */

.product-funnel-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;

  z-index: 9990;

  width: 100vw;
  max-width: none;

  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  box-sizing: border-box;

  overflow: visible;

  background:
    radial-gradient(
      circle at top center,
      rgba(77, 184, 255, 0.07),
      transparent 60%
    ),
    linear-gradient(180deg, rgba(5, 10, 18, 0.98), rgba(5, 10, 18, 0.95));

  border-bottom: 1px solid rgba(77, 184, 255, 0.16);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    0 0 35px rgba(77, 184, 255, 0.06);

  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

/* =========================================================
   HEADER STATE WHILE FUNNEL FORM IS OPEN
========================================================= */

body.funnel-modal-open .product-funnel-header {
  z-index: 0;
}

/* =========================================================
   INNER WRAPPER
   FULL WIDTH
========================================================= */

.product-funnel-header-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;

  width: 100%;
  max-width: none;

  margin: 0;
  padding: 18px 0 0;

  box-sizing: border-box;

  gap: 18px;

  overflow: visible;
}

/* =========================================================
   LOGO
========================================================= */

.product-funnel-logo {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;

  padding: 0 20px;

  box-sizing: border-box;

  color: inherit;

  text-decoration: none;
}

.product-funnel-logo img {
  display: block;

  width: auto;
  height: 85px;

  max-width: min(90%, 360px);

  object-fit: contain;

  transition:
    transform 0.25s ease,
    filter 0.25s ease;
}

/* =========================================================
   LOGO HOVER
========================================================= */

.product-funnel-logo:hover img {
  transform: translateY(-1px) scale(1.015);

  filter: drop-shadow(0 0 16px rgba(77, 184, 255, 0.28));
}

.product-funnel-logo:focus-visible {
  outline: 2px solid #4db8ff;
  outline-offset: 5px;
}

/* =========================================================
   HEADER CTA
   PREMIUM LARGE VERSION
========================================================= */

.product-funnel-cta,
.product-funnel-header button.product-funnel-cta {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  max-width: none;
  min-height: 92px;

  margin: 0;
  padding: 22px 36px;

  box-sizing: border-box;

  border-top: 1px solid rgba(77, 184, 255, 0.72);
  border-right: 0;
  border-bottom: 1px solid rgba(77, 184, 255, 0.72);
  border-left: 0;

  border-radius: 0;

  background:
    radial-gradient(
      circle at center,
      rgba(77, 184, 255, 0.16),
      transparent 70%
    ),
    linear-gradient(
      90deg,
      rgba(4, 9, 16, 0.99),
      rgba(25, 45, 70, 0.99),
      rgba(4, 9, 16, 0.99)
    );

  color: #ffffff;

  font-family: "Merriweather", serif;
  font-size: clamp(1.55rem, 2.15vw, 1.9rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.2px;

  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;

  cursor: pointer;
  overflow: hidden;

  appearance: none;
  -webkit-appearance: none;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 0 34px rgba(77, 184, 255, 0.2),
    0 15px 42px rgba(0, 0, 0, 0.38);

  transition:
    color 0.25s ease,
    transform 0.25s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    letter-spacing 0.25s ease;
}

/* =========================================================
   SHIMMER
========================================================= */

.product-funnel-cta::before {
  content: "";

  position: absolute;
  inset: 0;

  z-index: 1;

  background: linear-gradient(
    110deg,
    transparent 34%,
    rgba(255, 255, 255, 0.13) 50%,
    transparent 66%
  );

  transform: translateX(-130%);
  transition: transform 0.9s ease;

  pointer-events: none;
}

/* =========================================================
   CTA CONTENT
========================================================= */

.product-funnel-cta .cta-arrow {
  position: relative;
  z-index: 2;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;

  width: auto;
  max-width: 100%;

  color: #ffffff;

  text-align: center;

  text-shadow:
    0 0 14px rgba(77, 184, 255, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.5);

  pointer-events: none;
}

/* =========================================================
   RIGHT-POINTING ARROW
========================================================= */

.product-funnel-cta .cta-arrow::before {
  content: "❯";

  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  width: 36px;
  height: 36px;

  margin-right: 2px;

  border: 1px solid rgba(143, 220, 255, 0.6);
  border-radius: 999px;

  background: radial-gradient(
    circle at center,
    rgba(77, 184, 255, 0.38),
    rgba(77, 184, 255, 0.1) 72%
  );

  color: #d7f6ff;

  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;

  text-shadow:
    0 0 10px rgba(77, 184, 255, 1),
    0 0 22px rgba(77, 184, 255, 0.6);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 0 18px rgba(77, 184, 255, 0.38),
    0 0 34px rgba(77, 184, 255, 0.18);

  transform: translateX(0) scale(1);

  transition:
    transform 0.25s ease,
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;

  pointer-events: none;
}

/* =========================================================
   HOVER
========================================================= */

.product-funnel-cta:hover .cta-arrow::before {
  color: #ffffff;

  border-color: rgba(143, 220, 255, 1);

  background: radial-gradient(
    circle at center,
    rgba(77, 184, 255, 0.58),
    rgba(77, 184, 255, 0.16) 72%
  );

  transform: translateX(7px) scale(1.08);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 26px rgba(77, 184, 255, 0.85),
    0 0 46px rgba(77, 184, 255, 0.32);
}

/* =========================================================
   ACTIVE
========================================================= */

.product-funnel-cta:active .cta-arrow::before {
  transform: translateX(3px) scale(0.96);
}

/* =========================================================
   BOTTOM GLOW
========================================================= */

.product-funnel-cta::after {
  content: "";

  position: absolute;

  left: 50%;
  bottom: -1px;

  z-index: 2;

  width: 42%;
  height: 4px;

  transform: translateX(-50%);

  border-radius: 999px;

  background: linear-gradient(
    90deg,
    transparent,
    #4db8ff,
    #c6f2ff,
    #4db8ff,
    transparent
  );

  box-shadow:
    0 0 18px rgba(77, 184, 255, 1),
    0 0 38px rgba(77, 184, 255, 0.6);

  transition:
    width 0.3s ease,
    box-shadow 0.3s ease;

  pointer-events: none;
}

/* =========================================================
   HOVER
========================================================= */

.product-funnel-cta:hover,
.product-funnel-header button.product-funnel-cta:hover {
  color: #ffffff;

  border-top-color: rgba(77, 184, 255, 1);
  border-bottom-color: rgba(77, 184, 255, 1);

  background:
    radial-gradient(
      circle at center,
      rgba(77, 184, 255, 0.22),
      transparent 70%
    ),
    linear-gradient(
      90deg,
      rgba(7, 13, 22, 0.99),
      rgba(35, 61, 91, 0.99),
      rgba(7, 13, 22, 0.99)
    );

  transform: translateY(-3px);

  letter-spacing: 1.3px;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 48px rgba(77, 184, 255, 0.34),
    0 19px 48px rgba(0, 0, 0, 0.44);
}

.product-funnel-cta:hover::before {
  transform: translateX(130%);
}

.product-funnel-cta:hover::after {
  width: 70%;

  box-shadow:
    0 0 22px rgba(77, 184, 255, 1),
    0 0 46px rgba(77, 184, 255, 0.68);
}

.product-funnel-cta:hover .cta-arrow::before {
  color: #ffffff;

  border-color: rgba(143, 220, 255, 1);

  background: radial-gradient(
    circle at center,
    rgba(77, 184, 255, 0.52),
    rgba(77, 184, 255, 0.14) 72%
  );

  transform: translateX(-7px) scale(1.08);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 24px rgba(77, 184, 255, 0.78),
    0 0 40px rgba(77, 184, 255, 0.3);
}

/* =========================================================
   ACTIVE
========================================================= */

.product-funnel-cta:active,
.product-funnel-header button.product-funnel-cta:active {
  transform: translateY(1px) scale(0.99);

  box-shadow:
    inset 0 3px 9px rgba(0, 0, 0, 0.38),
    0 0 26px rgba(77, 184, 255, 0.22);
}

.product-funnel-cta:active .cta-arrow::before {
  transform: translateX(-3px) scale(0.96);
}

/* =========================================================
   KEYBOARD FOCUS
========================================================= */

.product-funnel-cta:focus-visible {
  outline: 3px solid #4db8ff;
  outline-offset: -4px;
}

/* =========================================================
   WORDPRESS BUTTON RESET
========================================================= */

.product-funnel-header button.product-funnel-cta {
  font: inherit;
}

/* =========================================================
   FUNNEL MODAL
   CENTERED ABOVE THE STICKY HEADER
========================================================= */

.funnel-form-modal {
  position: fixed !important;
  inset: 0 !important;

  z-index: 2147483647 !important;

  display: none;
  align-items: center !important;
  justify-content: center !important;

  width: 100% !important;
  min-width: 100% !important;

  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;

  margin: 0 !important;
  padding: clamp(18px, 4vw, 48px) !important;

  box-sizing: border-box !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;

  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  isolation: isolate;
}

.funnel-form-modal.active {
  display: flex !important;
}

/* =========================================================
   FUNNEL MODAL OVERLAY
========================================================= */

.funnel-form-overlay {
  position: fixed !important;
  inset: 0 !important;

  z-index: 0 !important;

  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;

  margin: 0 !important;
}

/* =========================================================
   FUNNEL MODAL BOX
========================================================= */

.funnel-form-box {
  position: relative !important;

  z-index: 1 !important;

  width: min(100%, 680px) !important;
  max-width: 680px !important;

  margin: auto !important;

  box-sizing: border-box !important;
}

/* =========================================================
   SHORT SCREENS
   KEEP THE TOP OF LONG FORMS ACCESSIBLE
========================================================= */

@media (max-height: 820px) {
  .funnel-form-modal {
    align-items: flex-start !important;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  .funnel-form-box {
    margin: 0 auto !important;
  }
}

/* =========================================================
   MOBILE MODAL SPACING
========================================================= */

@media (max-width: 650px) {
  .funnel-form-modal {
    padding: 16px 12px !important;
  }

  .funnel-form-box {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 650px) and (max-height: 700px) {
  .funnel-form-modal {
    align-items: flex-start !important;
  }

  .funnel-form-box {
    margin: 0 auto !important;
  }
}

/* =========================================================
   PREVENT PAGE SCROLL WHILE MODAL IS OPEN
========================================================= */

html:has(body.funnel-modal-open) {
  overflow: hidden;
}

body.funnel-modal-open {
  overflow: hidden !important;

  touch-action: none;
}

/* =========================================================
   WORDPRESS ADMIN BAR SUPPORT
========================================================= */

body.admin-bar .product-funnel-header {
  top: 32px;
}

body.admin-bar.funnel-modal-open .funnel-form-modal,
body.admin-bar.funnel-modal-open .funnel-form-overlay {
  top: 0 !important;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 768px) {
  .product-funnel-header-inner {
    padding-top: 15px;

    gap: 15px;
  }

  .product-funnel-logo {
    padding: 0 16px;
  }

  .product-funnel-logo img {
    height: 72px;

    max-width: min(90%, 300px);
  }

  .product-funnel-cta,
  .product-funnel-header button.product-funnel-cta {
    min-height: 82px;

    padding: 20px 26px;

    font-size: 1.35rem;
  }

  .product-funnel-cta .cta-arrow {
    gap: 12px;
  }

  .product-funnel-cta .cta-arrow::before {
    width: 32px;
    height: 32px;

    font-size: 0.92rem;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {
  body.admin-bar .product-funnel-header {
    top: 46px;
  }
}

@media (max-width: 520px) {
  .product-funnel-header-inner {
    padding-top: 13px;

    gap: 13px;
  }

  .product-funnel-logo {
    padding: 0 14px;
  }

  .product-funnel-logo img {
    height: 64px;

    max-width: min(92%, 270px);
  }

  .product-funnel-cta,
  .product-funnel-header button.product-funnel-cta {
    min-height: 68px;

    padding: 18px 16px;

    font-size: 1.18rem;
    line-height: 1.2;
  }

  .product-funnel-cta .cta-arrow {
    gap: 10px;
  }

  .product-funnel-cta .cta-arrow::before {
    width: 26px;
    height: 26px;

    font-size: 0.82rem;
  }

  .product-funnel-cta::after {
    width: 40%;
  }

  .product-funnel-cta:hover::after {
    width: 65%;
  }
}

/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 380px) {
  .product-funnel-logo img {
    height: 58px;

    max-width: min(92%, 240px);
  }

  .product-funnel-cta,
  .product-funnel-header button.product-funnel-cta {
    min-height: 68px;

    padding: 16px 12px;

    font-size: 1.05rem;
  }

  .product-funnel-cta .cta-arrow {
    gap: 8px;
  }

  .product-funnel-cta .cta-arrow::before {
    width: 28px;
    height: 28px;

    font-size: 0.76rem;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .product-funnel-header,
  .product-funnel-logo img,
  .product-funnel-cta,
  .product-funnel-cta::before,
  .product-funnel-cta::after,
  .product-funnel-cta .cta-arrow::before {
    transition: none;
  }
}
