/* Arrow in nav label */
.mega-arrow { font-size: 0.7em; margin-left: 6px; transition: transform .2s ease; }

/* WRAPPER */
.peonixis-mobile-menu-wrapper { position: relative; z-index: 999998; }

/* HAMBURGER BUTTON */
.peonixis-mobile-hamburger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 26px;
    color: #000;
    z-index: 999999;
}

/* FULLSCREEN OVERLAY + PANEL CONTAINER */
.peonixis-mobile-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.55);
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease;
    display: flex;
    justify-content: flex-end; /* align panel to the right */
    align-items: stretch;
    z-index: 1000000; /* above most themes */
    pointer-events: none;
    overflow: hidden;
}


/* HIDE WHEN [hidden] APPLIED */
.peonixis-mobile-canvas[hidden] {
    display: none !important;
}

/* WHEN OPEN */
.peonixis-mobile-canvas.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* PANEL FULL-WIDTH */
.peonixis-mobile-canvas-inner {
    width: 100vw;
    max-width: none;
    height: 100%;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow: hidden; /* content scrolls inside content area */
    display: flex;
    flex-direction: column;
}


/* SLIDE IN PANEL WHEN PARENT IS OPEN */
.peonixis-mobile-canvas.open .peonixis-mobile-canvas-inner {
    transform: translateX(0);
}


/* TOP BAR */
.peonixis-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.peonixis-mobile-logo img { max-height: 30px; height: 30px; width: auto; }
.peonixis-mobile-logo .custom-logo-link { display: inline-flex; align-items: center; }

/* CLOSE BUTTON */
.peonixis-mobile-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 28px;
    color: #000;
}

/* CONTENT AREA */
.peonixis-mobile-canvas-content {
    padding: 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}


/* Hide desktop nav on mobile (phones only) */
@media (max-width: 767px) {
    .peonixis-nav,
    .peonixis-mega-wrapper {
        display: none !important;
    }
    /* Ensure the offcanvas fills the viewport on mobile */
    .peonixis-mobile-canvas { display: flex; }
}


/***** Tablet and up: menu + mega dropdown *****/
@media (min-width: 768px) {
    .peonixis-mobile-hamburger { display: none; }

    .peonixis-header { position: relative; z-index: 10; }

    /* Inline nav, no bullets, no underline */
    .peonixis-nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; align-items: center; }
    .peonixis-nav li { display: inline-block; }
    .peonixis-nav a { text-decoration: none; color: inherit; display: inline-block; padding: 10px 0; }

    /* Mega dropdown wrapper: full viewport width, fixed, collapsed by default.
       JS sets the 'top' dynamically to sit under the header. */
    .peonixis-mega-wrapper {
        position: fixed;
        left: 0; right: 0;
        top: 0; /* will be overridden by JS each time it's shown */
        width: 100vw;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
        background: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        z-index: 9999;
    }

    /* Individual mega sections */
    .peonixis-mega-section { display: none; padding: 20px; border-top: 1px solid #eee; }
    .peonixis-mega-section.active { display: block; }
}
