/*
 * BCM V8.4.1 – Mobile Layout Guard
 * Ausschließlich für bestehende Mobile-/Tablet-Darstellung bis 900px.
 * Desktop ab 901px bleibt vollständig unverändert.
 */
@media (max-width:900px){
  html,
  body{
    width:100%;
    max-width:100%;
    overflow-x:hidden!important;
    overscroll-behavior-x:none;
  }

  body{
    position:relative;
  }

  /* Allgemeiner Schutz: Medien/Formulare dürfen den Viewport nicht verbreitern. */
  img,
  video,
  iframe,
  canvas,
  svg,
  input,
  select,
  textarea,
  button{
    max-width:100%;
  }

  .site-header{
    width:100%;
    max-width:100%;
    overflow:visible;
  }

  /* Mobile Headerzeile: feste Bedienelemente rechts, flexible Wortmarke links. */
  .site-header .container.header-inner{
    width:calc(100% - 20px)!important;
    max-width:none!important;
    min-width:0!important;
    height:70px!important;
    padding:0!important;
    gap:6px!important;
    display:flex!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
  }

  .site-header .header-inner > .bcm-header-wordmark{
    order:0!important;
    flex:1 1 auto!important;
    min-width:0!important;
    width:auto!important;
    max-width:none!important;
    transform:none!important;
    overflow:hidden;
  }

  .bcm-header-wordmark-main{
    max-width:100%!important;
    font-size:clamp(17px,3.2vw,24px)!important;
    gap:7px!important;
    white-space:nowrap!important;
  }

  .bcm-header-wordmark-yachtsales{
    letter-spacing:2.4px!important;
  }

  .bcm-header-wordmark-sub,
  .bcm-header-wordmark-est{
    max-width:100%!important;
    font-size:6.5px!important;
    letter-spacing:1.45px!important;
    white-space:nowrap!important;
  }

  .bcm-header-wordmark-line{
    width:100%!important;
  }

  /* Rechte Header-Bedienelemente dürfen niemals aus dem Bildschirm gedrückt werden. */
  .bcm-weglot-header{
    order:1!important;
    flex:0 0 auto!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:0!important;
  }

  .bcm-wishlist-header{
    order:2!important;
    flex:0 0 auto!important;
    margin-left:2px!important;
  }

  .menu-toggle{
    order:3!important;
    display:block!important;
    flex:0 0 42px!important;
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    margin-left:0!important;
    padding:8px!important;
    position:relative!important;
    z-index:65!important;
  }

  .menu-toggle span{
    width:24px!important;
    max-width:none!important;
  }

  /* Dropdown immer innerhalb der Bildschirmbreite. */
  .primary-nav{
    box-sizing:border-box!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  .site-header.menu-open .primary-nav{
    display:block!important;
  }

  .primary-nav .menu,
  .primary-nav .sub-menu,
  .primary-nav .menu > li,
  .primary-nav .menu a{
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  .primary-nav .menu a{
    overflow-wrap:anywhere;
  }

  /* Normale Seiteninhalte dürfen keinen horizontalen Seiten-Scroll erzeugen. */
  main,
  .site-footer,
  .bcm-editable-page,
  .wp-site-blocks{
    max-width:100%;
  }

  pre,
  table{
    max-width:100%;
  }
}

/* Echte Smartphone-Breite: etwas kompakter, ohne Inhalte im Header auszublenden. */
@media (max-width:620px){
  .site-header .container.header-inner{
    width:calc(100% - 16px)!important;
    gap:4px!important;
  }

  .site-header .header-inner > .bcm-header-wordmark{
    max-width:calc(100% - 142px)!important;
  }

  .bcm-header-wordmark-main{
    font-size:clamp(15px,5vw,20px)!important;
    gap:5px!important;
  }

  .bcm-header-wordmark-yachtsales{
    letter-spacing:1.7px!important;
  }

  .bcm-header-wordmark-sub,
  .bcm-header-wordmark-est{
    font-size:5.6px!important;
    letter-spacing:1.05px!important;
  }

  .bcm-header-wordmark-sub{margin-top:3px!important}
  .bcm-header-wordmark-line{margin:4px 0 3px!important}

  .bcm-weglot-header{
    margin-left:auto!important;
    min-height:34px!important;
  }

  .bcm-wishlist-header{
    min-width:40px!important;
    min-height:34px!important;
    padding:0 4px!important;
    gap:3px!important;
  }

  .bcm-wishlist-heart{font-size:18px!important}
  .bcm-wishlist-count{min-width:17px!important;width:17px!important;height:17px!important;padding:0!important;font-size:9px!important}

  .menu-toggle{
    flex-basis:40px!important;
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    padding:7px!important;
  }

  .primary-nav{
    top:70px!important;
    max-height:calc(100dvh - 70px)!important;
  }
}

@media (max-width:390px){
  .site-header .header-inner > .bcm-header-wordmark{
    max-width:calc(100% - 134px)!important;
  }

  .bcm-header-wordmark-main{
    font-size:14px!important;
    gap:4px!important;
  }

  .bcm-header-wordmark-yachtsales{letter-spacing:1.25px!important}
  .bcm-header-wordmark-sub,
  .bcm-header-wordmark-est{font-size:5px!important;letter-spacing:.75px!important}

  .bcm-wishlist-header{
    min-width:37px!important;
    width:37px!important;
    padding:0 2px!important;
  }

  .menu-toggle{
    flex-basis:38px!important;
    width:38px!important;
    min-width:38px!important;
  }
}
