/* ===== Herzzeit – Shared Animations ===== */

/* Page enter — NUR opacity, kein transform (transform auf body bricht position:fixed-Nav) */
@keyframes pageEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}
html {
    overflow-x: hidden;
}
body {
    overflow-x: hidden;
    animation: pageEnter 0.5s ease both;
    padding-top: 135px; /* Platz für die fixierte Navbar (Logo 115px + Padding 20px) */
}
@media (max-width: 992px) {
    body {
        padding-top: 110px; /* Mobile: Logo 80px + Padding 30px */
    }
}
body.page-leaving {
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ===== Fixierte Navbar – Scroll-Schatten ===== */
.navbar.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12) !important;
}

/* ===== Nav Overlay Backdrop (mit sanftem Fade) ===== */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Hamburger-Button (3 Balken → X) ===== */
.menu-toggle {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5.5px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}
@media (max-width: 992px) {
    .menu-toggle {
        display: flex !important; /* überschreibt display:block aus dem <style>-Block */
    }
}
.menu-toggle .bar {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #222222;
    border-radius: 3px;
    transform-origin: center;
    transition:
        transform  0.38s cubic-bezier(0.23, 1, 0.32, 1),
        opacity    0.25s ease,
        background 0.2s ease;
}
.menu-toggle:hover .bar {
    background: #8b9a27;
}
/* X-Zustand wenn Menü offen */
.menu-toggle.open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.open .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.menu-toggle.open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}
.menu-toggle.open .bar {
    background: #8b9a27;
}

/* ===== Mobile Nav-Panel: Transform-Animation (statt right-Schieben) ===== */
@media (max-width: 992px) {
    .nav-links {
        right: 0 !important;
        transform: translateX(105%) !important;
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    box-shadow 0.4s ease !important;
    }
    .nav-links.active {
        transform: translateX(0) !important;
        box-shadow: -16px 0 48px rgba(0, 0, 0, 0.14) !important;
    }

    /* Gestaffeltes Einblenden der Menü-Links */
    .nav-links a {
        opacity: 0;
        transform: translateX(18px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    .nav-links.active a {
        opacity: 1;
        transform: translateX(0);
    }
    .nav-links.active a:nth-child(1) { transition-delay: 0.05s; }
    .nav-links.active a:nth-child(2) { transition-delay: 0.10s; }
    .nav-links.active a:nth-child(3) { transition-delay: 0.15s; }
    .nav-links.active a:nth-child(4) { transition-delay: 0.20s; }
    .nav-links.active a:nth-child(5) { transition-delay: 0.25s; }
    .nav-links.active a:nth-child(6) { transition-delay: 0.30s; }
}

/* ===== WhatsApp Pulse ===== */
@keyframes waPulse {
    0%, 100% { box-shadow: 2px 2px 10px rgba(0,0,0,0.2), 0 0 0 0 rgba(37,211,102,0.5); }
    55%       { box-shadow: 2px 2px 10px rgba(0,0,0,0.2), 0 0 0 16px rgba(37,211,102,0); }
}
.whatsapp-float {
    animation: waPulse 2.6s ease infinite !important;
    transition: transform 0.3s ease !important;
}
.whatsapp-float:hover {
    transform: scale(1.12) !important;
}

/* ===== Scroll-Reveal ===== */
.reveal,
.reveal-left,
.reveal-right {
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal       { opacity: 0; transform: translateY(32px); }
.reveal-left  { opacity: 0; transform: translateX(-35px); }
.reveal-right { opacity: 0; transform: translateX(35px); }

.reveal.visible,
.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Auf Mobilgeräten nur vertikale Reveals */
@media (max-width: 768px) {
    .reveal-left,
    .reveal-right {
        transform: translateY(28px);
    }
}

/* Stagger-Delays */
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }
.d4 { transition-delay: 0.32s; }

/* ===== Navbar-Link Hover-Unterstrich (nur Desktop) ===== */
@media (min-width: 993px) {
    .nav-links a:not(.btn-outline) {
        position: relative;
    }
    .nav-links a:not(.btn-outline)::after {
        content: '';
        position: absolute;
        left: 0; bottom: -3px;
        width: 0; height: 2px;
        background: #8b9a27;
        transition: width 0.3s ease;
    }
    .nav-links a:not(.btn-outline):hover::after {
        width: 100%;
    }
}
