/* Load after the site's header CSS. No JS => no layout changes. */
html { --wwfh-css-ready: 1; }
html[data-wwfh-root="active"] {
  scroll-padding-top: max(var(--wwfh-native-scroll-padding, 0px), var(--wwfh-occlusion, 0px)) !important;
}

[data-wwfh-state="following"] {
  position: fixed !important;
  inset: auto !important;
  top: max(5px, env(safe-area-inset-top, 0px)) !important;
  left: var(--wwfh-left) !important;
  width: var(--wwfh-width) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: var(--wwfh-follow-min-height, var(--wwfh-min-height)) !important;
  max-height: none !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding-top: var(--wwfh-follow-padding-top, var(--wwfh-native-padding-top)) !important;
  padding-right: var(--wwfh-native-padding-right) !important;
  padding-bottom: var(--wwfh-follow-padding-bottom, var(--wwfh-native-padding-bottom)) !important;
  padding-left: var(--wwfh-native-padding-left) !important;
  border-top: var(--wwfh-native-border-top) !important;
  border-right: var(--wwfh-native-border-right) !important;
  border-bottom: var(--wwfh-native-border-bottom) !important;
  border-left: var(--wwfh-native-border-left) !important;
  background: var(--wwfh-native-background) !important;
  color: var(--wwfh-native-color) !important;
  overflow: visible !important;
  display: var(--wwfh-native-display) !important;
  transform: none !important;
  translate: none !important;
  rotate: none !important;
  scale: none !important;
  transition: none !important;
  animation: none !important;
  z-index: var(--wwfh-native-z-index, auto) !important;
  /* Deliberately no font, logo, grid, gap or control-size overrides. */
}

[data-wwfh-state="following"]::backdrop {
  background: transparent;
  pointer-events: none;
}

[data-wwfh-state="following"] [data-wwfh-surface] {
  background: #fff;
  border-radius: var(--wwfh-radius, 100px);
  box-shadow: 0 10px 20px rgba(71, 96, 156, .2);
  /* No clipping: dropdowns and focus rings may extend beyond the pill. */
}

@media (prefers-reduced-motion: reduce) {
  [data-wwfh-state="following"] { scroll-behavior: auto; }
}

/* O2's measured header keeps its native controls and normal first-screen grid. */
.ww-header[data-wwfh-state="following"] {
  min-height: 0 !important;
  background: transparent !important;
  pointer-events: none;
}

.ww-header[data-wwfh-state="following"] .ww-header__inner {
  height: 112px;
  min-height: 0;
  box-sizing: border-box;
  padding-inline: 48px;
  pointer-events: auto;
}

.ww-header[data-wwfh-state="following"] .ww-expanded-menu {
  top: calc(100% + 8px);
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}

.ww-header[data-wwfh-state="following"] .ww-menu,
.ww-header[data-wwfh-state="following"] .ww-chat--compact {
  min-width: 44px;
  min-height: 44px;
}

.ww-header[data-wwfh-state="following"] .ww-header__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.ww-header[data-wwfh-state="following"] .ww-header__phone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
}

@media (min-width: 1650px) {
  .ww-header[data-wwfh-state="following"] .ww-header__inner {
    height: 140px;
    padding-inline: 64px;
  }
  .ww-header[data-wwfh-state="following"] .ww-expanded-menu {
    max-height: calc(100dvh - 178px);
  }
}

@media (min-width: 961px) and (max-width: 1279px) {
  .ww-header[data-wwfh-state="following"] .ww-header__inner {
    height: 100px;
    padding-inline: 28px;
  }
}

@media (max-width: 960px) {
  .ww-header[data-wwfh-state="following"] .ww-header__inner {
    height: 82px;
    width: calc(100% - 24px);
    padding-inline: 16px;
  }
  .ww-header[data-wwfh-state="following"] .ww-expanded-menu {
    right: 12px;
    max-height: calc(100dvh - 120px);
  }
}

@media (max-width: 650px) {
  .ww-header[data-wwfh-state="following"] .ww-header__inner {
    width: calc(100% - 16px);
    padding-inline: 10px;
    --wwfh-radius: 44px;
  }
}
