
:root {
    --smm-accent:       #ff6c00;
    --smm-accent-dark:  #e05e00;
    --smm-accent-light: #fff4ee;
    --smm-border:       #ebebeb;
    --smm-bg:           #ffffff;
    --smm-root-bg:      #f7f7f7;
    --smm-root-hover:   #efefef;
    --smm-head-bg:      #1a1a2e;
    --smm-text:         inherit;
    --smm-muted:        #888;
    --smm-radius:       7px;
    --smm-panel-w:      820px;
    --smm-root-w:       210px;
    --smm-z:            9000;
    --smm-panel-h:      80vh;
}

/* reset */
.smm-wrap *,
.smm-wrap *::before,
.smm-wrap *::after,
.smm-overlay,
.smm-panel,
.smm-panel * {
    box-sizing: border-box;
}

.smm-wrap {
    display: inline-block;
    direction: rtl;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    position: relative;
}


.smm-trigger {
    display: inline-flex;
    align-items: center;
    gap:0.45em;
    color: #444444;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    transition: background .18s;
    vertical-align: middle;
}


.smm-trigger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 16px;
    flex-shrink: 0;
}
.smm-trigger-icon span {
    display: block;
    height: 2px;
    background: #444444;
    border-radius: 2px;
    transition: transform .25s, opacity .2s;
}
.smm-trigger.is-open .smm-trigger-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.smm-trigger.is-open .smm-trigger-icon span:nth-child(2) { opacity: 0; }
.smm-trigger.is-open .smm-trigger-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.smm-desktop-wrap { display: inline-block; position: relative; }
.smm-mobile-wrap  { display: none; }

@media (max-width: 1024px) {
    .smm-desktop-wrap { display: none !important; }
    .smm-mobile-wrap  { display: block; }
    .smm-wrap         { display: block; }
}


.smm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.38);
    z-index: calc(var(--smm-z) - 1);
}
.smm-overlay.is-open { display: block; }


.smm-panel-desktop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: var(--smm-panel-w);
    height: var(--smm-panel-h);
    background: var(--smm-bg);
    border: 1px solid var(--smm-border);
    border-top: 2px solid var(--smm-accent);
    border-radius: 0 0 var(--smm-radius) var(--smm-radius);
    z-index: var(--smm-z);
    display: none;
    flex-direction: row;
    direction: rtl;
    overflow: hidden;
}
.smm-panel-desktop.is-open {
    display: flex;
    animation: smmSlideDown .2s ease;
}

@keyframes smmSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ستون راست: دسته‌های اصلی */
.smm-root-list {
    width: var(--smm-root-w);
    min-width: var(--smm-root-w);
    height: 100%;
    background: var(--smm-root-bg);
    border-left: 1px solid var(--smm-border);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    flex-shrink: 0;
}
.smm-root-list::-webkit-scrollbar { width: 3px; }
.smm-root-list::-webkit-scrollbar-thumb { background: #ddd; }

.smm-root-item { margin: 0; }

.smm-root-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem 0.6rem 0.8rem;
    font-size: 1rem;
    font-family: inherit;
    color: inherit;
    text-decoration: none;
    transition: background .13s, color .13s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smm-root-link:hover {
    background: var(--smm-root-hover);
    color: var(--smm-accent);
}
.smm-root-item.is-active > .smm-root-link {
    background: var(--smm-bg);
    color: var(--smm-accent);
    font-weight: 700;
    border-right: 3px solid var(--smm-accent);
}

.smm-root-arrow {
    font-size: 1.1em;
    color: var(--smm-muted);
    flex-shrink: 0;
    line-height: 1;
    margin-right: 4px;
}
.smm-root-item.is-active .smm-root-arrow { color: var(--smm-accent); }

/* ستون چپ: زیرمنو */
.smm-sub-panel {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    padding: 1rem 1.2rem 1.2rem 1rem;
}
.smm-sub-panel::-webkit-scrollbar { width: 3px; }
.smm-sub-panel::-webkit-scrollbar-thumb { background: #ddd; }

.smm-sub-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: flex-start;
}

.smm-col {
    flex: 0 0 auto;
    width: calc(33.33% - 1px);
    padding: 0.3rem 0.9rem 0.6rem 0.9rem;
    border-left: 1px solid var(--smm-border);
    margin-bottom: 0.8rem;
}
.smm-col:nth-child(3n+1) { border-left: none; }
.smm-sub-inner:has(.smm-col:nth-child(2)):not(:has(.smm-col:nth-child(3))) .smm-col { width: 50%; }
.smm-sub-inner:not(:has(.smm-col:nth-child(2))) .smm-col { width: 100%; }

.smm-col-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: var(--smm-accent);
    text-decoration: none;
    padding-bottom: 0.4rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--smm-border);
    white-space: nowrap;
    transition: color .14s;
}
.smm-col-title:hover { color: var(--smm-accent-dark); }
.smm-col-more { opacity: .55; font-size:1rem; margin-right: 3px; }

.smm-col-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.smm-col-list li { margin: 0; }
.smm-col-link {
    display: block;
    padding: 0.28rem 0;
    font-size: 1rem;
    color: inherit;
    text-decoration: none;
    transition: color .13s, padding-right .13s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smm-col-link:hover {
    color: var(--smm-accent);
    padding-right: 0.3rem;
}


.smm-trigger-mobile {
    width: 100%;
    justify-content: flex-start;
    font-size: 1rem;
    padding: 10px;
    border-radius: var(--smm-radius);
}
.smm-trigger-mobile .smm-trigger-label {
    flex: 1;
    text-align: right;
}

/* Drawer */
.smm-panel-mobile {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(92vw, 380px);
    height: 100%;
    background: var(--smm-bg);
    z-index: var(--smm-z);
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
.smm-panel-mobile.is-open {
    transform: translateX(0);
}

.smm-mob-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: var(--smm-head-bg);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    font-family: inherit;
    direction: rtl;
}

.smm-mob-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    transition: color .15s;
    font-family: inherit;
}
.smm-mob-close:hover { color: #fff; }

.smm-mob-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    direction: rtl;
}
.smm-mob-nav::-webkit-scrollbar { width: 3px; }
.smm-mob-nav::-webkit-scrollbar-thumb { background: #ddd; }

/* لیست اصلی */
.smm-mob-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.smm-mob-item {
    margin: 0;
    border-bottom: 1px solid var(--smm-border);
}
.smm-mob-item:last-child { border-bottom: none; }


.smm-mob-row {
    display: flex;
    align-items: stretch;
}

.smm-mob-link {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: inherit;
    text-decoration: none;
    transition: color .13s;
}
.smm-mob-link:hover { color: var(--smm-accent); }


.smm-mob-toggle {
    flex-shrink: 0;
    width: 44px;
    background: none;
    border: none;
    border-right: 1px solid var(--smm-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
    transition: background .13s;
}
.smm-mob-toggle:hover { background: var(--smm-root-hover); }


.smm-mob-chevron {
    display: block;
    width: 8px;
    height: 8px;
    border-left: 2px solid var(--smm-muted);
    border-bottom: 2px solid var(--smm-muted);
    transform: rotate(-45deg);
    transition: transform .22s, border-color .15s;
    margin-top: -2px;
}
.smm-mob-toggle[aria-expanded="true"] .smm-mob-chevron {
    transform: rotate(135deg);
    margin-top: 3px;
    border-color: var(--smm-accent);
}


.smm-mob-sub {
    background: #fafafa;
    border-top: 1px solid var(--smm-border);
    padding: 0.6rem 0;
    direction: rtl;
}
.smm-mob-sub[hidden] { display: none; }

.smm-mob-group {
    padding: 0.4rem 1.2rem 0.6rem 1rem;
    border-bottom: 1px dashed var(--smm-border);
}
.smm-mob-group:last-child { border-bottom: none; }

.smm-mob-group-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--smm-accent);
    text-decoration: none;
    margin-bottom: 0.35rem;
    transition: color .13s;
}
.smm-mob-group-title:hover { color: var(--smm-accent-dark); }

.smm-mob-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}
.smm-mob-sublist li { margin: 0; }

.smm-mob-sublink {
    display: block;
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
    color: inherit;
    text-decoration: none;
    transition: color .12s, padding-right .12s;
}
.smm-mob-sublink:hover {
    color: var(--smm-accent);
    padding-right: 0.9rem;
}
