/* ============================================================
   MKTECHSUPPORT V2 — PUBLIC TOPBAR
   ============================================================

   Layout:
   [ Menu ] [ Logo + Name + Slogan ]      [ Login ]

   Logo:
   /assets/images/mktechsupport-logo.png

   Sidebar:
   #mk-public-sidebar

   ============================================================ */


/* ============================================================
   01. TOPBAR
   ============================================================ */

.mk-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;

    z-index: 800;

    width: 100%;
    height: var(--mk-topbar-height, 82px);

    background: rgba(255, 255, 255, 0.98);

    border-bottom: 1px solid
        var(--mk-border-light, #e2eaf3);

    box-shadow:
        0 2px 10px rgba(8, 27, 52, 0.06);

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    transition:
        border-color var(--mk-transition, 0.2s ease),
        box-shadow var(--mk-transition, 0.2s ease),
        background-color var(--mk-transition, 0.2s ease);
}


/* ============================================================
   02. THREE-COLUMN LAYOUT
   ============================================================ */

.mk-topbar__inner {
    display: grid;

    grid-template-columns:
        48px
        minmax(0, 1fr)
        48px;

    align-items: center;

    gap: 12px;

    width: min(
        calc(100% - 2rem),
        var(--mk-container, 1200px)
    );

    height: 100%;

    margin-inline: auto;
}


/* ============================================================
   03. LEFT HAMBURGER AREA
   ============================================================ */

.mk-topbar__start {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    min-width: 0;
}


/* ============================================================
   04. HAMBURGER BUTTON
   ============================================================ */

.mk-topbar__menu-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;
    border-radius: var(--mk-radius-md, 12px);

    background: transparent;

    color: #081b34;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition:
        background-color var(--mk-transition, 0.2s ease),
        color var(--mk-transition, 0.2s ease),
        transform var(--mk-transition, 0.2s ease);
}

.mk-topbar__menu-button:hover {
    background: #eaf2ff;
    color: #1769e0;
}

.mk-topbar__menu-button:active {
    transform: scale(0.96);
}


/* ============================================================
   05. HAMBURGER ICON
   ============================================================ */

.mk-topbar__menu-icon {
    position: relative;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 5px;

    width: 22px;
    height: 22px;

    pointer-events: none;
}

.mk-topbar__menu-line {
    display: block;

    width: 22px;
    height: 2px;

    flex: 0 0 auto;

    border-radius: 999px;

    background: currentColor;

    transform-origin: center;

    transition:
        transform var(--mk-transition, 0.2s ease),
        opacity var(--mk-transition, 0.2s ease),
        width var(--mk-transition, 0.2s ease);
}


/* ============================================================
   06. HAMBURGER OPEN ANIMATION
   ============================================================ */

.mk-topbar__menu-button[aria-expanded="true"]
.mk-topbar__menu-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mk-topbar__menu-button[aria-expanded="true"]
.mk-topbar__menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mk-topbar__menu-button[aria-expanded="true"]
.mk-topbar__menu-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   07. BRAND — LEFT ALIGNED
   ============================================================ */

.mk-topbar__brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    justify-self: start;

    min-width: 0;
    max-width: 100%;
}

.mk-topbar__brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;

    gap: 12px;

    min-width: 0;
    max-width: 100%;

    color: #081b34;

    text-decoration: none;

    transition: color 0.2s ease;
}

.mk-topbar__brand-link:hover {
    color: #1769e0;
}


/* ============================================================
   08. LOGO
   ============================================================ */

.mk-topbar__logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 54px;
    height: 54px;

    overflow: hidden;
}

.mk-topbar__logo {
    display: block;

    width: 54px;
    height: 54px;

    max-width: 100%;

    object-fit: contain;
}


/* ============================================================
   09. BRAND TEXT WRAPPER
   ============================================================ */

.mk-topbar__brand-copy {
    display: flex;
    flex-direction: column;

    align-items: flex-start;
    justify-content: center;

    min-width: 0;
    max-width: 100%;
}


/* ============================================================
   10. LARGE COMPANY NAME
   ============================================================ */

.mk-topbar__brand-text {
    display: block;

    min-width: 0;
    max-width: 100%;

    margin: 0;
    padding: 0;

    color: #081b34;

    font-size: 1.75rem;
    font-weight: 900;

    line-height: 1.1;
    letter-spacing: -0.045em;

    white-space: nowrap;

    transition: color 0.2s ease;
}

.mk-topbar__brand-link:hover
.mk-topbar__brand-text {
    color: #1769e0;
}


/* ============================================================
   11. SMALL SLOGAN
   ============================================================ */

.mk-topbar__brand-slogan {
    display: block;

    margin-top: 5px;

    color: #1769e0;

    font-size: 0.72rem;
    font-weight: 800;

    line-height: 1.35;
    letter-spacing: 0.12em;

    text-transform: uppercase;
    white-space: nowrap;
}


/* ============================================================
   12. RIGHT-SIDE ACTIONS
   ============================================================ */

.mk-topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    justify-self: end;

    gap: 0.35rem;

    min-width: 0;
}


/* ============================================================
   13. ACTION BUTTONS
   ============================================================ */

.mk-topbar__action {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 44px;
    height: 44px;

    padding: 0;

    border-radius: var(--mk-radius-md, 12px);

    color: #081b34;

    text-decoration: none;

    -webkit-tap-highlight-color: transparent;

    transition:
        background-color var(--mk-transition, 0.2s ease),
        color var(--mk-transition, 0.2s ease),
        transform var(--mk-transition, 0.2s ease);
}

.mk-topbar__action:hover {
    background: #dceaff;
    color: #1769e0;
}

.mk-topbar__action:active {
    transform: scale(0.96);
}


/* ============================================================
   14. LOGIN BUTTON — ALWAYS VISIBLE
   ============================================================ */

#mk-public-topbar .mk-topbar__account {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    background: #eaf2ff;

    color: #081b34;

    border: 1px solid #cbdcf5;
    border-radius: 12px;

    opacity: 1;
    visibility: visible;
}

#mk-public-topbar .mk-topbar__account:hover {
    background: #1769e0;

    color: #ffffff;

    border-color: #1769e0;
}


/* ============================================================
   15. LOGIN ICON — FORCE NAVY COLOUR
   ============================================================ */

#mk-public-topbar .mk-topbar__account
.mk-topbar__action-icon,
#mk-public-topbar .mk-topbar__account svg {
    display: block;

    width: 24px;
    height: 24px;

    flex: 0 0 auto;

    color: #081b34;

    fill: currentColor;

    opacity: 1;
    visibility: visible;
}

#mk-public-topbar .mk-topbar__account
.mk-topbar__action-icon path,
#mk-public-topbar .mk-topbar__account svg path {
    fill: currentColor;
}

#mk-public-topbar .mk-topbar__account:hover svg {
    color: #ffffff;
}


/* ============================================================
   16. OPTIONAL NOTIFICATION BADGE
   ============================================================ */

.mk-topbar__badge {
    position: absolute;

    top: 3px;
    right: 2px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 18px;
    height: 18px;

    padding: 0 4px;

    border: 2px solid #ffffff;
    border-radius: 999px;

    background: var(--mk-danger, #dc3545);

    color: #ffffff;

    font-size: 0.65rem;
    font-weight: 700;

    line-height: 1;

    pointer-events: none;
}


/* ============================================================
   17. SCROLLED STATE
   ============================================================ */

.mk-topbar.is-scrolled {
    border-bottom-color:
        var(--mk-border, #d8e2ee);

    box-shadow:
        0 4px 16px rgba(16, 24, 40, 0.08);
}


/* ============================================================
   18. SIDEBAR OPEN STATE
   ============================================================ */

body.mk-sidebar-open .mk-topbar {
    box-shadow: none;
}


/* ============================================================
   19. KEYBOARD ACCESSIBILITY
   ============================================================ */

.mk-topbar__menu-button:focus-visible,
.mk-topbar__brand-link:focus-visible,
.mk-topbar__action:focus-visible {
    outline: 3px solid var(--mk-focus, #08b6b2);
    outline-offset: 2px;
}


/* ============================================================
   20. LARGE DESKTOP
   ============================================================ */

@media (min-width: 1200px) {

    .mk-topbar__logo-wrap,
    .mk-topbar__logo {
        width: 60px;
        height: 60px;
    }

    .mk-topbar__brand-text {
        font-size: 2rem;
    }

    .mk-topbar__brand-slogan {
        font-size: 0.76rem;
    }

}


/* ============================================================
   21. TABLET
   ============================================================ */

@media (min-width: 641px) and (max-width: 900px) {

    .mk-topbar__inner {
        width: min(
            calc(100% - 1.5rem),
            var(--mk-container, 1200px)
        );
    }

    .mk-topbar__brand-link {
        gap: 10px;
    }

    .mk-topbar__logo-wrap,
    .mk-topbar__logo {
        width: 46px;
        height: 46px;
    }

    .mk-topbar__brand-text {
        font-size: 1.35rem;
    }

    .mk-topbar__brand-slogan {
        font-size: 0.61rem;
        letter-spacing: 0.08em;
    }

}


/* ============================================================
   22. MOBILE
   ============================================================ */

@media (max-width: 640px) {

    .mk-topbar__inner {
        grid-template-columns:
            42px
            minmax(0, 1fr)
            42px;

        gap: 7px;

        width: calc(100% - 1rem);
    }

    .mk-topbar__menu-button,
    .mk-topbar__action {
        width: 42px;
        height: 42px;
    }

    .mk-topbar__brand-link {
        gap: 7px;
    }

    .mk-topbar__logo-wrap,
    .mk-topbar__logo {
        width: 34px;
        height: 34px;
    }

    .mk-topbar__brand-text {
        font-size: clamp(
            0.82rem,
            3.4vw,
            1.15rem
        );
    }

    .mk-topbar__brand-slogan {
        margin-top: 3px;

        font-size: clamp(
            0.42rem,
            1.7vw,
            0.56rem
        );

        letter-spacing: 0.025em;
    }

    #mk-public-topbar .mk-topbar__account {
        width: 42px;
        height: 42px;
    }

    #mk-public-topbar .mk-topbar__account svg {
        width: 23px;
        height: 23px;
    }

}


/* ============================================================
   23. VERY SMALL SCREENS
   ============================================================ */

@media (max-width: 380px) {

    .mk-topbar__inner {
        gap: 5px;
        width: calc(100% - 0.75rem);
    }

    .mk-topbar__brand-link {
        gap: 5px;
    }

    .mk-topbar__logo-wrap,
    .mk-topbar__logo {
        width: 27px;
        height: 27px;
    }

    .mk-topbar__brand-text {
        font-size: 0.74rem;
    }

    .mk-topbar__brand-slogan {
        font-size: 0.38rem;
        letter-spacing: 0;
    }

}


/* ============================================================
   24. EXTREMELY NARROW SCREENS
   ============================================================ */

@media (max-width: 340px) {

    .mk-topbar__brand-text {
        font-size: 0.66rem;
    }

    .mk-topbar__brand-slogan {
        font-size: 0.34rem;
    }

}


/* ============================================================
   25. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .mk-topbar,
    .mk-topbar__menu-line,
    .mk-topbar__menu-button,
    .mk-topbar__brand-link,
    .mk-topbar__brand-text,
    .mk-topbar__action {
        transition: none;
    }

}


/* ============================================================
   26. PRINT
   ============================================================ */

@media print {

    .mk-topbar {
        display: none !important;
    }

}

/* ============================================================
   END OF TOPBAR CSS
   ============================================================ */
