/*
 * StarMaster Mobile Menu & Search Fix
 * Menja samo mobilni prikaz do 980px.
 */

.smmf-mobile-bar,
.smmf-drawer,
.smmf-backdrop,
.smmf-search-overlay {
    display: none;
}

@media (max-width: 980px) {
    html.smmf-locked,
    body.smmf-locked {
        overflow: hidden !important;
    }

    body.smmf-enabled {
        padding-top: 66px !important;
    }

    /* Sakrij TheGem mobilni header/dugmad da se ne sudaraju sa novim menijem */
    /*
     * Potpuno sakrij originalni TheGem header na telefonu.
     * Novi plugin header je DIV, pa ova pravila njega ne dotiču.
     */
    body.smmf-enabled header,
    body.smmf-enabled #site-header,
    body.smmf-enabled #site-header-wrapper,
    body.smmf-enabled .site-header,
    body.smmf-enabled .header-wrapper,
    body.smmf-enabled .header-main,
    body.smmf-enabled .header-main-wrapper,
    body.smmf-enabled .mobile-header,
    body.smmf-enabled .mobile-header-wrapper,
    body.smmf-enabled .mobile-menu-slide-wrapper,
    body.smmf-enabled .mobile-menu-layout-overlay,
    body.smmf-enabled .mobile-menu-layout-default,
    body.smmf-enabled .mobile-menu-layout-slide-horizontal,
    body.smmf-enabled .hamburger-menu-back,
    body.smmf-enabled .menu-toggle,
    body.smmf-enabled .mobile-menu-button {
        display: none !important;
    }

    .smmf-mobile-bar {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 2147483000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 66px;
        padding: 8px 14px;
        box-sizing: border-box;
        background: #fff;
        border-bottom: 1px solid rgba(0,0,0,.12);
        box-shadow: 0 4px 18px rgba(0,0,0,.08);
    }

    .smmf-brand {
        display: flex;
        align-items: center;
        min-width: 0;
        color: #111;
        text-decoration: none;
    }

    .smmf-logo,
    .smmf-logo .custom-logo-link {
        display: flex;
        align-items: center;
    }

    .smmf-logo img {
        display: block;
        width: auto;
        max-width: 172px;
        max-height: 50px;
        object-fit: contain;
    }

    .smmf-site-title {
        overflow: hidden;
        font-size: 18px;
        font-weight: 700;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .smmf-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .smmf-icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #111;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .smmf-icon-button:hover,
    .smmf-icon-button:focus-visible {
        background: #f2f2f2;
        outline: none;
    }

    .smmf-icon-button svg {
        width: 25px;
        height: 25px;
        fill: currentColor;
    }

    .smmf-hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 25px;
    }

    .smmf-hamburger i {
        display: block;
        width: 100%;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
    }

    .smmf-backdrop {
        position: fixed;
        inset: 0;
        z-index: 2147483001;
        display: block;
        background: rgba(0,0,0,.52);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .smmf-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .smmf-drawer {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 2147483002;
        display: flex;
        flex-direction: column;
        width: min(88vw, 390px);
        max-width: 100%;
        background: #fff;
        box-shadow: -10px 0 30px rgba(0,0,0,.22);
        transform: translateX(105%);
        transition: transform .28s ease;
        overflow: hidden;
    }

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

    .smmf-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 66px;
        padding: 8px 14px 8px 20px;
        border-bottom: 1px solid #e8e8e8;
    }

    .smmf-drawer-head strong {
        font-size: 17px;
    }

    .smmf-nav {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0 30px;
    }

    .smmf-menu,
    .smmf-menu ul,
    .smmf-page-menu ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .smmf-menu li,
    .smmf-page-menu li {
        position: relative;
        border-bottom: 1px solid #ededed;
    }

    .smmf-menu a,
    .smmf-page-menu a {
        display: block;
        padding: 15px 54px 15px 20px;
        color: #171717;
        font-size: 16px;
        line-height: 1.35;
        text-decoration: none;
    }

    .smmf-menu > li > a,
    .smmf-page-menu > ul > li > a {
        font-weight: 700;
    }

    .smmf-menu a:hover,
    .smmf-menu .current-menu-item > a,
    .smmf-menu .current-menu-ancestor > a,
    .smmf-page-menu .current_page_item > a {
        color: #ff6900;
    }

    .smmf-submenu-toggle {
        position: absolute;
        top: 5px;
        right: 8px;
        z-index: 2;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #222;
        cursor: pointer;
    }

    .smmf-submenu-toggle::before {
        content: "";
        position: absolute;
        top: 17px;
        left: 16px;
        width: 10px;
        height: 10px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform .2s ease;
    }

    .smmf-submenu-toggle[aria-expanded="true"]::before {
        top: 20px;
        transform: rotate(225deg);
    }

    .smmf-menu .sub-menu,
    .smmf-page-menu .children {
        display: none;
        background: #f7f7f7;
    }

    .smmf-menu .sub-menu.is-open,
    .smmf-page-menu .children.is-open {
        display: block;
    }

    .smmf-menu .sub-menu a,
    .smmf-page-menu .children a {
        padding-left: 34px;
        font-size: 15px;
        font-weight: 500;
    }

    .smmf-menu .sub-menu .sub-menu a,
    .smmf-page-menu .children .children a {
        padding-left: 48px;
    }

    .smmf-search-overlay {
        position: fixed;
        inset: 0;
        z-index: 2147483003;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 90px 18px 30px;
        box-sizing: border-box;
        background: rgba(255,255,255,.98);
        opacity: 0;
        visibility: hidden;
        transition: opacity .22s ease, visibility .22s ease;
    }

    .smmf-search-overlay.is-open {
        opacity: 1;
        visibility: visible;
    }

    .smmf-search-box {
        position: relative;
        width: min(100%, 720px);
        padding-top: 55px;
    }

    .smmf-search-close {
        position: absolute;
        top: 0;
        right: 0;
    }

    .smmf-search-form label {
        display: block;
        margin-bottom: 14px;
        color: #111;
        font-size: clamp(22px, 6vw, 42px);
        font-weight: 700;
        line-height: 1.15;
    }

    .smmf-search-row {
        display: flex;
        gap: 10px;
    }

    .smmf-search-row input {
        flex: 1;
        min-width: 0;
        height: 52px;
        padding: 0 16px;
        border: 1px solid #bdbdbd;
        border-radius: 5px;
        background: #fff;
        color: #111;
        font-size: 16px;
    }

    .smmf-search-row input:focus {
        border-color: #ff6900;
        outline: 2px solid rgba(255,105,0,.18);
    }

    .smmf-search-row button {
        height: 52px;
        padding: 0 20px;
        border: 0;
        border-radius: 5px;
        background: #111;
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
    }

    .smmf-search-row button:hover {
        background: #ff6900;
    }
}

@media (max-width: 480px) {
    .smmf-search-row {
        flex-direction: column;
    }

    .smmf-search-row button {
        width: 100%;
    }

    .smmf-logo img {
        max-width: 150px;
    }
}
