/* ============================================================
   A&M Header Block — 1:1-Port von Startseite.html .nav
   ============================================================ */

.ams-header {
    box-sizing: border-box;
    height: 72px;
    padding: 0 48px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line, #e8e6e1);
    display: flex;
    align-items: center;
    gap: 24px;
}
.ams-header *,
.ams-header *::before,
.ams-header *::after { box-sizing: border-box; }

/* Sticky lebt auf dem äußeren Template-Part-Wrapper (siehe hero.css-
   Architektur-Notiz). :has() ist nötig damit es nur greift wenn der
   Block sticky markiert wurde. */
.wp-block-template-part:has(> .ams-header.is-sticky) {
    position: sticky;
    top: 0;
    z-index: 100;
}

.ams-header.is-transparent {
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.ams-header.is-transparent .ams-header__link { color: var(--white, #fff); }
.ams-header.is-transparent .ams-header__burger span { background: var(--white, #fff); }

/* ── LOGO ──────────────────────────────────────────────── */
.ams-header__logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}
.ams-header__logo img {
    height: 32px;
    width: auto;
    display: block;
}

/* ── MENU (nur Nav-Items, mittig zwischen Logo und Actions) ── */
.ams-header__menu {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── ACTIONS-Cluster rechts (Kontakt + Phone + Burger) ──── */
.ams-header__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ams-header__item {
    position: relative;
    display: flex;
    align-items: center;
}

.ams-header__link {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-2, #4a4a4a);
    text-decoration: none;
    transition: color 200ms var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ams-header__link:hover { color: var(--brand-primary, #cc0000); }
.ams-header__chev {
    display: inline-flex;
    transition: transform 200ms var(--ease-out);
}
.ams-header__item.has-sub:hover .ams-header__chev,
.ams-header__item.has-sub:focus-within .ams-header__chev { transform: rotate(180deg); }

/* ── KONTAKT-BUTTON (Pill, ink-rote Brand-Primary) ────── */
.ams-header__cta {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 100px;
    background: var(--brand-primary, #cc0000);
    color: var(--white, #fff);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-cta, 0 4px 16px rgba(204, 0, 0, 0.25));
    transition: background 200ms var(--ease-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.ams-header__cta:hover {
    background: var(--brand-primary-dark, #990000);
    color: var(--white, #fff);
    transform: translateY(-2px);
    box-shadow: var(--shadow-cta-hover, 0 8px 24px rgba(204, 0, 0, 0.30));
}

/* ── HOTLINE (Pill mit Border) ────────────────────────── */
.ams-header__phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 100px;
    border: 1px solid var(--line, #e8e6e1);
    color: var(--ink, #1a1a1a);
    font-size: 0.88rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    transition: border-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.ams-header__phone:hover {
    border-color: var(--brand-primary, #cc0000);
    color: var(--brand-primary, #cc0000);
}
.ams-header__phone svg {
    color: var(--brand-primary, #cc0000);
    flex-shrink: 0;
}

/* ── DROPDOWN (Sub-Items) ─────────────────────────────── */
.ams-header__sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--white, #fff);
    border: 1px solid var(--line, #e8e6e1);
    border-radius: var(--r-card, 10px);
    box-shadow: var(--shadow-card-hover, 0 12px 32px rgba(0, 0, 0, 0.10));
    padding: 8px;
    margin: 8px 0 0;
    list-style: none;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
    z-index: 10;
}
.ams-header__item.has-sub:hover .ams-header__sub,
.ams-header__item.has-sub:focus-within .ams-header__sub {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.ams-header__sub-item { margin: 0; display: block; }
.ams-header__sub-link {
    display: block;
    padding: 10px 14px;
    color: var(--ink, #1a1a1a);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
}
.ams-header__sub-link:hover {
    background: var(--surface, #f5f4f2);
    color: var(--brand-primary, #cc0000);
}

/* ── BURGER (mobile only) ─────────────────────────────── */
.ams-header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.ams-header__burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink, #1a1a1a);
    border-radius: 2px;
    transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
.ams-header.is-mobile-open .ams-header__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ams-header.is-mobile-open .ams-header__burger span:nth-child(2) { opacity: 0; }
.ams-header.is-mobile-open .ams-header__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── RESPONSIVE ────────────────────────────────────────
   Original blendet <ul class="nav__links"> auf mobile aus.
   Wir behalten die Drawer-Mechanik (besser für echte UX) —
   kein 1:1-Verhalten, aber Layout im Drawer 1:1. */
@media (max-width: 1024px) {
    .ams-header { height: auto; min-height: 60px; padding: 0 24px; }

    .ams-header__menu {
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--white, #fff);
        border-bottom: 1px solid var(--line, #e8e6e1);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 320ms var(--ease-out);
    }
    .ams-header.is-mobile-open .ams-header__menu {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        padding: 12px 24px 24px;
    }
    .ams-header__item {
        border-bottom: 1px solid var(--line, #e8e6e1);
        display: block;
    }
    .ams-header__item:last-child { border-bottom: 0; }
    .ams-header__link {
        padding: 16px 0;
        font-size: 1.05rem;
        color: var(--ink, #1a1a1a);
        justify-content: space-between;
    }

    .ams-header__sub {
        position: static;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 0 0 8px 16px;
        margin: 0;
    }
    .ams-header__sub-link { padding: 8px 0; font-size: 0.95rem; }

    .ams-header__burger { display: flex; }
}

@media (max-width: 640px) {
    .ams-header { padding: 0 16px; }
    .ams-header__logo img { height: 28px; }
}
