/* =====================================================
   MAD HEADER
===================================================== */


.mad-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #06050A;
    border-bottom: 1px solid rgba(185, 58, 255, 0.18);
}

.mad-header-container {
    width: min(100% - 40px, 1160px);
    min-height: 66px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Logo */

.mad-header-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.mad-header-logo img {
    display: block;
    width: 64px;
    height: auto;
    object-fit: contain;
}

/* Navigation */

.mad-navigation {
    margin-left: auto;
}

.mad-menu {
    display: flex;
    align-items: center;
    gap: 34px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mad-menu li {
    margin: 0;
    padding: 0;
}

.mad-menu a {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 24px 0;
    color: #94A3B8;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition:
        color 0.25s ease,
        opacity 0.25s ease;
}

.mad-menu a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 16px;
    left: 0;
    height: 1px;
    background: #F8FAFC;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.mad-menu a:hover,
.mad-menu a:focus-visible,
.mad-menu .current-menu-item>a {
    color: #ffffff;
}

.mad-menu a:hover::after,
.mad-menu a:focus-visible::after,
.mad-menu .current-menu-item>a::after {
    transform: scaleX(1);
}

/* CTA Button */

.mad-header-button {
    min-height: 42px;
    padding: 0 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-shrink: 0;
    color: #F8FAFC;
    background: linear-gradient(135deg,  #8B5CF6 0%, #D946EF 100%);
    box-shadow: 0 8px 24px rgba(174, 49, 241, 0.2);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
}

.mad-header-button:hover,
.mad-header-button:focus-visible {
    color: #ffffff;
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 12px 30px rgba(174, 49, 241, 0.35);
}

.mad-button-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mad-mobile-button {
    display: none;
}

/* Mobile Toggle */

.mad-menu-toggle {
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    cursor: pointer;
}

.mad-menu-toggle span {
    width: 22px;
    height: 2px;
    display: block;
    background: #ffffff;
    border-radius: 10px;
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.mad-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mad-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.mad-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media screen and (max-width: 1150px) {
    .mad-header-container {
        gap: 22px;
    }

    .mad-menu {
        gap: 22px;
    }

    .mad-menu a {
        font-size: 12px;
    }

    .mad-header-button {
        padding: 0 16px;
    }
}

@media screen and (max-width: 991px) {
    .mad-header-container {
        width: min(100% - 32px, 1160px);
        min-height: 68px;
    }

    .mad-header-logo img {
        width: 60px;
    }

    .mad-menu-toggle {
        display: inline-flex;
    }

    .mad-desktop-button {
        display: none;
    }

    .mad-navigation {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 0;
        margin: 0;
        padding: 0 16px;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        background: #050505;
        border-bottom: 1px solid rgba(185, 58, 255, 0.2);
        transition:
            max-height 0.35s ease,
            opacity 0.25s ease,
            visibility 0.25s ease,
            padding 0.35s ease;
    }

    .mad-navigation.is-open {
        max-height: 650px;
        padding-top: 14px;
        padding-bottom: 22px;
        visibility: visible;
        opacity: 1;
    }

    .mad-menu {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .mad-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .mad-menu a {
        width: 100%;
        padding: 17px 4px;
        color: #a6aabc;
        font-size: 14px;
    }

    .mad-menu a::after {
        right: auto;
        bottom: 9px;
        width: 30px;
    }

    .mad-mobile-button {
        width: 100%;
        min-height: 46px;
        margin-top: 18px;
        display: inline-flex;
    }
}

@media screen and (max-width: 575px) {
    .mad-header-container {
        width: calc(100% - 24px);
    }

    .mad-header-logo img {
        width: 55px;
    }

    .mad-navigation {
        padding-right: 12px;
        padding-left: 12px;
    }
}

/* Lock page scrolling while menu is open */

body.mad-menu-open {
    overflow: hidden;
}

@media screen and (max-width: 991px) {

    .mad-navigation {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 9998;

        width: 100%;
        max-height: 0;
        margin: 0;
        padding: 0 16px;

        overflow: hidden;
        visibility: hidden;
        opacity: 0;

        background: #050505;
        border-bottom: 1px solid rgba(185, 58, 255, 0.2);

        transition:
            max-height 0.35s ease,
            opacity 0.25s ease,
            visibility 0.25s ease,
            padding 0.35s ease;
    }

    .mad-navigation.is-open {
        max-height: calc(100vh - 68px);
        padding-top: 14px;
        padding-bottom: 22px;
        overflow-y: auto;
        visibility: visible;
        opacity: 1;
    }
}