/* =========================
   MARKETIX AGENTUR MOBILE MENU
   VERSION 1.0.1
   ========================= */

:root {
    --mx-header-h: 78px;
    --mx-active-gold: #bfa269;
    --mx-ease: cubic-bezier(0.4, 0, 0.2, 1);
}


/* =========================
   1. HEADER & BASIS
   ========================= */

.mx-mobile-header,
.mobile-menu-overlay,
.mobile-menu-overlay * {
    box-sizing: border-box;
}

.mx-mobile-header {
    position: sticky;
    top: 0;
    z-index: 10001;
}

.mx-mobile-header .et_pb_row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 5% !important;
}

.mx-mobile-header .et_pb_column {
    display: flex;
    align-items: center;
    margin-bottom: 0 !important;
}

.mx-mobile-header .et_pb_column:last-child {
    display: flex;
    justify-content: flex-end;
}

.mx-mobile-header .et_pb_column:last-child .et_pb_module {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.mx-mobile-header img {
    display: block;
    width: auto;
    height: auto;
    max-height: 54px;
}


/* =========================
   2. BURGER / X TRIGGER
   ========================= */

.menu-trigger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    line-height: 1;
    text-align: right;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.menu-trigger .et-pb-icon,
.menu-trigger i,
.menu-trigger span:not(.burger-box):not(.burger-line) {
    display: none !important;
}

.burger-box {
    position: relative;
    display: block;
    width: 28px;
    height: 20px;
}

.burger-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
    transition:
        transform 0.3s var(--mx-ease),
        opacity 0.22s ease,
        background-color 0.2s ease;
}

.burger-line:nth-child(1) {
    top: 0;
}

.burger-line:nth-child(2) {
    top: 9px;
}

.burger-line:nth-child(3) {
    top: 18px;
}

.menu-trigger.is-open .burger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-trigger.is-open .burger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-trigger.is-open .burger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.menu-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 8px;
}


/* =========================
   3. OVERLAY PANEL
   ========================= */

.mobile-menu-overlay {
    position: fixed;
    top: var(--mx-header-h);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
    padding: 40px 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    background: #ffffff;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}


/* =========================
   4. DIVI SYSTEM FIXES
   ========================= */

.mobile-menu-overlay .et_pb_row {
    width: 90% !important;
    max-width: 90% !important;
    margin: 0 auto !important;
}

.mobile-menu-overlay .et_pb_column {
    width: 100% !important;
    margin-bottom: 0 !important;
}

.mobile-menu-overlay .et_pb_module {
    margin-bottom: 0 !important;
}

.mobile-menu-overlay .et_pb_text p:last-child {
    margin-bottom: 0;
}


/* =========================
   5. LINK / TEXT STATES
   ========================= */

.menu-link a,
.services-toggle,
.services-submenu a,
.mx-menu-meta a {
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.menu-link a:hover,
.services-toggle:hover,
.services-toggle.open,
.services-submenu a:hover,
.mx-menu-meta a:hover {
    color: var(--mx-active-gold) !important;
}


/* =========================
   6. SUBMENU TOGGLE
   ========================= */

.services-toggle {
    position: relative;
    display: block;
    width: 100%;
    padding-right: 28px;
}

.services-toggle::after {
    content: "";
    position: absolute;
    right: 4px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-60%) rotate(45deg);
    transform-origin: center;
    transition: transform 0.28s ease;
    pointer-events: none;
}

.services-toggle.open::after {
    transform: translateY(-35%) rotate(-135deg);
}


/* =========================
   7. SUBMENUS
   ========================= */

.services-submenu {
    display: none;
    padding: 0 0 0 2px;
    overflow: hidden;
}

.services-submenu.open {
    display: block;
}


/* =========================
   8. CTA BUTTON
   ========================= */

.mobile-menu-cta .et_pb_button {
    background-color: var(--mx-active-gold) !important;
    color: #ffffff !important;
    border: none !important;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease !important;
}

.mobile-menu-cta .et_pb_button:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(191, 162, 105, 0.2);
}


/* =========================
   9. BODY LOCK
   ========================= */

body.mx-menu-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}


/* =========================
   10. PHONE FEINTUNING
   ========================= */

@media (max-width: 767px) {

    .mx-mobile-header img {
        max-height: 48px;
    }

    .menu-trigger {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }
}


/* =========================
   11. REDUCED MOTION
   ========================= */

@media (prefers-reduced-motion: reduce) {

    .burger-line,
    .mobile-menu-overlay,
    .services-toggle::after,
    .mobile-menu-cta .et_pb_button,
    .menu-link a,
    .services-submenu a,
    .mx-menu-meta a {
        transition: none !important;
    }

    .mobile-menu-overlay {
        transform: none;
    }

    .mobile-menu-cta .et_pb_button:hover {
        transform: none;
    }
}


/* =========================
   12. RESPONSIVE MENU SWITCH
   Desktop ab 1201px
   Mobile bis 1200px
   ========================= */

/* Standard = Desktop */
.mx-desktop-header {
    display: block;
}

.mx-mobile-header,
.mobile-menu-overlay {
    display: none;
}


/* Tablet & Mobile */
@media (max-width: 1200px) {

    .mx-desktop-header {
        display: none !important;
    }

    .mx-mobile-header {
        display: block !important;
    }

    .mobile-menu-overlay {
        display: block !important;
    }
}


/* =========================
   13. DIVI BUILDER FIX
   Verhindert Mobile-Header /
   Overlay in Desktop-Vorschau
   ========================= */

.et-fb-root-ancestor .mx-desktop-header,
.et-fb-preview--desktop .mx-desktop-header {
    display: block !important;
}

.et-fb-root-ancestor .mx-mobile-header,
.et-fb-root-ancestor .mobile-menu-overlay,
.et-fb-preview--desktop .mx-mobile-header,
.et-fb-preview--desktop .mobile-menu-overlay {
    display: none !important;
}