/* ==========================================================================
   PBC GmbH – Layout: Notdienst-Leiste, Header, Mega-Menü, Footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Notdienst-Leiste (Desktop)
   -------------------------------------------------------------------------- */

.alertbar {
    position: relative;
    z-index: 1002;
    height: var(--alert-h);
    background: var(--ink);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.alertbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
}

.alertbar__left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

/* Pulsierender Notfall-Punkt */
.pulse-dot {
    position: relative;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal);
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--signal);
    animation: pulseRing 2.2s var(--ease-out) infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.55);
        opacity: 0.9;
    }
    70% {
        transform: scale(1.7);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.alertbar__label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff;
}

.alertbar__text {
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alertbar__right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: none;
}

.alertbar__meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.75rem;
}

.alertbar__tel {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    transition: color 0.25s var(--ease);
}

.alertbar__tel:hover {
    color: var(--signal);
}

@media (max-width: 900px) {
    .alertbar {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   2. Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-stuck {
    box-shadow: 0 1px 0 var(--rule), 0 12px 34px -22px rgba(16, 17, 19, 0.3);
}

.header__bar {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    flex: none;
}

.brand img {
    height: clamp(38px, 4.4vw, 52px);
    width: auto;
}

/* --- Primäre Navigation --- */

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
}

.nav__item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 100%;
    padding-inline: 0.95rem;
    font-size: 0.9375rem;
    font-weight: 550;
    letter-spacing: -0.01em;
    color: var(--ink-2);
    transition: color 0.25s var(--ease);
}

.nav__link:hover,
.nav__item[data-open="true"] > .nav__link {
    color: var(--ink);
}

/* Roter Indikator, der von links einfährt */
.nav__link::after {
    content: "";
    position: absolute;
    left: 0.95rem;
    right: 0.95rem;
    bottom: -1px;
    height: 2px;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease-out);
}

.nav__link:hover::after,
.nav__item[data-open="true"] > .nav__link::after,
.nav__link[aria-current="page"]::after {
    transform: scaleX(1);
}

.nav__caret {
    width: 9px;
    height: 9px;
    flex: none;
    transition: transform 0.3s var(--ease);
    color: var(--ink-5);
}

.nav__item[data-open="true"] .nav__caret {
    transform: rotate(180deg);
    color: var(--signal);
}

/* --- Header-Aktionen --- */

.header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: none;
}

/* Telefon im Header – prominent für Notdienst */
.header-tel {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.9rem 0.5rem 0.6rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.header-tel:hover {
    border-color: var(--ink-5);
    background: var(--paper-2);
}

.header-tel__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    background: var(--signal);
    color: #fff;
    border-radius: 2px;
}

.header-tel__icon svg {
    width: 15px;
    height: 15px;
}

.header-tel__meta {
    display: grid;
    line-height: 1.2;
}

.header-tel__label {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-4);
}

.header-tel__no {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

@media (max-width: 1180px) {
    .header-tel__meta {
        display: none;
    }
    .header-tel {
        padding: 0.4rem;
    }
}

/* --- Burger --- */

.burger {
    display: none;
    width: 46px;
    height: 46px;
    flex: none;
    position: relative;
    border: 1px solid var(--rule);
    border-radius: 2px;
}

.burger span {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2px;
    background: var(--ink);
    transform: translateX(-50%);
    transition: transform 0.35s var(--ease-out), opacity 0.2s;
}

.burger span:nth-child(1) {
    top: 16px;
}
.burger span:nth-child(2) {
    top: 22px;
}
.burger span:nth-child(3) {
    top: 28px;
}

.burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateX(-50%) translateY(6px) rotate(45deg);
}
.burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateX(-50%) translateY(-6px) rotate(-45deg);
}

@media (max-width: 1080px) {
    .nav,
    .header__actions .btn {
        display: none;
    }
    .burger {
        display: block;
    }
}

/* --------------------------------------------------------------------------
   3. Mega-Menü
   -------------------------------------------------------------------------- */

.mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 30px 60px -35px rgba(16, 17, 19, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.28s var(--ease), transform 0.36s var(--ease-out),
        visibility 0.28s;
    z-index: 1000;
}

.site-header[data-mega="open"] .mega[data-active="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega__inner {
    display: grid;
    grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4.5rem);
    padding-block: clamp(2.25rem, 3.4vw, 3.25rem);
}

/* Linke Spalte: Bereichs-Intro */
.mega__aside {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding-right: clamp(1rem, 2vw, 2rem);
    border-right: 1px solid var(--rule);
}

.mega__title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    line-height: 1.05;
    color: var(--ink);
}

.mega__desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-4);
}

.mega__aside-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.875rem;
    font-weight: 650;
    color: var(--signal);
}

.mega__aside-link svg {
    width: 15px;
    height: 15px;
    transition: transform 0.3s var(--ease-out);
}

.mega__aside-link:hover svg {
    transform: translateX(5px);
}

/* Rechte Spalte: Leistungs-Kacheln */
.mega__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    background: var(--rule);
}

.mega-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    padding: 1.15rem 1.2rem;
    background: var(--paper);
    transition: background 0.28s var(--ease);
    overflow: hidden;
}

.mega-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--signal);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.35s var(--ease-out);
}

.mega-card:hover {
    background: var(--paper-2);
}

.mega-card:hover::before {
    transform: scaleY(1);
}

.mega-card__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--ink-2);
    background: var(--paper);
    transition: color 0.28s var(--ease), border-color 0.28s var(--ease);
}

.mega-card__icon svg {
    width: 22px;
    height: 22px;
}

.mega-card:hover .mega-card__icon {
    color: var(--signal);
    border-color: rgba(229, 23, 27, 0.35);
}

.mega-card__body {
    min-width: 0;
}

.mega-card__title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -0.015em;
    margin-bottom: 0.2rem;
}

.mega-card__title .tag-mini {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
    border: 1px solid rgba(229, 23, 27, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
}

.mega-card__text {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-4);
}

/* Notfall-Zeile im Mega-Menü */
.mega__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 0 0.25rem;
    border-top: 1px solid var(--rule);
    grid-column: 1 / -1;
}

.mega__foot-text {
    font-size: 0.875rem;
    color: var(--ink-4);
}

@media (max-width: 1240px) {
    .mega__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --------------------------------------------------------------------------
   4. Mobile Navigation
   -------------------------------------------------------------------------- */

.mnav {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 999;
    background: var(--paper);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out),
        visibility 0.3s;
    -webkit-overflow-scrolling: touch;
}

.mnav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.is-locked {
    overflow: hidden;
}

.mnav__inner {
    padding: 1.25rem var(--gutter) 3rem;
}

/* Notruf-Block ganz oben im Mobilmenü */
.mnav__sos {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    background: var(--ink);
    color: #fff;
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

.mnav__sos-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    background: var(--signal);
    border-radius: 2px;
}

.mnav__sos-icon svg {
    width: 20px;
    height: 20px;
}

.mnav__sos-label {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.mnav__sos-no {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mnav__group {
    border-top: 1px solid var(--rule);
}

.mnav__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.05rem 0;
    font-size: 1.125rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-align: left;
}

.mnav__row svg {
    width: 16px;
    height: 16px;
    flex: none;
    color: var(--ink-5);
    transition: transform 0.32s var(--ease-out), color 0.25s;
}

.mnav__group[data-open="true"] .mnav__row svg {
    transform: rotate(180deg);
    color: var(--signal);
}

.mnav__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.42s var(--ease-out);
}

.mnav__group[data-open="true"] .mnav__panel {
    grid-template-rows: 1fr;
}

.mnav__panel > div {
    overflow: hidden;
}

.mnav__sub {
    display: grid;
    gap: 2px;
    padding-bottom: 1.1rem;
}

.mnav__sub a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    background: var(--paper-2);
    font-size: 0.9375rem;
    font-weight: 550;
    color: var(--ink-2);
    border-left: 2px solid transparent;
    transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.mnav__sub a:hover,
.mnav__sub a:active {
    border-left-color: var(--signal);
    background: var(--paper-3);
    color: var(--ink);
}

.mnav__sub svg {
    width: 19px;
    height: 19px;
    flex: none;
    color: var(--ink-4);
}

.mnav__sub a.is-overview {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--signal);
    font-weight: 650;
    color: var(--ink);
}

.mnav__cta {
    margin-top: 1.75rem;
    display: grid;
    gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   5. Sticky Notruf-Leiste (Mobil)
   -------------------------------------------------------------------------- */

.sos-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: none;
    background: rgba(16, 17, 19, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform 0.45s var(--ease-out);
}

.sos-bar.is-visible {
    transform: translateY(0);
}

.sos-bar__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.sos-bar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 48px;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-radius: 2px;
}

.sos-bar__btn svg {
    width: 17px;
    height: 17px;
}

.sos-bar__btn--call {
    background: var(--signal);
    color: #fff;
}

.sos-bar__btn--form {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

@media (max-width: 900px) {
    .sos-bar {
        display: block;
    }
    body {
        padding-bottom: 0;
    }
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */

.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.62);
    padding-top: clamp(3.5rem, 6vw, 5.5rem);
    position: relative;
    overflow: hidden;
}

/* Notdienst-Band im Footer */
.footer-sos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    padding: clamp(1.75rem, 3vw, 2.5rem);
    background: var(--signal);
    color: #fff;
    margin-bottom: clamp(3rem, 5vw, 4.5rem);
    position: relative;
    overflow: hidden;
}

.footer-sos::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -60px;
    width: 240px;
    background: rgba(255, 255, 255, 0.07);
    transform: skewX(-16deg);
}

.footer-sos__title {
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    line-height: 1.05;
    color: #fff;
}

.footer-sos__text {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 0.5rem;
    max-width: 52ch;
}

.footer-sos__tel {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.6rem;
    background: #fff;
    color: var(--ink);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    border-radius: 2px;
    white-space: nowrap;
    transition: transform 0.3s var(--ease-out);
}

.footer-sos__tel:hover {
    transform: translateY(-3px);
}

.footer-sos__tel svg {
    width: 20px;
    height: 20px;
    color: var(--signal);
}

@media (max-width: 800px) {
    .footer-sos {
        grid-template-columns: 1fr;
    }
}

/* Große Footer-Sitemap */
.footer-map {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) repeat(4, minmax(0, 1fr));
    gap: clamp(1.75rem, 3vw, 3rem);
    padding-bottom: clamp(2.5rem, 4vw, 4rem);
}

@media (max-width: 1080px) {
    .footer-map {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .footer-map__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .footer-map {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.footer-map__brand img {
    height: 44px;
    width: auto;
    margin-bottom: 1.25rem;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.footer-map__claim {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.55);
    max-width: 38ch;
    margin-bottom: 1.5rem;
}

.footer-col__head {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #fff;
    padding-bottom: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-col ul {
    display: grid;
    gap: 0.6rem;
}

.footer-col a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.58);
    transition: color 0.22s var(--ease), padding-left 0.28s var(--ease-out);
    display: inline-block;
}

.footer-col a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer-contact {
    display: grid;
    gap: 0.85rem;
    font-size: 0.9rem;
}

.footer-contact div {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    color: rgba(255, 255, 255, 0.58);
}

.footer-contact svg {
    width: 16px;
    height: 16px;
    flex: none;
    margin-top: 3px;
    color: var(--signal);
}

.footer-contact a:hover {
    color: #fff;
}

/* Einsatzgebiete als Chip-Wolke */
.footer-regions {
    padding-block: clamp(1.75rem, 3vw, 2.5rem);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-regions__head {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1.1rem;
}

.chip-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip-cloud a,
.chip-cloud span {
    font-size: 0.8125rem;
    padding: 0.34rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.25s var(--ease);
}

.chip-cloud a:hover {
    border-color: var(--signal);
    color: #fff;
    background: rgba(229, 23, 27, 0.16);
}

/* Footer-Abschluss */
.footer-base {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding-block: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
}

.footer-base__links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-base a:hover {
    color: #fff;
}

@media (max-width: 900px) {
    .site-footer {
        padding-bottom: 84px;
    }
}
