/* Mobile Nav Bar — mobile-nav.css */

/* ---- Pohjanavigaatiopalkki ------------------------------------ */

.mnb-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99998;
    background: var(--mnb-bg, #fff);
    margin: 0;
    padding: 0;
}

.mnb-bar--bottom { bottom: 0; box-shadow: 0 -1px 0 rgba(0,0,0,.08), 0 -4px 12px rgba(0,0,0,.07); }
.mnb-bar--top    { top: 0;    box-shadow: 0 1px 0 rgba(0,0,0,.08),  0 4px 12px rgba(0,0,0,.07); }

/* ---- Painike -------------------------------------------------- */

.mnb-bar .mnb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 56px;
    padding: 6px 4px 4px;
    gap: 3px;
    color: var(--mnb-text, #666);
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease;
}

.mnb-bar .mnb-btn + .mnb-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 22%; height: 56%; width: 1px;
    background: rgba(0,0,0,.07);
    pointer-events: none;
}

.mnb-bar .mnb-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mnb-bar .mnb-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

.mnb-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 74px;
    display: block;
}

.mnb-bar .mnb-btn:hover,
.mnb-bar .mnb-btn:active,
.mnb-bar .mnb-btn:focus-visible,
.mnb-bar .mnb-btn--hamburger.is-open { color: var(--mnb-active, #cc0000); outline: none; }

.mnb-bar .mnb-btn:hover svg,
.mnb-bar .mnb-btn:active svg { transform: scale(1.2) translateY(-1px); }

.mnb-bar .mnb-btn--hamburger.is-open svg { transform: scale(1.1); }

/* ---- Overlay — position:fixed, sisältää paneelinkin ----------- */

.mnb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.5);
    opacity: 0;
    transition: opacity .28s ease;
    cursor: pointer;
}
.mnb-overlay.is-visible { display: block; }
.mnb-overlay.is-active  { opacity: 1; }

/* ---- Paneeli — nousee alhaalta oikeasta reunasta -------------- */

.mnb-panel {
    display: none;
    position: absolute;
    bottom: 0;
    right: 0;
    width: min(300px, 88vw);
    max-height: 70vh;
    background: var(--mnb-panel-bg, #fff);
    color: var(--mnb-panel-text, #1a1a1a);
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: -4px -4px 20px rgba(0,0,0,.15);
    border-radius: 12px 0 0 0;
    cursor: default;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.mnb-overlay.is-active .mnb-panel {
    display: flex;
    transform: translateY(0);
}

/* ---- Valikkolinkit -------------------------------------------- */

.mnb-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 8px;
    flex: 1;
}
.mnb-menu li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.mnb-menu li a {
    flex: 1;
    display: block;
    padding: 14px 20px;
    color: var(--mnb-panel-text, #1a1a1a);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    transition: color .15s, background .15s;
}
.mnb-menu li a:hover { color: var(--mnb-panel-accent, #cc0000); background: rgba(0,0,0,.02); }

.mnb-sub-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 50px;
    background: none;
    border: none;
    border-left: 1px solid rgba(0,0,0,.06);
    cursor: pointer;
    color: var(--mnb-panel-text, #1a1a1a);
    -webkit-tap-highlight-color: transparent;
    opacity: .5;
    transition: opacity .15s, color .15s, transform .25s ease;
}
.mnb-sub-toggle:hover { opacity: 1; }
.mnb-menu li.is-open > .mnb-sub-toggle { transform: rotate(180deg); color: var(--mnb-panel-accent, #cc0000); opacity: 1; }

.mnb-menu .sub-menu {
    display: none;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0,0,0,.025);
}
.mnb-menu li.is-open > .sub-menu    { display: block; }
.mnb-menu .sub-menu li a            { padding-left: 32px; font-size: 14px; font-weight: 400; }
.mnb-menu .sub-menu .sub-menu li a  { padding-left: 44px; }

.mnb-no-menu     { padding: 20px; font-size: 14px; color: rgba(0,0,0,.5); }
.mnb-no-menu a   { color: var(--mnb-panel-accent, #cc0000); }
