/* ==========================================================================
   layout.css: Header, Navigation, Mobile-Drawer, Footer
   ========================================================================== */

/* ---------- Header ---------- */
.tb-header {
    position: sticky;
    top: 0;
    z-index: 500;
    background: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: padding 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.tb-header.is-scrolled {
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.tb-header__inner {
    width: var(--container);
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 18px 0;
    min-height: var(--header-h);
}

.tb-header.is-scrolled .tb-header__inner {
    padding: 11px 0;
    min-height: 64px;
}

.tb-header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: auto;
}

.tb-header__logo-pill {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    padding: 7px 12px;
    border-radius: var(--radius);
}

.tb-header__logo-pill img,
.tb-header__logo-pill .custom-logo {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

.tb-header.is-scrolled .tb-header__logo-pill img,
.tb-header.is-scrolled .tb-header__logo-pill .custom-logo {
    height: 32px;
}

.tb-header__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-on-dark);
    letter-spacing: -0.01em;
}

/* ---------- Desktop-Nav ---------- */
.tb-nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.tb-nav__list a {
    display: inline-block;
    color: var(--text-on-dark-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: var(--radius);
    transition: color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.tb-nav__list a:hover,
.tb-nav__list a:focus-visible {
    color: var(--text-on-dark);
    background: rgba(255,255,255,0.08);
}

.tb-nav__list li.current-menu-item > a {
    color: var(--accent);
}

/* Dropdown fuer hierarchische Menues */
.tb-nav__list ul {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    background: var(--surface);
    box-shadow: 0 16px 40px rgba(0,0,0,0.18);
    border-radius: var(--radius);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 180ms;
}

.tb-nav__list li {
    position: relative;
}

.tb-nav__list li:hover > ul,
.tb-nav__list li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tb-nav__list ul a {
    color: var(--text);
    display: block;
}

.tb-nav__list ul a:hover {
    background: var(--bg);
    color: var(--accent-dark);
}

/* ---------- Header-Actions ---------- */
.tb-header__actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.tb-header__phone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-on-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
}

.tb-header__phone .icon { color: var(--accent); }

/* ---------- Burger ---------- */
.tb-burger {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-on-dark);
}

.tb-burger__icon-open,
.tb-burger__icon-close {
    position: absolute;
    width: 26px;
    height: 26px;
    transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.tb-burger__icon-close {
    opacity: 0;
    transform: scale(0.7) rotate(-45deg);
}

.tb-burger[aria-expanded="true"] .tb-burger__icon-open {
    opacity: 0;
    transform: scale(0.7) rotate(45deg);
}

.tb-burger[aria-expanded="true"] .tb-burger__icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ---------- Mobile-Drawer ----------
   Liegt als direktes Kind von <body>, NICHT im <header>, damit der sticky
   Header keinen eigenen Stacking-Context darueber aufspannen kann. Startet
   unterhalb des Headers (top: var(--header-h)), nicht bei top:0. */
.tb-drawer {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    z-index: 600;
    visibility: hidden;
    pointer-events: none;
}

.tb-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.tb-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,11,13,0.55);
    opacity: 0;
    transition: opacity 220ms var(--ease-out);
}

.tb-drawer.is-open .tb-drawer__overlay {
    opacity: 1;
}

.tb-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(360px, 86vw);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    transform: translateX(100%);
    transition: transform 280ms var(--ease-out);
    overflow-y: auto;
}

.tb-drawer.is-open .tb-drawer__panel {
    transform: translateX(0);
}

.tb-drawer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.tb-drawer__list a {
    display: block;
    color: var(--text-on-dark);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 44px;
}

.tb-drawer__list ul {
    list-style: none;
    padding-left: 14px;
}

.tb-drawer__list ul a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-on-dark-muted);
    border-bottom: none;
}

.tb-drawer__footer {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tb-drawer__phone {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-on-dark);
    text-decoration: none;
    font-weight: 600;
}

.tb-drawer__phone .icon { color: var(--accent); }

/* ---------- Footer ---------- */
.tb-footer {
    background: var(--primary);
    color: var(--text-on-dark-muted);
    margin-top: 0;
}

.tb-footer__top {
    width: var(--container);
    margin-inline: auto;
    padding: 72px 0 48px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
}

.tb-footer__brand { display: flex; flex-direction: column; gap: 14px; }
.tb-footer__logo { height: 32px; width: auto; filter: brightness(0) invert(1); opacity: 0.92; }
.tb-footer__claim { font-family: var(--font-display); font-weight: 600; color: var(--text-on-dark); font-size: 1.05rem; max-width: 24ch; }

.tb-footer__col h2 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-on-dark);
    margin-bottom: 1em;
}

.tb-footer__list,
.tb-contact-lines {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tb-footer__list a {
    color: var(--text-on-dark-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.tb-footer__list a:hover { color: var(--accent); }

.tb-contact-lines li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tb-contact-lines .icon { color: var(--accent); flex-shrink: 0; }
.tb-contact-lines a { color: var(--text-on-dark-muted); text-decoration: none; }
.tb-contact-lines a:hover { color: var(--accent); }

.tb-footer__consent-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--text-on-dark-muted);
    font-size: 0.85rem;
    text-decoration: underline;
}

.tb-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
}

.tb-footer__bottom p {
    width: var(--container);
    margin-inline: auto;
    font-size: 0.82rem;
    color: var(--text-on-dark-muted);
    max-width: none;
}

/* ---------- Breadcrumb ---------- */
.tb-breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0 0 1.2em;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tb-breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 6px;
    opacity: 0.5;
}

.tb-breadcrumb a { color: var(--text-muted); }
