/* =========================================================
   Layout Header Fix (layout-only, no colors)
   Datei: assets/css/tm-layout-header-fix.css
   Version: 1.0.4
   Zweck:
   - Mobile/Tablet: Header darf umbrechen + Höhe automatisch
   - Dropdowns dürfen nicht nach rechts aus dem Viewport laufen
   ========================================================= */

/* Dropdowns: immer nach links "einziehen" (rechte Kante am Button) */
.tm-topnav .tm-topnav-item{position:relative;}
.tm-topnav .tm-topnav-dropdown{
  left:auto !important;
  right:0 !important;
  transform:none !important;

  box-sizing:border-box;
  max-width:calc(100vw - 24px);
  max-height:70vh;
  overflow:auto;
}

/* Tablet/Handy: Header-Row darf umbrechen, damit nichts aus dem Bild läuft */
@media (max-width: 980px){
  .tm-header-inner{
    flex-wrap:wrap !important;
    align-items:flex-start !important;

    height:auto !important;
    max-height:none !important;
    min-height:0 !important;
  }

  /* Brand/Logo nimmt volle Breite – Text darf umbrechen */
  .tm-brand{
    flex:1 1 100% !important;
    width:100% !important;
    flex-wrap:wrap !important;
  }

  .tm-brand-locations{
    white-space:normal !important;
    overflow-wrap:anywhere;
    word-break:break-word;
    line-height:1.25;

    flex:1 1 240px;
    min-width:0;
  }

  /* Navigation in nächste Zeile (bei Bedarf) */
  .tm-topnav,
  nav.tm-topnav{
    flex:1 1 100% !important;
    width:100% !important;
    margin-left:0 !important;
    justify-content:flex-start !important;
  }

  .tm-topnav-list{
    flex-wrap:wrap !important;
    justify-content:flex-start !important;
  }
}

/* Sehr kleine Geräte: Dropdown viewport-breit, damit nichts abgeschnitten wird */
@media (max-width: 520px){
  .tm-topnav .tm-topnav-dropdown{
    left:12px !important;
    right:12px !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
  }
}
