/* Mobile Direct Bar */
#smm-mobile-bar {
    display: none;
    /* Hidden on Desktop */
    position: fixed;
    top: 60px;
    /* Default to below standard header */
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 90;
    /* Lowered to be below Sidebar (usually 9999) */
    border-bottom: 1px solid #eee;
}

/* Mobile Media Query */
@media (max-width: 768px) {
    #smm-mobile-bar {
        display: block;
    }
}

.smm-bar-menu {
    display: flex;
    flex-direction: row;
    /* Horizontal Row */
    margin: 0;
    padding: 0;
    width: 100%;
    list-style: none;
    align-items: stretch;
}

/* Flex 1 to Auto-Fit (1 item=100%, 2=50%, 3=33%) */
.smm-bar-menu>li {
    flex: 1;
    /* Split width equally */
    width: auto;
    text-align: center;
    border-right: 1px solid #f1f1f1;
    border-bottom: none;
    position: static !important;
    /* Static parent = Full Width Dropdown */

    /* Ensure content inside (Link + Toggle) is flex too */
    display: flex;
    flex-direction: column;
    /* Stack link and dropdown */
    align-items: stretch;
    /* Stretch children (Link & Dropdown) to full width */
    justify-content: center;
}

.smm-bar-menu>li:last-child {
    border-right: none;
}

/* Header Row Wrapper */
.smm-header-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the Link/Icon */
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    min-height: 48px;
}

.smm-bar-menu>li>a {
    /* Link is just content now, centered by parent flex */
    flex: 0 1 auto;
    /* Don't grow, just fit content */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Has Children Styling */
.smm-has-children>a {
    /* Adjust if needed, but flex-grow handles it */
}

/* Icon Item Styling */
.smm-nav-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.smm-icon-item {
    position: static !important;
    /* Allow dropdown to be full width */
}

.smm-icon-item>a {
    padding: 8px !important;
}

/* Force Flex/Grid Layout even if jQuery sets block */
.smm-icon-item>ul[style*="display: block"] {
    display: flex !important;
    justify-content: center;
    /* Center items if row is incomplete */
}

.smm-icon-item>ul>li {
    width: 33.33%;
    /* 3 Columns */
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
    border: none;
}

.smm-icon-item>ul>li>a {
    display: block;
    background: #f9f9f9;
    padding: 15px 5px;
    border-radius: 8px;
    font-size: 11px;
    color: #333;
    line-height: 1.3;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
}

.smm-icon-item>ul>li>a:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.smm-toggle {
    position: absolute;
    /* Absolute Right */
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #888;
    background: transparent;
    border-left: none;
    /* Optional Separator */
    z-index: 2;
}

/* Dropdown (Sub-menu) - Overlay Style */
.smm-bar-menu .sub-menu,
.smm-bar-menu .children,
.smm-icon-item>ul.children,
.smm-icon-item>ul.sub-menu {
    display: none;
    /* JS toggles this */
    position: absolute !important;
    /* Overlay */
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: #f9f9f9;
    list-style: none;
    padding: 15px !important;
    box-sizing: border-box !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eee;
    z-index: 900;
}

.smm-bar-menu .sub-menu li {
    text-align: left;
    border-bottom: 1px solid #eee;
}

.smm-bar-menu .sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
}

/* Active States */
.smm-bar-menu>li.current-menu-item>a,
.smm-bar-menu>li.smm-open>a {
    color: #000;
    background: #f5f5f5;
}