/* =============================================================================
   Header wie Live (Elementor-Vorlage 916): Topbar + Menüleiste.
   Markup kommt aus der YOOtheme-Konfiguration (config/10-header.json):
     .tm-toolbar   = Topbar  (Social-Icons | Öffnungszeiten | Button)   – scrollt weg
     .tm-header    = Menüleiste (Logo | Menü bzw. Burger)                – sticky (uk-sticky)
     #tm-dialog    = Dropdown-Menü ≤ 1024 (Dialog «dropbar-top»)
   Breakpoints wie Elementor: ≤ 1024 Tablet (Burger), ≤ 767 Mobile.
   Schriftgrössen in rem → folgen html (17px, ≤ 921: 15.504px).
   ============================================================================= */

/* ------------------------------------------------------------------ Topbar -- */
.tm-toolbar {
    display: block !important;            /* YOOtheme blendet die Toolbar mobil aus – Live zeigt sie immer */
    padding: 0;
    background: #262a2b;
    color: #fff;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5em;
}
.tm-toolbar > .uk-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 65px;
    max-width: none;
    margin: 0;
    padding: 0;
}
/* Zwischenhüllen (links/rechts + uk-grid) auflösen: die drei Zellen werden direkte Flex-Kinder */
.tm-toolbar > .uk-container > div,
.tm-toolbar > .uk-container > div > [uk-grid] { display: contents; }
.tm-toolbar > .uk-container > div > [uk-grid] > div {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    position: relative;
    min-height: 1px;
    margin: 0 !important;                 /* uk-grid-margin / uk-margin-small-top */
    padding: 0;
}
.tm-toolbar > .uk-container > div > [uk-grid] > div > .uk-panel { width: 100%; }

/* Spaltenbreiten wie Live (Summe 99.665 %) */
.tm-toolbar > .uk-container > div:first-child > [uk-grid] > div { width: 33.333%; }                     /* Social */
.tm-toolbar > .uk-container > div:last-child > [uk-grid] > div:nth-child(1) { width: 46.332%; }         /* Öffnungszeiten */
.tm-toolbar > .uk-container > div:last-child > [uk-grid] > div:nth-child(2) { width: 20%; }             /* Button */

/* Social-Icons: Font Awesome 5 Brands wie Live (statt UIkit-SVG) */
.tm-toolbar ul.uk-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0;
    line-height: 1;
}
.tm-toolbar ul.uk-grid > li { margin: 0; padding: 0; }
.tm-toolbar ul.uk-grid > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44.8px;                        /* 14px + 2 × 1.1em */
    height: 44.8px;
    font-size: 14px;
    line-height: 14px;
    text-align: center;
    color: #fff;
    background-color: transparent;
    cursor: pointer;
    transition: all .3s;
}
.tm-toolbar ul.uk-grid > li > a:hover { background-color: #e8c204; color: #fff; opacity: .9; }
.tm-toolbar ul.uk-grid > li > a > .uk-icon,
.tm-toolbar ul.uk-grid > li > a > [uk-icon] {
    display: block;
    position: relative;
    width: 1em;
    height: 1em;
    font-family: "Font Awesome 5 Brands";
    font-size: 14px;
    font-style: normal;
    font-variant: normal;
    font-weight: 400;
    line-height: 1;
    color: #fff;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}
.tm-toolbar ul.uk-grid > li > a > [uk-icon] > svg { display: none; }
.tm-toolbar ul.uk-grid > li > a > [uk-icon]::before { position: absolute; left: 50%; transform: translateX(-50%); }
.tm-toolbar ul.uk-grid > li > a[href*="facebook"] > [uk-icon]::before { content: "\f39e"; }
.tm-toolbar ul.uk-grid > li > a[href*="instagram"] > [uk-icon]::before { content: "\f16d"; }

/* Öffnungszeiten */
.tm-toolbar #block-11 { text-align: right; color: #fff; }

/* Button «Jetzt reservieren» */
.tm-toolbar .widget_custom_html { text-align: right; }
.tm-toolbar .widget_custom_html .textwidget { margin: 0; }
.tm-toolbar .nb-header-button { fill: #fff; }

@media (max-width: 1024px) {
    .tm-toolbar { padding: 10px 20px; }
    .tm-toolbar > .uk-container { flex-wrap: wrap; }
    .tm-toolbar ul.uk-grid > li > a { width: 39.2px; height: 39.2px; }       /* 14px + 2 × 0.9em */
}
@media (max-width: 1024px) and (min-width: 768px) {
    .tm-toolbar > .uk-container > div:first-child > [uk-grid] > div { width: 70%; }
    .tm-toolbar > .uk-container > div:last-child > [uk-grid] > div:nth-child(1) { width: 30%; }
    .tm-toolbar > .uk-container > div:last-child > [uk-grid] > div:nth-child(2) { width: 30%; }
}
@media (max-width: 767px) {
    .tm-toolbar > .uk-container > div:first-child > [uk-grid] > div,
    .tm-toolbar > .uk-container > div:last-child > [uk-grid] > div:nth-child(1),
    .tm-toolbar > .uk-container > div:last-child > [uk-grid] > div:nth-child(2) { width: 100%; }
    .tm-toolbar ul.uk-grid { justify-content: center; }
}

/* -------------------------------------------------------------- Menüleiste -- */
.tm-header { position: relative; z-index: 9; }
.tm-header > [uk-sticky] { position: relative; z-index: 9; }
.tm-header .uk-sticky-placeholder { pointer-events: none; }
.tm-header .uk-navbar-container,
.tm-header .uk-navbar-container:not(.uk-navbar-transparent) {
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #d8d8d8;
    box-shadow: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    line-height: 1.5em;
}
.tm-header .uk-navbar-sticky { box-shadow: none; }
.tm-header .uk-navbar-container > .uk-container { display: block; max-width: none; margin: 0; padding: 0; }
.tm-header .uk-navbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    position: relative;
    gap: 0;
}
/* dritte, leere Spalte der Live-Vorlage (6.332 %; ≤ 767: bricht um, 1px hoch) */
.tm-header .uk-navbar::after { content: ""; display: block; order: 3; width: 6.332%; min-height: 1px; }

/* Spalte 1: Logo (Bild = 60 % der Spaltenbreite) */
.tm-header .uk-navbar-left {
    order: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    width: 20%;
    min-height: 1px;
    gap: 0;
}
.tm-header .uk-navbar-left > .uk-logo {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5em;
    text-align: left;
    color: inherit;
    transition: all .2s linear;
}
.tm-header .uk-navbar-left > .uk-logo > img {
    display: inline-block;
    width: 60%;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: none;
    border-radius: 0;
    box-shadow: none;
    aspect-ratio: auto;
    object-fit: fill;
}

/* Spalte 2: Menü (≥ 1025) */
.tm-header .uk-navbar-center,
.tm-header .uk-navbar-center:only-child,
.tm-header .uk-navbar-center:not(:only-child) {
    order: 2;
    position: static;
    transform: none;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    width: 73%;
    height: auto;
    min-height: 1px;
    margin: 0;
    gap: 0;
}
.tm-header .uk-navbar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 2;
    margin: 0 auto;                        /* schrumpft auf Inhaltsbreite, mittig wie Live */
    padding: 0;
    gap: 0;
    list-style: none;
    line-height: normal;
}
.tm-header .uk-navbar-nav > li { display: flex; position: relative; margin: 0; padding: 0; line-height: normal; }
.tm-header .uk-navbar-nav > li > a {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    min-height: 0;
    padding: 13px 20px;
    font-family: 'Roboto Slab', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
    white-space: nowrap;
    color: #262a2b;
    fill: #262a2b;
    background: none;
    transition: .4s;
}
.tm-header .uk-navbar-nav > li > a::before { display: none; }
.tm-header .uk-navbar-nav > li > a::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 3px;
    background-color: #e8c204;
    opacity: 0;
    transition: .3s;
    transition-timing-function: cubic-bezier(.58, .3, .005, 1);
}
.tm-header .uk-navbar-nav > li > a:hover,
.tm-header .uk-navbar-nav > li > a:focus,
.tm-header .uk-navbar-nav > li.uk-active > a,
.tm-header .uk-navbar-nav > li > a[aria-expanded="true"] { color: #e8c204; fill: #e8c204; }
.tm-header .uk-navbar-nav > li > a:hover::after,
.tm-header .uk-navbar-nav > li > a:focus::after,
.tm-header .uk-navbar-nav > li.uk-active > a::after { opacity: 1; }
.tm-header .uk-navbar-nav > li > a:focus { outline: 0; }

/* Spalte 2 ≤ 1024: Burger (eicons wie Live) */
.tm-header .uk-navbar-right { display: none; }
.tm-header .uk-navbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0 0 0 auto;
    padding: 5.5px;                        /* .25em von 22px */
    border: 0 solid;
    border-radius: 3px;
    background-color: transparent;
    color: #33373d;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 22px;
    line-height: 1.5rem;
    cursor: pointer;
    transition: all .2s linear;
}
.tm-header .uk-navbar-toggle:hover, .tm-header .uk-navbar-toggle:focus,
.tm-header .uk-navbar-toggle[aria-expanded="true"] { color: #33373d; outline: 0; }
.tm-header .uk-navbar-toggle > [uk-navbar-toggle-icon] {
    display: inline-block;
    width: auto;
    height: auto;
    font-family: eicons;
    font-size: inherit;
    font-style: normal;
    font-variant: normal;
    font-weight: 400;
    line-height: 1;
    color: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}
.tm-header .uk-navbar-toggle > [uk-navbar-toggle-icon] > svg { display: none; }
.tm-header .uk-navbar-toggle > [uk-navbar-toggle-icon]::before { content: "\e816"; }                  /* eicon-menu-bar */
.tm-header .uk-navbar-toggle[aria-expanded="true"] > [uk-navbar-toggle-icon]::before { content: "\e87f"; }   /* eicon-close */

/* Dropdown-Menü ≤ 1024 (UIkit-Drop; Position hier fest wie Live statt per JS) */
#tm-dialog { display: none; }
@keyframes nb-menu-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (max-width: 1024px) {
    .tm-header .uk-navbar-container:not(.uk-navbar-transparent) { padding: 40px 20px; }
    .tm-header .uk-navbar-center,
    .tm-header .uk-navbar-center:only-child,
    .tm-header .uk-navbar-center:not(:only-child) { display: none; }
    .tm-header .uk-navbar-right {
        order: 2;
        display: flex;
        flex-wrap: wrap;
        align-content: center;
        align-items: center;
        width: 73%;
        min-height: 1px;
        margin: 0;
        gap: 0;
    }

    #tm-dialog.uk-dropbar {
        position: absolute;
        top: 83px !important;              /* padding 40 + Burger 33 + margin-top 10 */
        left: 0 !important;
        right: auto !important;
        z-index: 9997;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: 100vh;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: hidden;
        background-color: #f9f9f9;
        box-shadow: none;
        color: #252827;
        font-size: 13px;
        transform-origin: top;
    }
    #tm-dialog.uk-dropbar.uk-open { display: block; }
    /* Aufklappen wie Live: von oben aufziehen (scaleY) statt UIkit-Einblenden */
    #tm-dialog.uk-dropbar[class*="uk-animation-"] {
        animation-name: nb-menu-in;
        animation-duration: .3s !important;
        animation-timing-function: ease;
    }
    #tm-dialog > div { display: block; min-height: 0; height: auto; }
    #tm-dialog > div > div { margin: 0; }
    #tm-dialog .uk-panel { margin: 0; padding: 0; }
    #tm-dialog .uk-nav { display: block; margin: 0; padding: 0; list-style: none; line-height: normal; }
    #tm-dialog .uk-nav > li { display: block; position: relative; margin: 0; padding: 0; line-height: normal; }
    #tm-dialog .uk-nav > li > a {
        display: flex;
        align-items: center;
        position: relative;
        padding: 10px 20px;
        font-family: 'Roboto Slab', sans-serif;
        font-size: 13px;
        font-weight: 400;
        line-height: 20px;
        letter-spacing: normal;
        text-transform: none;
        text-decoration: none;
        color: #33373d;
        background-color: transparent;
        transition: all .2s linear;
    }
    #tm-dialog .uk-nav > li > a:hover,
    #tm-dialog .uk-nav > li.uk-active > a { color: #fff; background-color: #e8c204; }
}
@media (max-width: 767px) {
    .tm-header .uk-navbar-container:not(.uk-navbar-transparent) { padding: 30px 20px; }
    .tm-header .uk-navbar { flex-wrap: wrap; }
    .tm-header .uk-navbar-left { width: 70%; }
    .tm-header .uk-navbar-right { width: 30%; }
    .tm-header .uk-navbar::after { width: 30%; }
    /* Oberkante = padding 30 + (Zeilenhöhe − 33)/2 + 33 + margin-top 44;
       Zeilenhöhe = max(33px, Logohöhe); Logohöhe = 0.6 × 0.7 × (Breite − 40px) × 245/1024 */
    #tm-dialog.uk-dropbar { top: calc(107px + (max(33px, (100vw - 40px) * 0.100488) - 33px) / 2) !important; }
}
