:root {
    --mdmmp-gold: #f5c332;
    --mdmmp-gold-2: #efb416;
    --mdmmp-dark: #101827;
    --mdmmp-text: #111827;
    --mdmmp-muted: #667085;
    --mdmmp-panel-width: 820px;
}

.mdmmp-root,
.mdmmp-root * {
    box-sizing: border-box;
}

.mdmmp-root {
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    font-family: Vazirmatn, IRANSans, Tahoma, Arial, sans-serif;
}

.mdmmp-backdrop {
    position: fixed;
    inset: 0;
    opacity: 0;
    background: rgba(15,23,42,.08);
    backdrop-filter: blur(1px);
    transition: opacity .18s ease;
    pointer-events: none;
}

.mdmmp-root.mdmmp-open .mdmmp-backdrop {
    opacity: 1;
}

.mdmmp-panel {
    position: fixed;
    width: min(var(--mdmmp-panel-width), calc(100vw - 32px));
    max-height: min(74vh, 720px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px) scale(.985);
    pointer-events: none;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)),
        linear-gradient(180deg, #f8d861 0%, #f3c335 45%, #efb416 100%);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .24);
    border: 1px solid rgba(17,24,39,.10);
    transition: opacity .18s ease, transform .18s ease;
}

.mdmmp-panel.mdmmp-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mdmmp-panel-head {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(17,24,39,.10);
}

.mdmmp-logo {
    width: 116px;
    max-height: 58px;
    object-fit: contain;
    flex: 0 0 auto;
}

.mdmmp-panel-head h3 {
    margin: 0 0 4px;
    color: var(--mdmmp-dark);
    font-size: 20px;
    font-weight: 950;
    line-height: 1.4;
}

.mdmmp-panel-head span {
    display: block;
    color: rgba(17,24,39,.68);
    font-size: 12px;
    font-weight: 800;
}

.mdmmp-close {
    margin-right: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--mdmmp-dark);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.mdmmp-panel-body {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 16px;
    padding: 18px;
}

.mdmmp-feature {
    min-height: 240px;
    padding: 18px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(245,195,50,.25), transparent 35%),
        linear-gradient(180deg, #111827 0%, #1f2937 100%);
}

.mdmmp-feature-title {
    display: block;
    margin-bottom: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 19px;
    font-weight: 950;
    line-height: 1.65;
}

.mdmmp-feature-line {
    width: 64px;
    height: 4px;
    margin: 14px 0;
    border-radius: 999px;
    background: var(--mdmmp-gold);
}

.mdmmp-feature span {
    display: block;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 750;
    line-height: 2;
}

.mdmmp-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-height: calc(min(74vh, 720px) - 118px);
    overflow-y: auto;
    padding-left: 4px;
}

.mdmmp-group {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.26);
    border: 1px solid rgba(255,255,255,.20);
}

.mdmmp-group-title {
    display: block;
    margin-bottom: 9px;
    color: var(--mdmmp-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.55;
}

.mdmmp-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.mdmmp-group li a {
    display: block;
    padding: 8px 10px;
    border-radius: 12px;
    color: #2f2506;
    background: rgba(255,255,255,.16);
    text-decoration: none;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.6;
}

.mdmmp-group li a:hover {
    color: #fff;
    background: var(--mdmmp-dark);
    transform: translateX(-2px);
}

/* Hide native dropdown only on items controlled by this plugin */
body.mdmmp-hide-native .mdmmp-bound > .sub-menu,
body.mdmmp-hide-native .mdmmp-bound:hover > .sub-menu,
body.mdmmp-hide-native .mdmmp-bound:focus-within > .sub-menu,
body.mdmmp-hide-native .mdmmp-bound > ul,
body.mdmmp-hide-native .mdmmp-bound:hover > ul,
body.mdmmp-hide-native .mdmmp-bound:focus-within > ul {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

/* Optional shortcode menu */
.mdmmp-shortcode-menu ul {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mdmmp-shortcode-menu li a {
    display: inline-flex;
    padding: 12px 16px;
    border-radius: 14px;
    color: var(--mdmmp-dark);
    background: var(--mdmmp-gold);
    text-decoration: none;
    font-weight: 900;
}

body.mdmmp-theme-dark .mdmmp-panel {
    background: linear-gradient(180deg, #111827, #1f2937);
    border-color: rgba(255,255,255,.10);
}

body.mdmmp-theme-dark .mdmmp-panel-head,
body.mdmmp-theme-dark .mdmmp-group {
    border-color: rgba(255,255,255,.10);
}

body.mdmmp-theme-dark .mdmmp-panel-head h3,
body.mdmmp-theme-dark .mdmmp-group-title {
    color: #fff;
}

body.mdmmp-theme-dark .mdmmp-panel-head span,
body.mdmmp-theme-dark .mdmmp-group li a {
    color: rgba(255,255,255,.76);
}

body.mdmmp-theme-dark .mdmmp-group {
    background: rgba(255,255,255,.06);
}

body.mdmmp-theme-light .mdmmp-panel {
    background: #fff;
}

body.mdmmp-theme-light .mdmmp-feature {
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
}

body.mdmmp-theme-light .mdmmp-group {
    background: #f8fafc;
    border-color: #e5e7eb;
}

@media (max-width: 900px) {
    .mdmmp-panel {
        left: 12px !important;
        right: 12px !important;
        top: 72px !important;
        width: auto !important;
        max-height: calc(100vh - 96px);
    }

    .mdmmp-panel-body {
        grid-template-columns: 1fr;
    }

    .mdmmp-feature {
        min-height: auto;
    }

    .mdmmp-groups {
        grid-template-columns: 1fr;
        max-height: 50vh;
    }
}


/* v3 polish: round MedaNet logo, nicer close button, cleaner scrollbar */
.mdmmp-panel-head {
    min-height: 92px;
    gap: 16px;
}

.mdmmp-logo {
    width: 74px !important;
    height: 74px !important;
    max-height: 74px !important;
    border-radius: 50%;
    object-fit: cover !important;
    background: #f5c332;
    border: 4px solid rgba(255,255,255,.95);
    box-shadow: 0 10px 24px rgba(15,23,42,.14);
}

.mdmmp-panel-head h3 {
    font-size: 22px;
}

.mdmmp-panel-head span {
    color: rgba(17,24,39,.70);
    font-size: 12.5px;
    line-height: 1.8;
}

.mdmmp-close {
    position: relative;
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    color: transparent !important;
    background: rgba(17,24,39,.92) !important;
    box-shadow: 0 10px 22px rgba(17,24,39,.22);
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.mdmmp-close::before,
.mdmmp-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 2.5px;
    border-radius: 999px;
    background: #fff;
    transform-origin: center;
}

.mdmmp-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.mdmmp-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.mdmmp-close:hover {
    transform: translateY(-1px);
    background: #000 !important;
    box-shadow: 0 14px 28px rgba(17,24,39,.28);
}

/* make the panel scroll usable and visually branded */
.mdmmp-groups {
    scrollbar-width: thin;
    scrollbar-color: rgba(17,24,39,.38) rgba(255,255,255,.18);
    padding-left: 8px;
}

.mdmmp-groups::-webkit-scrollbar {
    width: 8px;
}

.mdmmp-groups::-webkit-scrollbar-track {
    background: rgba(255,255,255,.18);
    border-radius: 999px;
}

.mdmmp-groups::-webkit-scrollbar-thumb {
    background: rgba(17,24,39,.38);
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.22);
}

.mdmmp-groups::-webkit-scrollbar-thumb:hover {
    background: rgba(17,24,39,.62);
}


/* v4 corrections: no white logo border, no internal scrollbar, safe vertical position */
.mdmmp-logo {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    object-fit: contain !important;
}

.mdmmp-panel {
    max-height: none !important;
    overflow: visible !important;
}

.mdmmp-panel-body {
    align-items: stretch;
}

.mdmmp-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    max-height: none !important;
    overflow: visible !important;
    padding-left: 0 !important;
}

.mdmmp-groups::-webkit-scrollbar {
    display: none !important;
}

.mdmmp-feature {
    min-height: 100% !important;
}

.mdmmp-group {
    min-height: 0;
}

.mdmmp-group ul {
    gap: 5px !important;
}

.mdmmp-group li a {
    padding: 7px 9px !important;
    font-size: 11.5px !important;
}

@media (max-width: 1180px) {
    .mdmmp-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .mdmmp-panel {
        overflow: auto !important;
        max-height: calc(100vh - 96px) !important;
    }

    .mdmmp-groups {
        grid-template-columns: 1fr !important;
    }
}

/* v5: square logo without white border, icon-only group category, mobile polished sheet */
.mdmmp-logo {
    width: 78px !important;
    height: 78px !important;
    max-height: 78px !important;
    border-radius: 18px !important;
    object-fit: cover !important;
    border: 0 !important;
    outline: 0 !important;
    background: #f5c332 !important;
    box-shadow: none !important;
}

.mdmmp-group-title {
    display: none !important;
}

.mdmmp-group-mark {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
    min-height: 30px;
}

.mdmmp-group-mark span {
    width: 34px;
    height: 34px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #101827;
    box-shadow: 0 10px 20px rgba(17,24,39,.16);
    font-size: 15px;
    font-weight: 950;
}

.mdmmp-panel-head span {
    font-weight: 900 !important;
}

@media (min-width: 901px) {
    .mdmmp-panel {
        max-height: calc(100vh - 32px) !important;
    }

    .mdmmp-panel-body {
        grid-template-columns: 220px 1fr !important;
    }

    .mdmmp-groups {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 900px) {
    .mdmmp-root {
        z-index: 9999999 !important;
    }

    .mdmmp-backdrop {
        opacity: 0 !important;
        background: rgba(15,23,42,.35) !important;
    }

    .mdmmp-root.mdmmp-open .mdmmp-backdrop {
        opacity: 1 !important;
        pointer-events: auto;
    }

    .mdmmp-panel {
        position: fixed !important;
        inset: 10px !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        border-radius: 24px !important;
        transform: translateY(16px) scale(.985) !important;
    }

    .mdmmp-panel.mdmmp-active {
        transform: translateY(0) scale(1) !important;
    }

    .mdmmp-panel-head {
        position: sticky;
        top: 0;
        z-index: 5;
        min-height: 78px !important;
        padding: 12px 14px !important;
        background: linear-gradient(180deg, #f8d861 0%, #f3c335 100%);
    }

    .mdmmp-logo {
        width: 56px !important;
        height: 56px !important;
        border-radius: 14px !important;
    }

    .mdmmp-panel-head h3 {
        font-size: 18px !important;
        margin: 0 !important;
    }

    .mdmmp-panel-head span {
        font-size: 11px !important;
    }

    .mdmmp-close {
        width: 40px !important;
        height: 40px !important;
        border-radius: 13px !important;
    }

    .mdmmp-panel-body {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .mdmmp-feature {
        min-height: 92px !important;
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .mdmmp-feature-title {
        font-size: 16px !important;
        margin-bottom: 6px !important;
    }

    .mdmmp-feature-line {
        margin: 8px 0 !important;
    }

    .mdmmp-groups {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        max-height: none !important;
        overflow: visible !important;
        padding-left: 0 !important;
    }

    .mdmmp-group {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    .mdmmp-group-mark {
        margin-bottom: 8px !important;
    }

    .mdmmp-group-mark span {
        width: 30px !important;
        height: 30px !important;
        border-radius: 11px !important;
    }

    .mdmmp-group ul {
        gap: 6px !important;
    }

    .mdmmp-group li a {
        padding: 10px 12px !important;
        font-size: 12px !important;
        line-height: 1.6 !important;
    }
}


/* v6 mobile width fix */
@media (max-width: 900px) {
    .mdmmp-root {
        z-index: 9999999 !important;
    }

    .mdmmp-panel {
        width: calc(100vw - 22px) !important;
        max-width: calc(100vw - 22px) !important;
        min-width: 0 !important;
        left: 11px !important;
        right: 11px !important;
        top: 10px !important;
        bottom: 10px !important;
        max-height: calc(100vh - 20px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        border-radius: 22px !important;
        transform: translateY(8px) scale(.985) !important;
    }

    .mdmmp-panel.mdmmp-active {
        transform: translateY(0) scale(1) !important;
    }

    .mdmmp-panel-head {
        position: sticky;
        top: 0;
        z-index: 3;
        min-height: 74px !important;
        padding: 12px 14px !important;
        background: linear-gradient(180deg, #f8d861 0%, #f3c335 100%) !important;
    }

    .mdmmp-logo {
        width: 54px !important;
        height: 54px !important;
        max-height: 54px !important;
    }

    .mdmmp-panel-head h3 {
        font-size: 17px !important;
        line-height: 1.4 !important;
    }

    .mdmmp-panel-head span {
        font-size: 11px !important;
        line-height: 1.6 !important;
    }

    .mdmmp-close {
        width: 36px !important;
        height: 36px !important;
        border-radius: 12px !important;
        flex: 0 0 36px !important;
    }

    .mdmmp-panel-body {
        display: block !important;
        padding: 12px !important;
    }

    .mdmmp-feature {
        min-height: auto !important;
        margin-bottom: 12px !important;
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .mdmmp-feature-title {
        font-size: 17px !important;
        margin-bottom: 8px !important;
    }

    .mdmmp-feature span {
        font-size: 11px !important;
    }

    .mdmmp-groups {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .mdmmp-group {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    .mdmmp-group-title {
        margin-bottom: 8px !important;
        font-size: 0 !important;
        height: 30px !important;
    }

    .mdmmp-group-title::before {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }

    .mdmmp-group ul {
        gap: 5px !important;
    }

    .mdmmp-group li a {
        padding: 8px 10px !important;
        font-size: 12px !important;
        line-height: 1.55 !important;
        border-radius: 12px !important;
        white-space: normal !important;
    }
}

@media (max-width: 380px) {
    .mdmmp-panel {
        width: calc(100vw - 14px) !important;
        max-width: calc(100vw - 14px) !important;
        left: 7px !important;
        right: 7px !important;
    }

    .mdmmp-panel-head {
        padding: 10px !important;
        gap: 9px !important;
    }

    .mdmmp-logo {
        width: 48px !important;
        height: 48px !important;
    }
}
