/*
 * Hegau24 — Header Actions + Menu Drawer
 */

/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.hegau-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hegau-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    text-decoration: none;
    cursor: pointer;
}

.hegau-action img {
    width: 20px;
    height: 20px;
    display: block;
}


/* =========================================================
   DRAWER — BASE
   ========================================================= */

.hegau-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;

    width: 380px;
    max-width: 90vw;

    background: #ffffff;

    z-index: 10001;

    box-shadow: -12px 0 35px rgba(0, 0, 0, 0.14);

    transform: translateX(105%);
    visibility: hidden;
    opacity: 0;

    transition:
        transform 0.28s ease,
        opacity 0.2s ease,
        visibility 0s linear 0.28s;

    overflow-y: auto;
    overflow-x: hidden;

    -webkit-overflow-scrolling: touch;
}

.hegau-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;

    transition:
        transform 0.28s ease,
        opacity 0.2s ease,
        visibility 0s linear 0s;
}


/* =========================================================
   DRAWER INNER
   ========================================================= */

.hegau-drawer__inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}


/* =========================================================
   DRAWER HEADER
   ========================================================= */

.hegau-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 72px;
    padding: 0 24px;

    border-bottom: 1px solid #e8edf2;
}

.hegau-drawer__title {
    margin: 0;

    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;

    color: #17324d;
}

.hegau-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: #17324d;

    font-size: 30px;
    line-height: 1;
    font-weight: 400;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.hegau-drawer__close:hover,
.hegau-drawer__close:focus-visible {
    background: #f1f5f8;
    color: #0d6efd;
    outline: none;
}


/* =========================================================
   DRAWER NAVIGATION
   ========================================================= */

.hegau-drawer__nav {
    flex: 1;
    padding: 14px 0 28px;
}

.hegau-drawer__menu {
    margin: 0;
    padding: 0;

    list-style: none;
}

.hegau-drawer__menu > li {
    margin: 0;
    padding: 0;
}

.hegau-drawer__menu > li > a {
    display: flex;
    align-items: center;

    min-height: 52px;

    padding: 12px 24px;

    color: #17324d;

    font-size: 17px;
    line-height: 1.35;
    font-weight: 500;

    text-decoration: none;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        padding-left 0.15s ease;
}

.hegau-drawer__menu > li > a:hover,
.hegau-drawer__menu > li > a:focus-visible {
    background: #f4f7fa;
    color: #0d6efd;
    padding-left: 28px;
    outline: none;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.hegau-drawer-overlay {
    position: fixed;
    inset: 0;

    background: rgba(15, 27, 39, 0.48);

    z-index: 10000;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0s linear 0.25s;
}

.hegau-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition:
        opacity 0.25s ease,
        visibility 0s linear 0s;
}


/* =========================================================
   BODY LOCK WHILE DRAWER IS OPEN
   ========================================================= */

body.hegau-drawer-open {
    overflow: hidden;
}


/* =========================================================
   MOBILE
   ========================================================= */

/* Desktop: hamburger menu is not needed because primary navigation is visible. */
@media (min-width: 768px) {
    .hegau-menu-toggle {
        display: none;
    }
}

@media (max-width: 767px) {

    .hegau-actions {
        gap: 14px;
    }

    .hegau-action {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .hegau-action img {
        width: 21px;
        height: 21px;
    }

    .hegau-drawer {
        width: 88vw;
        max-width: 420px;
    }

    .hegau-drawer__header {
        min-height: 64px;
        padding: 0 18px;
    }

    .hegau-drawer__title {
        font-size: 20px;
    }

    .hegau-drawer__close {
        width: 44px;
        height: 44px;

        font-size: 30px;
    }

    .hegau-drawer__nav {
        padding-top: 10px;
    }

    .hegau-drawer__menu > li > a {
        min-height: 56px;

        padding: 14px 20px;

        font-size: 18px;
    }

    .hegau-drawer__menu > li > a:hover,
    .hegau-drawer__menu > li > a:focus-visible {
        padding-left: 24px;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 420px) {

    .hegau-drawer {
        width: 92vw;
    }

    .hegau-drawer__header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hegau-drawer__menu > li > a {
        padding-left: 18px;
        padding-right: 18px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

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

    .hegau-drawer,
    .hegau-drawer-overlay,
    .hegau-drawer__menu > li > a,
    .hegau-drawer__close {
        transition: none;
    }

}

/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.hegau-notifications {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;

    width: 360px;
    max-width: calc(100vw - 32px);

    background: #ffffff;
    border: 1px solid #e6ebf0;
    border-radius: 14px;

    box-shadow: 0 14px 35px rgba(15, 27, 39, 0.14);

    z-index: 10002;

    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0.18s;

    overflow: hidden;
}

.hegau-notifications__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 58px;
    padding: 0 16px;

    border-bottom: 1px solid #e8edf2;
}

.hegau-notifications__title {
    color: #17324d;

    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}

.hegau-notifications__close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #17324d;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
}

.hegau-notifications__close:hover,
.hegau-notifications__close:focus-visible {
    background: #f1f5f8;
    color: #0d6efd;
    outline: none;
}

.hegau-notifications__list {
    padding: 4px 0;
}

.hegau-notification {
    display: flex;
    gap: 12px;

    padding: 14px 16px;

    border-bottom: 1px solid #f0f3f6;
}

.hegau-notification:last-child {
    border-bottom: 0;
}

.hegau-notification__dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;

    margin-top: 6px;

    border-radius: 50%;
    background: #168a3a;
}

.hegau-notification__content {
    display: flex;
    flex-direction: column;
    gap: 3px;

    min-width: 0;
}

.hegau-notification__content strong {
    color: #17324d;

    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
}

.hegau-notification__content span {
    color: #52677b;

    font-size: 13px;
    line-height: 1.4;
}

.hegau-notification__content small {
    color: #8a99a8;

    font-size: 12px;
    line-height: 1.3;
}

.hegau-notifications__footer {
    padding: 12px 16px;

    border-top: 1px solid #e8edf2;
}

.hegau-notifications__footer a {
    color: #168a3a;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;
}

.hegau-notifications__footer a:hover,
.hegau-notifications__footer a:focus-visible {
    color: #0d6efd;
    text-decoration: underline;
}

.hegau-actions {
    position: relative;
}

@media (max-width: 767px) {

    .hegau-notifications {
        position: fixed;

        top: 72px;
        right: 16px;
        left: 16px;

        width: auto;
        max-width: none;
    }
}



/* =========================================================
   NOTIFICATIONS — OPEN STATE
   ========================================================= */

.hegau-notifications.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0s;
}


/* Prevent hidden mobile drawer from creating horizontal page overflow */
@media (max-width: 767px) {
    html,
    body {
        overflow-x: hidden;
    }
}

/* =========================================================
   HEGAU24 — ACCOUNT AVATAR
   ========================================================= */

.hegau-account--avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    text-decoration: none;
}

.hegau-account__avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 50%;
    background: var(--hegau-avatar-color);

    color: #ffffff;

    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;

    user-select: none;
}

.hegau-account--avatar:hover .hegau-account__avatar,
.hegau-account--avatar:focus-visible .hegau-account__avatar {
    filter: brightness(0.92);
}

.hegau-account--avatar:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 50%;
}

@media (max-width: 767px) {
    .hegau-account__avatar {
        width: 30px;
        height: 30px;

        font-size: 12px;
    }
}
