/*! website-chat@1.0.0 classic.css sha256:101c5480e52d95e1835d16029f22fd578ece907191010e394cf2f30d39963f70 */
/*
 * Classic layout for the shared website chat loader.
 *
 * Every selector is scoped to Classic's own root or chat shells, and every
 * layout rule waits for `data-website-chat-layout`, which the loader sets only
 * while an allowed mount is active. Values come from the loader's
 * `--website-chat-*` custom properties. Without the attribute or variables,
 * Classic keeps its vendor defaults.
 *
 * Breakpoints use `min-width`/`max-width` for older browsers than Safari 16.4,
 * which introduced range syntax (width >= px). Their complements are the
 * Media Queries Level 3 form, `not all and (min-width: 768px)` and
 * `not all and (max-width: 428px)`, instead of a `767.98px`-style epsilon. A
 * complement covers every fractional layout width the browser can report, so
 * 767.5 px stays on the wide-phone side of 768 px and 428.5 px stays above the
 * phone sheet with no gap at either cutoff.
 */

/* An inert or suspended mount hides Classic and both chat shells. */
html[data-website-chat="hidden"] #arcontactus.arcu-message,
html[data-website-chat="hidden"] #anw-container,
html[data-website-chat="hidden"] #anw-chatbox-container {
  display: none !important;
}

/* The launcher root is the anchor for every Classic surface. */
html[data-website-chat-layout] #arcontactus.arcu-message {
  bottom: calc(
    var(--website-chat-root-bottom, 20px) +
      var(--website-chat-keyboard-inset, 0px)
  ) !important;
}

/* Phone chat shell above the bar reserve. */
html[data-website-chat-layout="mobile"] #anw-chatbox-container {
  bottom: calc(
    var(--website-chat-chat-bottom, 20px) +
      var(--website-chat-keyboard-inset, 0px)
  ) !important;
  max-height: var(--website-chat-chat-max, 600px) !important;
}

/*
 * Between the 428 px phone sheet and Classic's 768 px desktop-style form, the
 * callback panel stays inside the launcher. Its relative bottom is the reserve
 * that remains below the actual launcher, so the bar clearance is never counted
 * twice. One complement per bound keeps every fractional width in range.
 */
@media not all and (max-width: 428px) {
  @media not all and (min-width: 768px) {
    html[data-website-chat-layout="mobile"]
      #arcontactus.arcu-message
      .arcu-forms-container.active {
      position: absolute !important;
      top: auto !important;
      bottom: var(--website-chat-panel-relative, 0px) !important;
      max-height: var(--website-chat-callback-max, 400px) !important;
      overflow-y: auto !important;
      overscroll-behavior: contain;
    }
  }
}

/*
 * The phone callback sheet keeps the viewport as its containing block up to
 * 428 px. Its bottom includes the keyboard inset, while the max-height is
 * measured against the unzoomed visual viewport.
 */
@media (max-width: 428px) {
  html[data-website-chat-layout="mobile"]
    #arcontactus.arcu-message
    .arcu-forms-container.active {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(
      var(--website-chat-phone-bottom, 80px) +
        var(--website-chat-keyboard-inset, 0px)
    ) !important;
    max-height: var(--website-chat-callback-max, 400px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
}

/*
 * At the phone-sheet cutoff Classic fixes its menu and popup to the viewport.
 * When a measured bar is present, lift those proven vendor surfaces too. Wider
 * layouts and the direct landscape menu keep their vendor positioning.
 */
@media (max-width: 428px) {
  html[data-website-chat-layout="mobile"][data-website-chat-bar]
    #arcontactus.arcu-message
    :is(.messangers-block, .arcu-popup) {
    bottom: calc(
      var(--website-chat-clearance, 0px) +
        var(--website-chat-keyboard-inset, 0px)
    ) !important;
    max-height: calc(
      var(--website-chat-viewport-height, 100dvh) -
        var(--website-chat-clearance, 0px)
    ) !important;
  }
}

/*
 * Between 429 and 767 px Classic's open menu keeps the vendor's 24 px shell,
 * while its 54 px rows overflow a box that can sit under the raised CTA and
 * intercept or hide the actions. Size the open menu from its content instead,
 * anchor it 10 px above the launcher's applied root bottom, and let the menu be
 * the one scroll owner in the room that remains above the bar. From 768 px the
 * desktop-style form's own menu keeps its vendor positioning.
 *
 * Classic's static action list keeps `height: 0` with visible rows, so the
 * shell stays 24 px and neither a wheel nor `scrollIntoView` can reach the
 * actions. Restore the list's own content height so the shell can size from it.
 * `flex: none` keeps the list from shrinking again under the menu's capped
 * height when Classic lays the shell out as a flex column; the list stays
 * content, not a second scroll owner.
 */
@media not all and (max-width: 428px) {
  @media not all and (min-width: 768px) {
    html[data-website-chat-layout="mobile"]
      #arcontactus.arcu-message
      .messangers-block.arcu-show {
      position: absolute !important;
      top: auto !important;
      bottom: calc(100% + 10px) !important;
      height: auto !important;
      max-height: max(
        0px,
        calc(
          var(--website-chat-viewport-height, 100dvh) -
            var(--website-chat-root-bottom, 20px) - 100% - 10px
        )
      ) !important;
      overflow-y: auto !important;
      overscroll-behavior: contain;
    }

    html[data-website-chat-layout="mobile"]
      #arcontactus.arcu-message
      .messangers-block.arcu-show
      .messangers-list {
      height: auto !important;
      max-height: none !important;
      flex: none;
    }
  }
}

/*
 * Below Classic's 768 px desktop-style form the phone/wide-phone panel itself
 * scrolls, so its direct-child close control stays reachable at the top while
 * the fields move underneath it. From 768 px the desktop rules keep Close
 * outside the scrolling body instead.
 */
@media not all and (min-width: 768px) {
  html[data-website-chat-layout="mobile"]
    #arcontactus.arcu-message
    .arcu-forms-container.active
    > .arcu-form-close {
    position: sticky !important;
    top: 0 !important;
    right: auto !important;
    margin-left: auto;
    z-index: 1;
    transition: none;
  }
}

/*
 * Classic's desktop-style form starts at 768 px, not at the site's own mobile
 * cutoff. Cap and scroll the form body on every layout state so the outer Close
 * keeps its place and the form never extends past the viewport or a visible
 * CTA. The cap subtracts whatever the applied root bottom holds above the
 * standard 20 px baseline, which already includes any measured CTA clearance.
 */
@media (min-width: 768px) {
  html[data-website-chat-layout]
    #arcontactus.arcu-message
    .arcu-forms-container
    .arcu-form-body {
    max-height: max(
      12rem,
      calc(
        var(--website-chat-viewport-height, 100dvh) - 22rem -
          var(--website-chat-desktop-extra, 0px)
      )
    ) !important;
    overflow-y: auto !important;
  }
}

/* On a short window at 768 px or more the inner wrapper scrolls, Close outside. */
@media (min-width: 768px) and (max-height: 600px) {
  html[data-website-chat-layout]
    #arcontactus.arcu-message
    .arcu-forms-container
    .arcu-form-container {
    max-height: calc(
      var(--website-chat-viewport-height, 100dvh) - 9.5rem -
        var(--website-chat-desktop-extra, 0px)
    ) !important;
    overflow-y: auto !important;
  }

  html[data-website-chat-layout]
    #arcontactus.arcu-message
    .arcu-forms-container
    .arcu-form-body {
    max-height: none !important;
    overflow-y: visible !important;
  }
}
