/* ==================================================
   Shahmoradi Theme – Mega Menu (FINAL – FIXED)
================================================== */

/* ---------- Brand Variables ---------- */
:root {
    --emaux-blue-dark: #0b3c5d;
    --emaux-blue-main: #1f5f8b;
    --emaux-blue-light: #4fa3c7;
}

/* ---------- Header Base ---------- */
.sh-header,
.sh-header * {
    box-sizing: border-box;
}

.sh-header {
    direction: rtl;
    position: sticky;
    top: 0;
    z-index: 9999;
    background: linear-gradient(
        135deg,
        var(--emaux-blue-dark),
        var(--emaux-blue-main),
        var(--emaux-blue-light)
    );
}

.sh-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---------- Nav ---------- */
.sh-nav-item a,
.sh-cats-trigger {
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

/* ---------- Wrapper (کلید اصلی حل پرش) ---------- */
.sh-cats-wrapper {
    position: relative;
}

/* ---------- Mega Panel ---------- */
.sh-cats-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 900px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(11,60,93,.15);
    z-index: 9999;
}

/* ---------- Layout ---------- */
.sh-cats-panel-inner {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 320px;
}

/* ---------- Parents (Right Column) ---------- */
.sh-cats-parents {
    list-style: none;
    margin: 0;
    padding: 12px;
    border-left: 1px solid #eee;
}

.sh-cats-parents li {
    padding: 10px 12px;
    cursor: pointer;
    color: #0b3c5d;
    font-weight: 500;
    transition: background .2s;
}

.sh-cats-parents li:hover {
    background: #f2f7fb;
}

/* ---------- Children (Left Column) ---------- */
.sh-cats-children > div {
    display: none;           /* JS کنترل می‌کند */
    padding: 20px;
}

.sh-cats-children a {
    display: block;
    padding: 6px 0;
    color: #0b3c5d;
    text-decoration: none;
}

/* ---------- Hover Lock (فقط باز/بسته شدن پنل) ---------- */
.sh-cats-wrapper:hover .sh-cats-panel,
.sh-cats-panel:hover {
    display: block;
}

/* ---------- Anti-gap ---------- */
.sh-cats-panel::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}
