/*
 * CEIBAG Responsive Guard 1.4.3
 * Final polish for service-branch pages, logged-in mobile navbar, social/contact blocks.
 * It is intentionally appended after the previous layers.
 */

@media (max-width: 767px) {
  html, body {
    overflow-x: clip !important;
    max-width: 100% !important;
  }

  body.logged-in.ceibag-rg-mobile-fixed-client-header {
    padding-top: 78px !important;
  }

  /* Keep the logged-in header as a real bar. The controls must not float over the page. */
  body.logged-in .elementor-element-10050ee3.ceibag-client-header,
  body.logged-in [data-id="10050ee3"].ceibag-client-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 78px !important;
    min-height: 78px !important;
    padding: 10px 18px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(180deg, rgba(30,43,25,.98), rgba(0,0,0,.86)) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.38) !important;
    overflow: visible !important;
    transform: none !important;
    z-index: 2147482000 !important;
  }

  body.logged-in .elementor-element-10050ee3 .elementor-element-4adbb70,
  body.logged-in [data-id="10050ee3"] [data-id="4adbb70"] {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    overflow: visible !important;
  }

  body.logged-in .elementor-element-10050ee3 .elementor-element-793dce27,
  body.logged-in .elementor-element-10050ee3 .elementor-element-22adf2b6,
  body.logged-in [data-id="10050ee3"] [data-id="793dce27"],
  body.logged-in [data-id="10050ee3"] [data-id="22adf2b6"] {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: auto !important;
    max-width: max-content !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    translate: none !important;
  }
  body.logged-in .elementor-element-10050ee3 .elementor-element-793dce27 { order: 1 !important; }
  body.logged-in .elementor-element-10050ee3 .elementor-element-22adf2b6 { order: 2 !important; margin-left: auto !important; }

  /* Service-branch / specialist pages: stop every CTA from floating over unrelated cards. */
  body.ceibag-rg-branch-page :is(
    .elementor-widget-button,
    .elementor-widget-icon_button_widget
  ):not(.elementor-element-2c2a2ff2):not(.elementor-element-793dce27):not(.elementor-element-5104ff4c) {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    translate: none !important;
    margin: 16px auto !important;
    width: auto !important;
    max-width: min(100%, 330px) !important;
    z-index: 2 !important;
  }

  body.ceibag-rg-branch-page :is(.elementor-widget-button, .elementor-widget-icon_button_widget) :is(a, button, .elementor-button) {
    width: auto !important;
    max-width: min(100%, 330px) !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.18 !important;
    text-align: center !important;
    padding: 12px 18px !important;
  }

  /* Specific floating buttons exported from the Elementor package. */
  body.ceibag-rg-branch-page :is(
    .elementor-element-509ba93,
    .elementor-element-13a9d31b,
    .elementor-element-47c15687,
    .elementor-element-4b22dd6f,
    .elementor-element-2669d1ac,
    [data-id="509ba93"],
    [data-id="13a9d31b"],
    [data-id="47c15687"],
    [data-id="4b22dd6f"],
    [data-id="2669d1ac"]
  ) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    translate: none !important;
    margin: 18px auto !important;
    width: auto !important;
    max-width: 330px !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    z-index: 3 !important;
  }

  /* Jennifer/specialist block: make the portrait, phone, email and social icons stack cleanly. */
  body.ceibag-rg-branch-page :is(
    .elementor-element-429b501d,
    .elementor-element-20e6f1ed,
    .elementor-element-8d818b3,
    .elementor-element-3a7d3dda,
    .elementor-element-6ff9db01,
    .elementor-element-62178abf,
    .elementor-element-21ec3105,
    [data-id="429b501d"],
    [data-id="20e6f1ed"],
    [data-id="8d818b3"],
    [data-id="3a7d3dda"],
    [data-id="6ff9db01"],
    [data-id="62178abf"],
    [data-id="21ec3105"]
  ) {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    transform: none !important;
    translate: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: visible !important;
  }

  body.ceibag-rg-branch-page .elementor-widget-image img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }

  body.ceibag-rg-branch-page :is(.elementor-heading-title, h1, h2, h3, h4) {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  body.ceibag-rg-branch-page :is(.elementor-widget-heading, .elementor-widget-text-editor) {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
  }

  body.ceibag-rg-branch-page .elementor-widget-text-editor,
  body.ceibag-rg-branch-page .elementor-widget-text-editor * {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  /* Contact phones and emails need a single readable line when possible and wrap only at safe points. */
  body.ceibag-rg-branch-page :is(a[href^="tel:"], a[href^="mailto:"], .elementor-icon-list-text, .elementor-heading-title) {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }

  /* Phone icons must not cover names/emails or pictures. */
  body.ceibag-rg-branch-page :is(.elementor-widget-icon, .elementor-icon-wrapper) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    translate: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    z-index: 2 !important;
  }
  body.ceibag-rg-branch-page .elementor-widget-icon .elementor-icon {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    margin: 14px auto !important;
    font-size: 28px !important;
  }

  /* Social icons: two neat rows at most, centered under the person/card. */
  body.ceibag-rg-branch-page :is(.elementor-widget-social-icons, .elementor-element-3dd4fa15, [data-id="3dd4fa15"]) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    translate: none !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 22px auto !important;
    padding: 0 !important;
    z-index: 2 !important;
  }
  body.ceibag-rg-branch-page :is(.elementor-social-icons-wrapper, .elementor-grid) {
    width: 100% !important;
    max-width: 320px !important;
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }
  body.ceibag-rg-branch-page .elementor-social-icon {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 23px !important;
    transform: none !important;
  }

  /* Keep decorative Lottie/SVG objects behind copy; hide the ones that repeatedly cover text on mobile. */
  body.ceibag-rg-branch-page :is(
    .elementor-widget-lottie,
    .elementor-widget-jbafe_lottie_animation,
    .elementor-widget-image[class*="shape"],
    .elementor-element-755121d,
    .elementor-element-792aa52f,
    .elementor-element-3b3ac502,
    .elementor-element-56b2e180,
    .elementor-element-25acb71e
  ) {
    max-width: 100% !important;
    pointer-events: none !important;
    z-index: 0 !important;
  }

  /* Cards and sections should not introduce giant gaps or off-canvas boxes. */
  body.ceibag-rg-branch-page :is(.e-con, .elementor-section, .elementor-container) {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: clip !important;
  }
  body.ceibag-rg-branch-page .e-con > .elementor-element,
  body.ceibag-rg-branch-page .elementor-section .elementor-column {
    min-width: 0 !important;
  }
}

@media (min-width: 768px) and (max-width: 1366px) {
  /* The 1366x720 laptop view should keep content in the natural grid and avoid huge overlay buttons. */
  body.ceibag-rg-branch-page :is(.elementor-element-509ba93, [data-id="509ba93"]) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    margin: 16px auto !important;
    max-width: 360px !important;
    align-self: center !important;
  }

  body.ceibag-rg-branch-page :is(.elementor-widget-social-icons, .elementor-element-3dd4fa15, [data-id="3dd4fa15"]) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 520px !important;
    margin: 24px auto !important;
  }
  body.ceibag-rg-branch-page :is(.elementor-social-icons-wrapper, .elementor-grid) {
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 16px !important;
  }
}
