/**
 * Smart Atoms Mega Menu Loop Widget - Core Stylesheet
 */

.smart-atoms-mega-menu {
    box-sizing: border-box;
    width: 100%;
}

.smart-atoms-mega-menu *,
.smart-atoms-mega-menu *::before,
.smart-atoms-mega-menu *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Columns (List of Lists) Mode
   ========================================================================== */
.smart-atoms-mega-menu--columns .smart-atoms-mega-menu__columns-grid {
    display: grid;
    align-items: start;
    width: 100%;
}

.smart-atoms-mega-menu__column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.smart-atoms-mega-menu__group-title {
    margin: 0;
    line-height: 1.3;
}

.smart-atoms-mega-menu__group-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.smart-atoms-mega-menu__posts-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ==========================================================================
   Tabs Mode: Base & Structure
   ========================================================================== */
.smart-atoms-mega-menu--tabs .smart-atoms-mega-menu__tabs-container {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.smart-atoms-mega-menu__tabs-content {
    flex: 1 1 0%;
    min-width: 0;
}

.smart-atoms-mega-menu__tab-panel {
    display: none;
}

.smart-atoms-mega-menu__tab-panel.is-active {
    display: block;
    animation: saMegaMenuFade 0.2s ease-in-out;
}

@keyframes saMegaMenuFade {
    from {
        opacity: 0;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-atoms-mega-menu__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.smart-atoms-mega-menu__panel-title {
    margin: 0;
}

.smart-atoms-mega-menu__panel-view-all {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.smart-atoms-mega-menu__view-all-footer {
    margin-top: 16px;
    width: 100%;
}

.smart-atoms-mega-menu__footer-view-all {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.smart-atoms-mega-menu__footer-view-all:hover {
    text-decoration: underline;
}

.smart-atoms-mega-menu__panel-grid {
    display: grid;
    width: 100%;
}

/* Base Tab Button */
.smart-atoms-mega-menu__tab-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    line-height: 1.3;
    transition: all 0.2s ease;
}

.smart-atoms-mega-menu__tab-btn-icon {
    display: inline-flex;
    flex-shrink: 0;
    font-size: 0.9em;
    line-height: 1;
}

/* ==========================================================================
   HORIZONTAL TABS (Tabs on Top - Strictly in a Single Row)
   ========================================================================== */
.smart-atoms-mega-menu--horizontal .smart-atoms-mega-menu__tabs-container {
    flex-direction: column;
}

.smart-atoms-mega-menu--horizontal .smart-atoms-mega-menu__tabs-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.smart-atoms-mega-menu--horizontal .smart-atoms-mega-menu__tabs-nav::-webkit-scrollbar {
    display: none;
}

.smart-atoms-mega-menu--horizontal .smart-atoms-mega-menu__tab-btn {
    display: inline-flex;
    flex-direction: row;
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.smart-atoms-mega-menu--horizontal .smart-atoms-mega-menu__tab-btn-text {
    white-space: nowrap;
}

.smart-atoms-mega-menu--horizontal .smart-atoms-mega-menu__tabs-content {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
}

/* ==========================================================================
   VERTICAL TABS (Tabs on Left - Column Display)
   ========================================================================== */
.smart-atoms-mega-menu--vertical .smart-atoms-mega-menu__tabs-container {
    flex-direction: row;
}

.smart-atoms-mega-menu--vertical .smart-atoms-mega-menu__tabs-nav {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

.smart-atoms-mega-menu--vertical .smart-atoms-mega-menu__tab-btn {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    text-align: left;
    white-space: normal;
}

.smart-atoms-mega-menu--vertical .smart-atoms-mega-menu__tab-btn-text {
    white-space: normal;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .smart-atoms-mega-menu--vertical .smart-atoms-mega-menu__tabs-container {
        flex-direction: column;
    }

    .smart-atoms-mega-menu--vertical .smart-atoms-mega-menu__tabs-nav {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }
}

/* Custom Panel Content Template */
.smart-atoms-mega-menu__custom-panel-content {
    box-sizing: border-box;
    width: 100%;
}
