/* =========================================================
   IMMFIMA Navigation V4
   Vollständig isoliert durch ifm4-Präfix
========================================================= */

:root {
    --ifm4-blue: #0b4d78;
    --ifm4-blue-dark: #073653;
    --ifm4-gold: #d4a12a;
    --ifm4-gold-dark: #ae7b10;
    --ifm4-text: #172338;
    --ifm4-muted: #657086;
    --ifm4-line: #dce4ee;
    --ifm4-surface: #ffffff;
    --ifm4-shadow: 0 24px 64px rgba(20, 42, 70, 0.16);
}

.ifm4-header,
.ifm4-header *,
.ifm4-header *::before,
.ifm4-header *::after,
.ifm4-drawer,
.ifm4-drawer *,
.ifm4-drawer *::before,
.ifm4-drawer *::after,
.ifm4-backdrop {
    box-sizing: border-box;
}

.ifm4-header {
    position: sticky;
    top: 10px;
    z-index: 1200;
    width: calc(100% - 28px);
    margin: 10px auto 0;
    border: 1px solid var(--ifm4-line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 8px 26px rgba(20, 42, 70, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ifm4-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: min(1540px, calc(100% - 36px));
    min-height: 104px;
    margin-inline: auto;
    padding: 12px 0;
}

.ifm4-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 16px;
    min-width: max-content;
    color: var(--ifm4-text);
    text-decoration: none;
}

.ifm4-brand__logo {
    display: block;
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    object-fit: cover;
    border-radius: 18px;
}

.ifm4-brand__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.ifm4-brand__text strong {
    margin: 0;
    color: #14243b;
    font-size: 1.55rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.09em;
    white-space: nowrap;
}

.ifm4-brand__text small {
    margin: 0;
    color: #394a60;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
}

.ifm4-desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    gap: 4px;
    min-width: 0;
    margin-left: auto;
}

.ifm4-desktop-nav > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--ifm4-text);
    background: transparent;
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.ifm4-desktop-nav > a:not(.ifm4-desktop-nav__appointment):hover,
.ifm4-desktop-nav > a:not(.ifm4-desktop-nav__appointment):focus-visible,
.ifm4-desktop-nav > a:not(.ifm4-desktop-nav__appointment).is-active {
    color: var(--ifm4-blue);
    background: #eef5f9;
    border-color: #cfdee9;
}

.ifm4-desktop-nav__appointment {
    gap: 8px;
    min-height: 48px !important;
    margin-left: 8px;
    padding: 11px 20px !important;
    border-color: var(--ifm4-gold-dark) !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--ifm4-gold), var(--ifm4-gold-dark)) !important;
    box-shadow: 0 8px 20px rgba(174, 123, 16, 0.24);
    font-weight: 800 !important;
}

.ifm4-toggle {
    display: none;
}

/* Backdrop und Drawer sind standardmäßig wirklich unsichtbar */
.ifm4-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    visibility: hidden;
    background: rgba(4, 17, 32, 0.48);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 220ms ease,
        visibility 220ms ease;
}

.ifm4-backdrop.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.ifm4-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    width: min(430px, 100%);
    height: 100dvh;
    overflow-y: auto;
    padding: 24px;
    border-left: 1px solid var(--ifm4-line);
    background: rgba(255, 255, 255, 0.985);
    box-shadow: -24px 0 64px rgba(7, 42, 79, 0.20);
    transform: translateX(102%);
    visibility: hidden;
    pointer-events: none;
    transition:
        transform 260ms ease,
        visibility 260ms ease;
}

.ifm4-drawer.is-open {
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.ifm4-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ifm4-line);
}

.ifm4-drawer__eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--ifm4-gold-dark);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ifm4-drawer__head h2 {
    margin: 0;
    color: var(--ifm4-blue-dark);
    font-size: 1.55rem;
    line-height: 1.15;
}

.ifm4-drawer__close {
    position: relative;
    display: inline-grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border: 1px solid var(--ifm4-line);
    border-radius: 14px;
    color: var(--ifm4-blue);
    background: #fff;
    cursor: pointer;
}

.ifm4-drawer__close span {
    position: absolute;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}

.ifm4-drawer__close span:first-child {
    transform: rotate(45deg);
}

.ifm4-drawer__close span:last-child {
    transform: rotate(-45deg);
}

.ifm4-drawer__nav {
    display: grid;
    gap: 6px;
    padding: 20px 0;
}

.ifm4-drawer__nav > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--ifm4-text);
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    transition:
        transform 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease;
}

.ifm4-drawer__nav > a:hover,
.ifm4-drawer__nav > a:focus-visible,
.ifm4-drawer__nav > a.is-active {
    border-color: rgba(212, 161, 42, 0.32);
    background: rgba(212, 161, 42, 0.10);
    transform: translateX(2px);
}

.ifm4-drawer__nav > a span:last-child {
    color: var(--ifm4-gold-dark);
    font-size: 1.1rem;
}

.ifm4-drawer__footer {
    display: grid;
    gap: 16px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--ifm4-line);
}

.ifm4-drawer__appointment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 56px;
    padding: 13px 18px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--ifm4-gold), var(--ifm4-gold-dark));
    box-shadow: 0 10px 24px rgba(174, 123, 16, 0.24);
    font-size: 1.03rem;
    font-weight: 850;
    text-decoration: none;
}

.ifm4-drawer__contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ifm4-drawer__contact-grid > a {
    display: grid;
    min-height: 106px;
    place-items: center;
    gap: 3px;
    padding: 12px 8px;
    border: 1px solid var(--ifm4-line);
    border-radius: 15px;
    color: var(--ifm4-text);
    background: #fff;
    text-align: center;
    text-decoration: none;
}

.ifm4-drawer__contact-grid > a > span {
    font-size: 1.3rem;
}

.ifm4-drawer__contact-grid strong {
    font-size: 0.84rem;
}

.ifm4-drawer__contact-grid small {
    color: var(--ifm4-muted);
    font-size: 0.69rem;
    line-height: 1.25;
}

.ifm4-drawer__meta {
    display: flex;
    justify-content: center;
    gap: 18px;
}

.ifm4-drawer__meta a {
    color: var(--ifm4-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

body.ifm4-menu-open {
    overflow: hidden;
}

/* =========================================================
   Breakpoint
========================================================= */

@media (max-width: 1320px) {
    .ifm4-desktop-nav {
        display: none;
    }

    .ifm4-toggle {
        display: inline-grid;
        width: 56px;
        height: 56px;
        margin-left: auto;
        place-items: center;
        border: 1px solid var(--ifm4-line);
        border-radius: 14px;
        color: var(--ifm4-blue);
        background: #fff;
        cursor: pointer;
        box-shadow: 0 6px 18px rgba(20, 42, 70, 0.08);
    }

    .ifm4-toggle__bars {
        position: relative;
        display: block;
        width: 26px;
        height: 20px;
    }

    .ifm4-toggle__bars span {
        position: absolute;
        left: 0;
        width: 100%;
        height: 3px;
        border-radius: 999px;
        background: currentColor;
    }

    .ifm4-toggle__bars span:nth-child(1) {
        top: 0;
    }

    .ifm4-toggle__bars span:nth-child(2) {
        top: 8px;
    }

    .ifm4-toggle__bars span:nth-child(3) {
        top: 16px;
    }
}

@media (max-width: 760px) {
    .ifm4-header {
        top: 5px;
        width: calc(100% - 14px);
        margin-top: 6px;
        border-radius: 16px;
    }

    .ifm4-header__inner {
        width: calc(100% - 22px);
        min-height: 78px;
        padding: 9px 0;
    }

    .ifm4-brand {
        gap: 11px;
        min-width: 0;
    }

    .ifm4-brand__logo {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 13px;
    }

    .ifm4-brand__text strong {
        font-size: 1.15rem;
        letter-spacing: 0.07em;
    }

    .ifm4-brand__text small {
        font-size: 0.85rem;
    }

    .ifm4-toggle {
        width: 50px;
        height: 50px;
        flex: 0 0 50px;
    }

    .ifm4-drawer {
        width: 100%;
        padding: 18px;
        border-left: 0;
    }

    .ifm4-drawer__contact-grid {
        grid-template-columns: 1fr;
    }

    .ifm4-drawer__contact-grid > a {
        display: grid;
        grid-template-columns: 28px 1fr;
        min-height: 60px;
        justify-items: start;
        align-items: center;
        column-gap: 10px;
        padding: 10px 14px;
        text-align: left;
    }

    .ifm4-drawer__contact-grid > a > span {
        grid-row: 1 / 3;
    }
}

@media (max-width: 430px) {
    .ifm4-brand__text small {
        display: none;
    }

    .ifm4-brand__text strong {
        font-size: 1.05rem;
    }
}
