/* Flatsome Mobile Mega Menu - UX Element Styles */
:root {
    --fmmm-bg: #ffffff;
    --fmmm-sidebar-bg: #f8f9fa;
    --fmmm-accent: #446084;
    --fmmm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Popup Overlay */
.fmmm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
    visibility: hidden;
    pointer-events: none;
}

.fmmm-overlay.active {
    visibility: visible;
    pointer-events: auto;
}

.fmmm-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1; /* Nằm dưới Menu */
}

.fmmm-overlay.active .fmmm-backdrop {
    opacity: 1;
}

.fmmm-menu-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 380px;
    height: 100%;
    background: var(--fmmm-bg);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 10; /* Nằm trên Backdrop */
}

.fmmm-overlay.active .fmmm-menu-container {
    transform: translateX(0);
}

.fmmm-header {
    padding: 10px 15px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid #eee;
}

.fmmm-close {
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    color: #ccc;
}

.fmmm-body {
    flex: 1;
    overflow-y: auto;
}

/* UX Element Structure */
.fmmm-ux-element {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fmmm-ux-wrapper {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.fmmm-ux-sidebar {
    width: var(--sidebar-width, 90px);
    background: var(--fmmm-sidebar-bg);
    border-right: 1px solid #eee;
    overflow-y: auto;
}

.fmmm-main-tabs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fmmm-main-tab-item {
    padding: 15px 5px;
    text-align: center;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: var(--fmmm-transition);
    position: relative;
    z-index: 99999;
    pointer-events: auto !important;
	margin-bottom: 0;
}

.fmmm-main-tab-item.active {
    background: #fff;
    border-left: 3px solid var(--fmmm-accent);
}

.fmmm-main-tab-icon {
    width: 66px;
    height: 88px;
    object-fit: contain;
}

.fmmm-main-tab-text {
    font-size: 12px;
    font-weight: 700;
    color: #777;
}

.fmmm-main-tab-item.active .fmmm-main-tab-text {
    color: var(--fmmm-accent);
}

.fmmm-ux-main {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
}

.fmmm-ux-content-item {
    display: none;
}

.fmmm-ux-content-item.active {
    display: block;
    animation: fmmmFadeIn 0.3s ease;
}

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

body.fmmm-active {
    overflow: hidden;
}

/* Trigger Button Styles */
.fmmm-trigger-button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 11px;
    transition: var(--fmmm-transition);
}
.header-main .nav > li > a.fmmm-trigger-button {
	padding: 5px 0;
}
.fmmm-trigger-button::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17.01 17.01'%3E%3Crect x='0.54' y='0.54' width='15.93' height='15.93' rx='2.54' fill='none' stroke='%23ffffff' stroke-width='1.07' stroke-miterlimit='10'/%3E%3Cline x1='5' y1='4.98' x2='12.01' y2='4.98' stroke='%23ffffff' stroke-linecap='round' stroke-width='1.5' stroke-miterlimit='10'/%3E%3Cline x1='5' y1='8.5' x2='12.01' y2='8.5' stroke='%23ffffff' stroke-linecap='round' stroke-width='1.5' stroke-miterlimit='10'/%3E%3Cline x1='5' y1='12.02' x2='7.04' y2='12.02' stroke='%23ffffff' stroke-linecap='round' stroke-width='1.5' stroke-miterlimit='10'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.fmmm-placeholder {
    padding: 30px;
    border: 2px dashed #ddd;
    text-align: center;
    color: #aaa;
    background: #fafafa;
}

.fmmm-placeholder-child {
    padding: 20px;
    border: 1px dashed #eee;
    color: #ccc;
    font-style: italic;
}

/* Fallback and Layout for UX Builder */
body.ux-builder-widget .fmmm-ux-content-item,
body.ux-builder .fmmm-ux-content-item {
    display: none !important;
}

body.ux-builder-widget .fmmm-ux-content-item.active,
body.ux-builder .fmmm-ux-content-item.active {
    display: block !important;
    border: 1px dashed #ddd;
    margin-bottom: 20px;
    padding: 10px;
    background: #fff;
}

body.ux-builder-widget .fmmm-ux-content-item::before,
body.ux-builder .fmmm-ux-content-item::before {
    content: "Editing Tab: " attr(data-title);
    display: block;
    font-weight: bold;
    background: #f1f1f1;
    padding: 5px 10px;
    margin: -10px -10px 10px -10px;
    font-size: 11px;
    color: #446084;
    border-bottom: 1px solid #ddd;
}
