/* Expandable Search: header search icon that grows a field to the left, from header-search-mockups.html.
   Rules are scoped under .cpxs so they outrank the Site Kit (.elementor-kit-N input / button). */
.cpxs { --cpxs-icon: 32px; --cpxs-w: 560px; --cpxs-h: 58px; --cpxs-mist: var(--cp-hero-mist); position: relative; display: flex; justify-content: flex-end; font-family: var(--cp-font); }
.cpxs svg { width: 1em; height: 1em; flex: none; fill: currentColor; }
.cpxs .cpxs__form { position: relative; display: flex; align-items: center; margin: 0; }

/* Icon button: magnifier, X while open */
.cpxs .cpxs__toggle { position: relative; z-index: 2; display: grid; place-items: center; width: calc(var(--cpxs-icon) + 12px); height: calc(var(--cpxs-icon) + 12px); margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; font-size: var(--cpxs-icon); color: var(--cp-header-accent); cursor: pointer; transition: color .2s; }
.cpxs .cpxs__toggle:hover, .cpxs .cpxs__toggle:focus { background: none; color: var(--cp-headline); }
.cpxs .cpxs__toggle:focus-visible, .cpxs .cpxs__go:focus-visible { outline: 3px solid var(--cp-accent); outline-offset: 3px; }
.cpxs .cpxs__i-x, .cpxs.is-open .cpxs__toggle .cpxs__i-search { display: none; }
.cpxs.is-open .cpxs__toggle .cpxs__i-x { display: block; font-size: .85em; }

/* Field: sits left of the icon and is revealed right-to-left */
.cpxs .cpxs__field { position: absolute; top: 50%; right: calc(100% + 8px); z-index: 99; display: flex; align-items: center; gap: 8px; width: min(var(--cpxs-w), var(--cpxs-max, 9999px)); height: var(--cpxs-h); transform: translateY(-50%);
  clip-path: inset(-24px -24px -24px calc(100% + 24px)); visibility: hidden; transition: clip-path .5s var(--cp-ease), visibility 0s .5s, box-shadow .2s, border-color .2s, background-color .2s; }
.cpxs.is-open .cpxs__field { clip-path: inset(-24px); visibility: visible; transition: clip-path .5s var(--cp-ease), visibility 0s, box-shadow .2s, border-color .2s, background-color .2s; }
.cpxs .cpxs__field input[type="search"] { flex: 1; min-width: 0; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: 0; font-family: var(--cp-font); font-size: 15px; color: var(--cp-headline); -webkit-appearance: none; appearance: none; }
.cpxs .cpxs__field input::placeholder { color: #8A97A8; opacity: 1; }
.cpxs .cpxs__field input::-webkit-search-cancel-button { display: none; }
.cpxs .cpxs__go { flex: none; display: inline-flex; align-items: center; gap: 8px; height: calc(var(--cpxs-h) - 12px); margin: 0; border: 0; box-shadow: none; font-family: var(--cp-font); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: 0; text-transform: none; white-space: nowrap; cursor: pointer; transition: background-color .25s; }
.cpxs .cpxs__go svg { font-size: 18px; transition: transform .3s var(--cp-ease); }
.cpxs .cpxs__go:hover svg { transform: translateX(3px); }

/* Pill: white, coral Search button (same as the 404 and search page bars) */
.cpxs--pill .cpxs__field { padding: 6px 6px 6px 20px; border-radius: 999px; background: var(--cp-white); box-shadow: 0 0 0 1px var(--cp-line), 0 12px 28px -18px #1a2b4c59; }
.cpxs--pill .cpxs__field:focus-within { box-shadow: 0 0 0 2px var(--cp-accent), 0 0 0 6px var(--cp-light-accent); }
.cpxs--pill .cpxs__field > svg { font-size: 20px; color: var(--cp-header-accent); }
.cpxs.cpxs--pill .cpxs__go { padding: 0 24px; border-radius: 30px; background: var(--cp-accent); color: var(--cp-primary); }
.cpxs.cpxs--pill .cpxs__go:hover, .cpxs.cpxs--pill .cpxs__go:focus { background: var(--cp-dark-accent); color: var(--cp-primary); }
.cpxs--pill .cpxs__go svg { display: none; }

/* Mist bar: fills up to the logo, navy Search button */
.cpxs--mist { --cpxs-w: 9999px; --cpxs-h: 60px; }
.cpxs--mist .cpxs__field { padding: 0 6px 0 22px; border: 1px solid transparent; border-radius: 18px; background: var(--cpxs-mist); }
.cpxs--mist .cpxs__field:focus-within { border-color: var(--cp-header-accent); background: var(--cp-white); }
.cpxs--mist .cpxs__field > svg { display: none; }
.cpxs.cpxs--mist .cpxs__field input[type="search"] { font-size: 17px; font-weight: 500; }
.cpxs.cpxs--mist .cpxs__go { padding: 0 18px 0 22px; border-radius: 14px; background: var(--cp-primary); color: var(--cp-white); }
.cpxs.cpxs--mist .cpxs__go:hover, .cpxs.cpxs--mist .cpxs__go:focus { background: var(--cp-header-accent); color: var(--cp-white); }
.cpxs--mist .cpxs__go svg { color: var(--cp-accent); }

/* Header parts the field slides over (Search → Hide while open), and the page dim below the header */
.cpxs-hidden { transition: opacity .2s, transform .35s var(--cp-ease); }
.cpxs-hidden.is-cpxs-hidden { opacity: 0 !important; visibility: hidden !important; transform: translateX(-16px); transition: opacity .2s, transform .35s var(--cp-ease), visibility 0s .2s; }
.cpxs-scrim { position: fixed; top: var(--cpxs-top, 0px); right: 0; bottom: 0; left: 0; z-index: 9990; background: #1a2b4c40; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.cpxs-scrim.on { opacity: 1; visibility: visible; transition: opacity .3s, visibility 0s; }

@media (max-width: 767px) {
  .cpxs { --cpxs-h: 52px; }
  .cpxs--pill .cpxs__field { padding-left: 16px; }
  .cpxs--mist .cpxs__field { padding-left: 16px; border-radius: 16px; }
  .cpxs.cpxs--pill .cpxs__go, .cpxs.cpxs--mist .cpxs__go { padding: 0 16px; }
  .cpxs .cpxs__field input[type="search"], .cpxs.cpxs--mist .cpxs__field input[type="search"] { font-size: 16px; } /* 16px+ stops iPhone zooming in */
  .cpxs--mist .cpxs__go svg { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cpxs *, .cpxs-hidden, .cpxs-scrim { transition: none !important; } }
