/* پنل کشویی مگامنو — مستقل از هر فریم‌ورک قالب (بوت‌استرپ و مانند آن) */

:root {
    --dmm-panel-width-desktop: 60vw;
    --dmm-panel-width-mobile: 92vw;
    --dmm-sidebar-width: 260px;
    --dmm-primary: #911a56;
    --dmm-transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.dmm-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--dmm-transition);
}

.dmm-menu-overlay.dmm-is-visible {
    opacity: 1;
    visibility: visible;
}

.dmm-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--dmm-panel-width-mobile);
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(100%);
    transition: var(--dmm-transition);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    border-radius: 20px 0 0 20px;
    backface-visibility: hidden;
    overflow: hidden;
}

@media (min-width: 992px) {
    .dmm-menu-panel {
        width: var(--dmm-panel-width-desktop);
    }
}

.dmm-menu-panel.dmm-is-open {
    transform: translateX(0);
}

.dmm-geometric-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' version='1.1' width='1440' height='560' preserveAspectRatio='none' viewBox='0 0 1440 560'%3e%3cg fill='none'%3e%3cpath d='M1440 0L976.28 0L1440 71.05z' fill='rgba(145%2c 26%2c 86%2c .08)'%3e%3c/path%3e%3cpath d='M976.28 0L1440 71.05L1440 180.17L552.65 0z' fill='rgba(145%2c 26%2c 86%2c .05)'%3e%3c/path%3e%3cpath d='M552.65 0L1440 180.17L1440 264.35L323.64 0z' fill='rgba(145%2c 26%2c 86%2c .04)'%3e%3c/path%3e%3cpath d='M0 560L713.16 560L0 339.32z' fill='rgba(145%2c 26%2c 86%2c .1)'%3e%3c/path%3e%3cpath d='M0 339.32L713.16 560L756.87 560L0 177.57z' fill='rgba(145%2c 26%2c 86%2c .07)'%3e%3c/path%3e%3cpath d='M0 177.57L756.87 560L855.89 560L0 134.44z' fill='rgba(145%2c 26%2c 86%2c .04)'%3e%3c/path%3e%3c/g%3e%3c/svg%3e");
    background-size: 150% 150%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.dmm-menu-panel.dmm-is-open .dmm-geometric-bg {
    opacity: 0.9;
    animation: dmm-geo-float 12s ease-in-out infinite alternate;
}

@keyframes dmm-geo-float {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(20px, -15px) scale(1.03);
    }
    100% {
        transform: translate(-10px, 10px) scale(1);
    }
}

.dmm-menu-header,
.dmm-menu-body,
.dmm-menu-content {
    background: transparent;
    position: relative;
    z-index: 1;
}

.dmm-menu-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.dmm-menu-header-main {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dmm-menu-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: #111;
}

.dmm-menu-close-btn {
    background: #f5f5f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
    transition: 0.2s;
}

.dmm-menu-close-btn:hover {
    color: #333;
}

.dmm-menu-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.dmm-menu-sidebar {
    width: var(--dmm-sidebar-width);
    background: #fbfbfc;
    border-left: 1px solid #eee;
    overflow-y: auto;
}

.dmm-sidebar-ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dmm-sidebar-li {
    margin: 0;
}

.dmm-sidebar-item {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font: inherit;
    color: inherit;
    text-align: start;
    padding: 18px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

.dmm-sidebar-item.dmm-is-active {
    background: #fff;
    color: var(--dmm-primary);
    border-right: 5px solid var(--dmm-primary);
    font-weight: 700;
}

.dmm-sidebar-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.dmm-sidebar-text {
    line-height: 1.6;
}

.dmm-sidebar-badge {
    background: var(--dmm-primary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-inline-start: auto;
    line-height: 1.6;
}

.dmm-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.dmm-tab-pane {
    display: none;
}

.dmm-tab-pane.dmm-is-active {
    display: block;
    animation: dmm-fade-in 0.3s ease;
}

.dmm-grid-wrapper {
    display: block;
}

.dmm-mobile-group {
    border-bottom: 1px solid #f0f0f0;
}

.dmm-mobile-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
}

.dmm-parent-link {
    font-weight: 700;
    color: #222;
    text-decoration: none;
    font-size: 1.05rem;
}

.dmm-arrow svg {
    transition: transform 0.3s;
}

[aria-expanded="true"] > .dmm-arrow svg {
    transform: rotate(180deg);
}

.dmm-collapse {
    display: none;
}

.dmm-collapse.dmm-is-open {
    display: block;
    animation: dmm-fade-in 0.3s ease;
}

/* آکاردئون تودرتو: یک پله تورفتگی برای هر سطح */
.dmm-collapse .dmm-mobile-group {
    padding-inline-start: 14px;
}

.dmm-standalone-row {
    display: block;
}

.dmm-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px 10px;
    padding: 15px 0;
}

@media (min-width: 992px) {
    .dmm-image-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

.dmm-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.dmm-item-img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    position: relative;
}

@media (min-width: 992px) {
    .dmm-item-img {
        width: 85px;
        height: 85px;
    }
}

.dmm-item-img.dmm-no-img {
    background-color: #f0f0f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'%3E%3C/circle%3E%3Cpolyline points='21 15 16 10 5 21'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
}

.dmm-item-img.dmm-has-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dmm-grid-label {
    margin-top: 8px;
    font-size: 14px;
    color: #444;
    text-align: center;
    font-weight: 700;
    line-height: 1.2;
}

.dmm-show-all {
    grid-column: 1 / -1;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--dmm-primary);
    color: var(--dmm-primary);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 10px;
}

@media (max-width: 991px) {
    :root {
        --dmm-sidebar-width: 85px;
    }

    .dmm-sidebar-item {
        flex-direction: column;
        padding: 15px 5px;
        text-align: center;
        gap: 5px;
        font-size: 12px;
    }

    .dmm-sidebar-badge {
        margin-inline-start: 0;
    }

    .dmm-item-img {
        width: 58px;
        height: 58px;
    }
}

@keyframes dmm-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── دکمه‌های بازکنندهٔ منو ── */

.dmm-menu-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-inline-start: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--dmm-primary);
    background: transparent;
    color: var(--dmm-primary);
    font-size: 14px;
    font-family: inherit;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dmm-menu-trigger:hover {
    color: #fff;
    background-color: var(--dmm-primary);
}

.dmm-trigger-text {
    line-height: 1.6;
}

.dmm-burger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dmm-burger-icon span {
    height: 2px;
    background: currentColor;
    display: block;
}

.dmm-burger-icon span:nth-child(1),
.dmm-burger-icon span:nth-child(3) {
    width: 20px;
}

.dmm-burger-icon span:nth-child(2) {
    width: 15px;
}

.dmm-footer-trigger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    color: inherit;
}
