/* ============================================================
   Maestral — Drill-down mobilna navigacija
   Aktivna ispod 980px (Divi mobile breakpoint).
   Desktop meni ostaje netaknut.
   ============================================================ */

/* Overlay: skriven na desktopu, prikazan na mobilnom */
#mdd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
}

#mdd-overlay.mdd-overlay--open {
    display: flex;
    pointer-events: auto;
}

/* Polutransparentna pozadina */
.mdd-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

/* Panel (slide-in s leve strane) */
#mdd-panel {
    position: relative;
    width: min(360px, 100vw);
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.18);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    will-change: transform;
}

#mdd-overlay.mdd-overlay--open #mdd-panel {
    transform: translateX(0);
}

/* --- Zaglavlje --- */
.mdd-header {
    display: flex;
    align-items: center;
    height: 54px;
    padding: 0 8px;
    border-bottom: 1px solid #e4e4e4;
    background: #fff;
    flex-shrink: 0;
    gap: 4px;
}

.mdd-title {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #303030;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.mdd-back-btn,
.mdd-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    color: #636363;
    font-size: 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.mdd-back-btn:hover,
.mdd-close-btn:hover {
    background: #f5f5f5;
    color: #111;
}

.mdd-close-btn {
    font-size: 17px;
}

.mdd-back-btn--hidden {
    visibility: hidden;
    pointer-events: none;
}

/* --- Viewport & ekrani --- */
.mdd-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.mdd-screen {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.28s;
    visibility: hidden;
}

.mdd-screen--active {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
}

/* Ekran koji ide u levo (napred) */
.mdd-screen--left {
    transform: translateX(-30%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.28s;
}

/* Novi ekran koji dolazi s desne (napred) */
.mdd-screen--right {
    transform: translateX(100%);
    visibility: hidden;
}

/* --- Lista stavki --- */
.mdd-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 6px 0 !important;
}

.mdd-item {
    display: flex !important;
    align-items: stretch !important;
    border-bottom: 1px solid #f0f0f0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mdd-item a {
    flex: 1;
    display: block !important;
    padding: 13px 16px !important;
    color: #303030 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    transition: background 0.12s, color 0.12s;
}

.mdd-item a:hover {
    background: #f8f8f8 !important;
    color: #336d9a !important;
}

/* "Pogledaj sve" link — naglašen */
.mdd-item--see-all a {
    color: #ab031f !important;
    font-style: italic;
    font-weight: 500 !important;
}

.mdd-item--see-all a:hover {
    background: #fff5f5 !important;
    color: #800015 !important;
}

/* Separator ispod "Pogledaj sve" */
.mdd-sep {
    height: 1px !important;
    background: #e4e4e4 !important;
    margin: 4px 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
}

/* Dugme za ulazak u podmeni */
.mdd-next-btn {
    background: none !important;
    border: none !important;
    border-left: 1px solid #f0f0f0 !important;
    cursor: pointer;
    padding: 0 18px !important;
    color: #a8a8a8 !important;
    font-size: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
    min-width: 48px;
    line-height: 1;
}

.mdd-next-btn:hover {
    background: #f5f5f5 !important;
    color: #336d9a !important;
}

/* Na desktopu — nikad ne prikazuj overlay */
@media (min-width: 980px) {
    #mdd-overlay {
        display: none !important;
    }
}
