/* ==========================================================
   Heartlines Theme v1.6.22 – Mobile Stability / Responsive Audit
   Ziel: kein horizontales Wegziehen des Dokuments auf kleinen
   Viewports und sauberer Header auch auf schmalen Tablets.
   ========================================================== */

/* Root-Ebene: Die Seite selbst darf niemals horizontal scrollen.
   Interne Slider behalten ihre eigenen overflow-x-Regeln. */
@media (max-width: 1100px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  @supports (overflow: clip) {
    html,
    body {
      overflow-x: clip !important;
    }
  }

  body {
    position: relative !important;
  }

  main,
  .site-main,
  .wrap,
  .heartlines-home,
  .advisor-detail-template,
  .hla-shell,
  .hlchat-shell,
  .hlaudio-shell,
  .hlvideo-shell,
  .hle-shell,
  .hlcb-shell,
  .woocommerce,
  .woocommerce-page {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  img,
  video,
  iframe,
  canvas,
  svg {
    max-width: 100%;
  }
}

/* 921–1100 px war bislang eine problematische Zwischenzone:
   Desktop-Menü war schon aktiv, hatte aber nicht genug Platz.
   Dort verwenden wir bewusst den stabilen mobilen 3-Spalten-Header. */
@media (min-width: 921px) and (max-width: 1100px) {
  .hl-core-header .wrap.nav {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    align-items: center !important;
    gap: 10px !important;
    height: 74px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .hl-core-header .menu,
  .hl-core-header .nav-right {
    display: none !important;
  }

  .hl-core-header .burger {
    display: inline-flex !important;
    grid-column: 1 !important;
    justify-self: start !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .hl-core-header .logo {
    grid-column: 2 !important;
    justify-self: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .hl-core-header .logo img {
    display: block !important;
    width: auto !important;
    height: 40px !important;
    max-width: min(180px, 46vw) !important;
  }

  .hl-v121-mobile-account-shortcut {
    display: inline-flex !important;
    position: static !important;
    grid-column: 3 !important;
    justify-self: end !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
  }

  body.single-hl_herzleser .hl-core-header .menu {
    display: none !important;
  }

  body.single-hl_herzleser .hl-core-header .burger {
    display: inline-flex !important;
  }

  body.single-hl_herzleser .hl-core-header .nav-right {
    display: none !important;
  }
}

/* Detailseiten: alle äußeren Layoutcontainer strikt im Viewport halten.
   Nur explizite Slider dürfen intern horizontal scrollen. */
@media (max-width: 920px) {
  body.single-hl_herzleser .advisor-detail-template {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
  }

  body.single-hl_herzleser .advisor-detail-template .layout,
  body.single-hl_herzleser .advisor-detail-template .col-main,
  body.single-hl_herzleser .advisor-detail-template .col-side,
  body.single-hl_herzleser .advisor-detail-template .d-hero,
  body.single-hl_herzleser .advisor-detail-template .hl-v12-profile-hero,
  body.single-hl_herzleser .advisor-detail-template .hero-info,
  body.single-hl_herzleser .advisor-detail-template .hero-cta,
  body.single-hl_herzleser .advisor-detail-template .tabs-wrap,
  body.single-hl_herzleser .advisor-detail-template .sec,
  body.single-hl_herzleser .advisor-detail-template .scard,
  body.single-hl_herzleser .advisor-detail-template .serv-grid,
  body.single-hl_herzleser .advisor-detail-template .serv,
  body.single-hl_herzleser .advisor-detail-template .avail-card,
  body.single-hl_herzleser .advisor-detail-template .quote {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.single-hl_herzleser .advisor-detail-template .hero-name,
  body.single-hl_herzleser .advisor-detail-template .rating-row,
  body.single-hl_herzleser .advisor-detail-template .hl-v1617-languages {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.single-hl_herzleser .advisor-detail-template .hero-name h1,
  body.single-hl_herzleser .advisor-detail-template .hero-desc,
  body.single-hl_herzleser .advisor-detail-template p,
  body.single-hl_herzleser .advisor-detail-template a,
  body.single-hl_herzleser .advisor-detail-template span {
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  /* Pfeile bleiben sichtbar, erzeugen aber keine Dokumentbreite. */
  body.single-hl_herzleser .rev-arrow.l {
    left: 4px !important;
  }

  body.single-hl_herzleser .rev-arrow.r {
    right: 4px !important;
  }
}

/* Sehr kleine Geräte: etwas mehr Sicherheitsabstand am Rand. */
@media (max-width: 390px) {
  body.single-hl_herzleser .advisor-detail-template {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
  }

  .wrap {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
