/* =========================================================
 * Competenza Academy – Finaler Header
 * ========================================================= */

.ca-site-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #e2e5e7;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: none;
}

.ca-header-inner {
    display: flex;
    width: min(
        calc(100% - 48px),
        var(--ca-container, 1280px)
    );
    min-height: 80px;
    margin-inline: auto;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.ca-site-branding,
.ca-site-logo {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
}

.ca-site-logo img {
    display: block;
    width: clamp(190px, 14vw, 230px);
    height: auto;
    max-height: 56px;
}

/* Desktop */

.ca-menu-toggle,
.ca-offcanvas-header,
.ca-offcanvas-footer,
.ca-menu-overlay {
    display: none !important;
}

.ca-primary-navigation {
    position: static;
    display: flex;
    width: auto;
    height: auto;
    margin-left: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transform: none;
    align-items: center;
}

.ca-offcanvas-content {
    display: flex;
    padding: 0;
    overflow: visible;
    align-items: center;
    gap: clamp(28px, 3vw, 46px);
}

.ca-primary-menu {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
    align-items: center;
    gap: clamp(22px, 2.4vw, 38px);
}

.ca-primary-menu li {
    position: relative;
    padding: 0;
    margin: 0;
    border: 0;
}

.ca-primary-menu a {
    position: relative;
    display: inline-flex;
    min-height: 40px;
    padding: 10px 0;
    color: #3e4246;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.ca-primary-menu a::before {
    display: none !important;
}

.ca-primary-menu a::after {
    position: absolute;
    right: 0;
    bottom: 2px;
    left: 0;
    width: 0;
    height: 2px;
    margin: auto;
    content: "";
    background: #ed8008;
    transition: width 180ms ease;
}

.ca-primary-menu a:hover::after,
.ca-primary-menu a:focus-visible::after,
.ca-primary-menu .current-menu-item > a::after {
    width: 100%;
}

/* Mittleres Grau statt Schwarz */

.ca-account-button,
.ca-account-button.ca-button,
.ca-account-button.ca-button-primary {
    position: relative;
    display: inline-flex;
    width: auto;
    min-width: 158px;
    min-height: 46px;
    padding: 12px 23px 12px 30px !important;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0 !important;
    color: #ffffff !important;
    background: #55595d !important;
    box-shadow: none !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.ca-account-button::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    content: "";
    background: #ed8008;
    pointer-events: none;
}

.ca-account-button:hover,
.ca-account-button:focus-visible {
    color: #ffffff !important;
    background: #45494d !important;
}

/* =========================================================
 * Modernes Off-Canvas
 * ========================================================= */

@media (max-width: 960px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    body.ca-menu-open {
        overflow: hidden !important;
    }

    /*
     * Das Dokument wird niemals verschoben.
     */
    body.ca-menu-open .ca-site-header,
    body.ca-menu-open .ca-site-main,
    body.ca-menu-open .ca-site-footer {
        margin: 0 !important;
        transform: none !important;
    }

    .ca-header-inner {
        width: calc(100% - 36px);
        min-height: 70px;
        gap: 16px;
    }

    .ca-site-logo img {
        width: 176px;
        max-height: 46px;
    }

    /*
     * Reduzierter, rahmenloser Menübutton.
     */
    .ca-menu-toggle {
        position: relative;
        z-index: 1210;
        display: inline-grid !important;
        width: 46px;
        height: 46px;
        padding: 0;
        border: 0 !important;
        border-radius: 0;
        color: #3e4246;
        background: transparent !important;
        box-shadow: none !important;
        place-items: center;
        cursor: pointer;
    }

    .ca-menu-toggle::before {
        display: none !important;
    }

    .ca-menu-toggle:hover {
        background: #f2f3f4 !important;
    }

    .ca-menu-toggle-lines {
        display: grid;
        width: 24px;
        gap: 5px;
    }

    .ca-menu-toggle-lines span {
        display: block;
        width: 24px;
        height: 2px;
        background: #3e4246;
        transition:
            transform 180ms ease,
            opacity 180ms ease;
    }

    .ca-menu-toggle[aria-expanded="true"] {
        visibility: hidden;
    }

    /*
     * Der Drawer liegt ausschließlich über dem Dokument.
     */
    .ca-primary-navigation {
        position: fixed !important;
        z-index: 1230;
        inset: 0 0 0 auto !important;
        display: grid;
        width: min(90vw, 430px) !important;
        max-width: 430px;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        box-shadow: -24px 0 70px rgba(24, 31, 39, 0.2);
        grid-template-rows: auto minmax(0, 1fr) auto;
        opacity: 1 !important;
        overflow: hidden;
        pointer-events: none;
        transform: translate3d(102%, 0, 0) !important;
        transition:
            transform 280ms cubic-bezier(.22, 1, .36, 1);
        will-change: transform;
    }

    .ca-primary-navigation.is-open {
        pointer-events: auto;
        transform: translate3d(0, 0, 0) !important;
    }

    .ca-offcanvas-header {
        display: flex !important;
        min-height: 82px;
        padding: 17px 22px;
        border-bottom: 1px solid #e2e5e7;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
    }

    .ca-offcanvas-brand {
        display: inline-flex;
        align-items: center;
    }

    .ca-offcanvas-brand img {
        display: block;
        width: 178px;
        height: auto;
    }

    .ca-offcanvas-close {
        position: relative;
        display: block;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0 !important;
        border-radius: 0;
        background: transparent !important;
        box-shadow: none !important;
        cursor: pointer;
    }

    .ca-offcanvas-close:hover {
        background: #f2f3f4 !important;
    }

    .ca-offcanvas-close::before {
        display: none !important;
    }

    .ca-offcanvas-close span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 23px;
        height: 2px;
        background: #3e4246;
    }

    .ca-offcanvas-close span:first-child {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .ca-offcanvas-close span:last-child {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .ca-offcanvas-content {
        display: block;
        min-width: 0;
        padding: 25px 22px 32px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .ca-primary-menu {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
    }

    .ca-primary-menu li {
        border-bottom: 1px solid #e2e5e7;
    }

    .ca-primary-menu li:first-child {
        border-top: 1px solid #e2e5e7;
    }

    .ca-primary-menu a {
        display: flex;
        width: 100%;
        min-height: 60px;
        padding: 17px 4px;
        color: #303438;
        justify-content: space-between;
        font-size: 1rem;
    }

    .ca-primary-menu a::after {
        position: static;
        display: block;
        width: 8px !important;
        height: 8px;
        margin: 0 4px 0 18px;
        border-top: 2px solid #73787d;
        border-right: 2px solid #73787d;
        background: transparent;
        transform: rotate(45deg);
    }

    .ca-primary-menu .current-menu-item > a {
        color: #c96c00;
    }

    .ca-account-button,
    .ca-account-button.ca-button,
    .ca-account-button.ca-button-primary {
        width: 100%;
        margin-top: 30px;
        justify-content: flex-start;
    }

    .ca-offcanvas-footer {
        display: grid !important;
        min-height: 78px;
        padding: 17px 22px;
        border-top: 1px solid #e2e5e7;
        color: #73787d;
        background: #f5f6f7;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 18px;
        font-size: 0.77rem;
    }

    .ca-offcanvas-footer a {
        color: #303438;
        font-weight: 700;
        text-decoration: none;
    }

    /*
     * Separates Overlay unterhalb des Drawers.
     */
    .ca-menu-overlay {
        position: fixed !important;
        z-index: 1220;
        inset: 0 !important;
        display: block !important;
        width: 100vw !important;
        height: 100dvh !important;
        padding: 0;
        border: 0 !important;
        background: rgba(25, 31, 37, 0.58) !important;
        opacity: 0;
        pointer-events: none;
        backdrop-filter: blur(4px);
        transition: opacity 220ms ease;
    }

    .ca-menu-overlay::before {
        display: none !important;
    }

    .ca-menu-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 480px) {
    .ca-primary-navigation {
        width: min(94vw, 390px) !important;
    }
}
