/* ============================================================
   LCUS Mobile Menu — Hamburger + Slide-out Drawer
   Only visible on screens ≤ 768px
   ============================================================ */

/* ── Hamburger Button ── */
.lcus-hamburger {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 10000;
    background: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 10px 11px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s;
}

.lcus-hamburger:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.lcus-hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Animate to X */
.lcus-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.lcus-hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.lcus-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ── Dark Overlay ── */
.lcus-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ── Slide-out Drawer ── */
.lcus-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

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

/* ── Drawer Header ── */
.lcus-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.lcus-drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lcus-drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.lcus-drawer-close:hover {
    color: #333;
}

/* ── Drawer Navigation ── */
.lcus-drawer-nav {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lcus-drawer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lcus-drawer-list li {
    border-bottom: 1px solid #f3f3f3;
}

.lcus-drawer-list li a {
    display: block;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, padding-left 0.2s;
}

.lcus-drawer-list li a:hover,
.lcus-drawer-list li a:focus {
    background: #f7f7f7;
    padding-left: 26px;
    color: #111;
}

/* Current/active page */
.lcus-drawer-list li.current-menu-item > a,
.lcus-drawer-list li.current_page_item > a {
    font-weight: 700;
    color: #0066cc;
    border-left: 3px solid #0066cc;
}

/* ── Sub-menus (if any) ── */
.lcus-drawer-list ul.sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fafafa;
}

.lcus-drawer-list ul.sub-menu li a {
    padding-left: 36px;
    font-size: 14px;
    font-weight: 400;
    color: #555;
}

.lcus-drawer-list ul.sub-menu li a:hover {
    padding-left: 42px;
    color: #111;
}

/* ── Show only on mobile ── */
@media (max-width: 768px) {
    .lcus-hamburger {
        display: flex;
    }

    /* Hide the existing theme navigation */
    .cri-one-header .navbar-nav,
    .cri-one-header .nav,
    .lcus-scroll-menu-wrap {
        display: none !important;
    }

    /* Push the logo/site-title over to make room for hamburger */
    .cri-one-header .site-title,
    .cri-one-header .site-branding {
        margin-left: 56px;
    }

    /* If header uses flexbox, adjust */
    .cri-one-header .d-flex {
        justify-content: flex-start;
    }

    .cri-one-header .container {
        padding-left: 56px;
    }
}

/* WordPress admin bar offset */
.admin-bar .lcus-hamburger {
    top: 60px;
}

.admin-bar .lcus-drawer {
    top: 46px;
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
}

@media (max-width: 782px) {
    .admin-bar .lcus-hamburger {
        top: 60px;
    }

    .admin-bar .lcus-drawer {
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
}

/* ── Prevent body scroll when drawer is open ── */
body.lcus-menu-open {
    overflow: hidden;
}
