/*--------------------------------------------------------------
Mobilni meni preko celog ekrana (function/mobilni-meni.php + js/mobilni-meni.js)
Važi do 959px - isto kad i UberMenu prelazi na mobilni prikaz.
--------------------------------------------------------------*/
.fm-burger,
.fm-nav { display: none; }

@media (max-width: 959px) {
    /* UberMenu na telefonu se ne koristi - zamenjuje ga ovaj meni */
    .ubermenu-responsive-toggle,
    .navbar .ubermenu-main { display: none !important; }

    /* dugme se pozicionira u odnosu na .navbar (ne .container - logo je apsolutan sa height:100% pa bi se pomerio) */
    .navbar:not(.navbar-fixed-top) { position: relative; }
    .navbar > .container { min-height: 78px; }
    .fm-burger {
        position: absolute;
        top: 50%;
        right: 15px;
        z-index: 5;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 46px;
        height: 46px;
        margin-top: -23px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .fm-burger span {
        display: block;
        width: 20px;
        height: 2.5px;
        border-radius: 2px;
        background: #0b2a44;
    }
    .fm-burger:active span { background: #04b0ef; }

    html.fm-open,
    html.fm-open body { overflow: hidden; }

    .fm-nav {
        position: fixed;
        inset: 0;
        z-index: 100000;
        display: flex;
        flex-direction: column;
        background: #fff;
        opacity: 0;
        transform: translateY(12px);
        transition: opacity .25s ease, transform .25s ease;
    }
    .fm-nav[hidden] { display: none; }
    html.fm-open .fm-nav { opacity: 1; transform: none; }
    body.admin-bar .fm-nav { top: 46px; }

    .fm-nav__top {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 68px;
        padding: calc(10px + env(safe-area-inset-top, 0px)) 15px 10px 20px;
        border-bottom: 1px solid #eef2f6;
    }
    .fm-nav__logo img { display: block; width: auto; max-width: 140px; height: 44px; object-fit: contain; }
    .fm-nav__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #0b2a44;
        cursor: pointer;
    }
    .fm-nav__close svg { width: 28px; height: 28px; }
    .fm-nav__close:active { color: #04b0ef; }

    /* paneli: svaki nivo je nova kartica koja ulazi sa desne strane */
    .fm-nav__paneli { position: relative; flex: 1; overflow: hidden; }
    .fm-panel {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        background: #fff;
        transform: translateX(104%);
        visibility: hidden;
        transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .32s, opacity .32s ease;
        box-shadow: -14px 0 32px rgba(11, 42, 68, .12);
    }
    .fm-panel[data-fm-root] { box-shadow: none; }
    .fm-panel.is-current { transform: none; visibility: visible; transition-delay: 0s; }
    .fm-panel.is-behind {
        transform: translateX(-24%);
        visibility: visible;
        opacity: .35;
        transition-delay: 0s;
        pointer-events: none;
    }

    .fm-panel__head {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 22px 20px 14px;
    }
    .fm-panel__head strong {
        color: #111827;
        font-size: 24px;
        font-weight: 800;
        line-height: 1.15;
    }
    .fm-panel__all {
        flex: none;
        padding: 8px 14px;
        border-radius: 999px;
        background: #e3f5fd;
        color: #0879a5;
        font-size: 13px;
        font-weight: 800;
        text-decoration: none;
    }
    .fm-panel__all:hover,
    .fm-panel__all:focus { color: #0879a5; text-decoration: none; }

    .fm-panel__list {
        flex: 1;
        margin: 0;
        padding: 0 0 10px;
        list-style: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .fm-panel__list li { margin: 0; border-top: 1px solid #eef2f6; }
    .fm-panel__list li:last-child { border-bottom: 1px solid #eef2f6; }
    .fm-row {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 56px;
        padding: 12px 20px;
        border: 0;
        background: none;
        color: #0b2a44;
        font-size: 17px;
        font-weight: 700;
        line-height: 1.3;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .fm-row span { flex: 1; color: inherit; font: inherit; }
    .fm-row i {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #e3f5fd;
        color: #04b0ef;
    }
    .fm-row:hover { color: #0879a5; text-decoration: none; }
    .fm-nav a.fm-row:focus,
    .fm-nav button.fm-row:focus { color: #0b2a44; text-decoration: none; }
    .fm-row:active { background: #f5fbff; }
    .fm-row:focus-visible { outline: 2px solid #04b0ef; outline-offset: -2px; }

    /* dole: Nazad / kontakt */
    .fm-panel__foot {
        flex: none;
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        border-top: 1px solid #dfe7ee;
        background: #fff;
    }
    .fm-back {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
        min-height: 58px;
        padding: 0 20px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #0879a5;
        font-size: 16px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .fm-back:active { background: #f5fbff; }

}

/* telefon i tablet: bez gornje trake (radno vreme / telefoni) */
@media (max-width: 991px) {
    div#top-menu { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .fm-nav, .fm-panel { transition: none; }
}

/* skriveni paneli Kontakt / Filteri stoje van ekrana sa velikom senkom koja se videla uz desnu ivicu -
   senka samo dok su otvoreni */
div#s-share:not(.share-open),
div#mob-filter:not(.share-open-filteri) { box-shadow: none; }

/* dok je meni otvoren: bez plutajuće trake */
html.fm-open #floating-bar { display: none !important; }
