/**
 * Mobile Drawer Navigation
 *
 * Full-screen slide-in drawer nav for ≤899px viewports.
 * Replaces parent theme's bare slideToggle() dropdown with
 * a modern mobile experience: magenta hamburger pill, dark-blue
 * drawer panel, smooth transitions, scroll lock.
 *
 * Structure (built via JS):
 *   .uksr-drawer-overlay   — dark backdrop
 *   .uksr-drawer            — slide-in panel (right)
 *     .uksr-drawer__header  — logo + close btn
 *     .uksr-drawer__nav     — cloned nav links
 *     .uksr-drawer__cta     — bottom CTA button
 *
 * @version 1.16.1
 */


/* ================================================================
   1. HAMBURGER BUTTON — magenta pill, CSS bars
   ================================================================ */

/* Always present but only visible on mobile */
.menu_icon.nav-toggle {
    display: none;
}

@media (max-width: 899px) {
    .menu_icon.nav-toggle {
        display: flex !important; /* beats parent inline style="display:inline" */
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        background: var(--uksr-magenta, #E6007E) !important;
        background-image: none !important;
        border-radius: 12px;
        border: none;
        cursor: pointer;
        position: relative;
        float: right;
        margin: 0;
        padding: 0;
        z-index: 10;
        transition: background 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .menu_icon.nav-toggle:hover,
    .menu_icon.nav-toggle:focus {
        background: var(--uksr-magenta-dark, #b80064) !important;
        outline: none;
    }

    /* Kill any parent theme text/content inside */
    .menu_icon.nav-toggle span,
    .menu_icon.nav-toggle .menu_icon_text {
        display: none !important;
    }

    /* CSS hamburger bars via pseudo-elements + box-shadow */
    .menu_icon.nav-toggle::before {
        content: '';
        display: block;
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        box-shadow:
            0 -7px 0 #fff,
            0 7px 0 #fff;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    /* X state when drawer is open */
    body.uksr-drawer-open .menu_icon.nav-toggle::before {
        transform: rotate(45deg);
        box-shadow:
            0 0 0 #fff,
            0 0 0 #fff;
    }

    body.uksr-drawer-open .menu_icon.nav-toggle::after {
        content: '';
        position: absolute;
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transform: rotate(-45deg);
    }
}


/* ================================================================
   2. DRAWER OVERLAY — dark backdrop
   ================================================================ */

.uksr-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 50, 0.6);
    z-index: var(--uksr-z-drawer-overlay, 1350);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.uksr-drawer-overlay--active {
    display: block;
    opacity: 1;
}


/* ================================================================
   3. DRAWER PANEL — slide-in from right
   ================================================================ */

.uksr-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 380px;
    background: #3D3578;
    z-index: var(--uksr-z-drawer, 1400);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.uksr-drawer--open {
    transform: translateX(0);
}


/* ================================================================
   4. DRAWER HEADER — logo + close button
   ================================================================ */

.uksr-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.uksr-drawer__header img {
    max-height: 44px;
    width: auto;
}

.uksr-drawer__logo {
    filter: brightness(0) invert(1);
}

/* Close button */
.uksr-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.uksr-drawer__close:hover,
.uksr-drawer__close:focus {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

/* X icon via rotated pseudo-elements */
.uksr-drawer__close::before,
.uksr-drawer__close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.uksr-drawer__close::before {
    transform: rotate(45deg);
}

.uksr-drawer__close::after {
    transform: rotate(-45deg);
}


/* ================================================================
   5. DRAWER NAV LINKS
   ================================================================ */

.uksr-drawer__nav {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
}

.uksr-drawer__nav li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.uksr-drawer__nav li a {
    display: block;
    padding: 14px 24px;
    font-family: var(--uksr-font-primary) !important;
    font-size: 16px;
    font-weight: 500;
    color: #fff !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.uksr-drawer__nav li a:hover,
.uksr-drawer__nav li a:focus {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 28px;
    color: #fff !important;
}

/* Current page highlight — magenta left border */
.uksr-drawer__nav li.current-menu-item a,
.uksr-drawer__nav li.current_page_item a {
    border-left: 4px solid var(--uksr-magenta, #E6007E);
    padding-left: 20px;
    background: rgba(230, 0, 126, 0.08);
}


/* ================================================================
   6. BODY SCROLL LOCK
   ================================================================ */

body.uksr-drawer-open {
    overflow: hidden !important;
}


/* ================================================================
   8. MOBILE HEADER LAYOUT — hide parent elements
   ================================================================ */

@media (max-width: 899px) {

    /* Hide top bar on mobile to save space */
    .header_top {
        display: none;
    }

    /* Kill parent's slideToggle dropdown entirely */
    .header_nav {
        display: none !important;
    }

    /* Hide mega-nav on mobile */
    .site_navigation {
        display: none !important;
    }

    /* Header bottom — flex row, logo left, hamburger right */
    .header_bottom {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: auto;
        padding: 10px 16px;
    }

    .header_bottom .grid {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0;
    }

    /* Logo sizing on mobile */
    .header_bottom .logo img {
        max-height: 50px;
        width: auto;
    }

    /* Partner bar already hidden via header-overrides.css */
}
