/* ============================================
   Custom Mega Menu - Frontend Styles v3
   ============================================ */

.cmm-nav {
    font-family: inherit;
}

.cmm-nav,
.cmm-nav * {
    box-sizing: border-box;
}

/* Top-level horizontal menu */
ul.cmm-top {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

ul.cmm-top > li.cmm-top-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

/* If panel is wide, stretch across the whole nav */
ul.cmm-top > li.cmm-has-mega {
    position: static;
}

.cmm-top-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    line-height: 1;
    transition: color 0.15s ease;
	color:#fff;
}

.cmm-top-link:hover,
.cmm-top-link:focus {
    color: #EBEFF5;
}

.cmm-caret {
    font-size: 25px;
    transition: transform 0.2s ease;
}

li.cmm-top-item:hover .cmm-caret,
li.cmm-top-item.cmm-open .cmm-caret {
    transform: rotate(180deg);
}

/* ============================================
   The Mega Panel
   ============================================ */
.cmm-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    width: min(1100px, calc(100vw - 40px));
    background: #eef1f6;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 9999;
    padding: 24px;
    margin-top: 8px;
    text-align: left;
}

li.cmm-has-mega:hover > .cmm-panel,
li.cmm-has-mega:focus-within > .cmm-panel,
li.cmm-has-mega.cmm-open > .cmm-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cmm-panel-inner {
    display: grid;
    grid-template-columns: 220px 1fr 300px;
    gap: 24px;
    min-height: 320px;
}

/* ============================================
   Column 1: Parent categories (Level 2)
   ============================================ */
.cmm-col-parents {
    padding-right: 20px;
    border-right: 1px solid #d5dae3;
}

ul.cmm-parents {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cmm-parent-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cmm-parent-link {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 !important;
    font-size: 18px !important;
    color: #1e2a44 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.15s ease, font-weight 0.15s ease;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    background: transparent !important;
}

.cmm-parent-item:hover .cmm-parent-link,
.cmm-parent-item.is-active .cmm-parent-link {
    color: #0b1530 !important;
    font-weight: 700 !important;
}

.cmm-parent-arrow {
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: #0b1530;
    margin-left: 8px;
}

.cmm-parent-item.is-active .cmm-parent-arrow {
    opacity: 1;
}

/* ============================================
   Column 2: Sub-items (Level 3)
   ============================================ */
.cmm-col-children {
    position: relative;
    min-width: 0;
}

ul.cmm-children {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 4px 24px;
    align-content: start;
    background: transparent !important;
    box-shadow: none !important;
    position: static !important;
}

ul.cmm-children.is-active {
    display: grid !important;
}

.cmm-child-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.cmm-child-item > a {
    display: block !important;
    padding: 10px 16px !important;
    font-size: 16px !important;
    color: #1e2a44 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: background 0.15s ease, color 0.15s ease, font-weight 0.15s ease !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    background: transparent !important;
}

.cmm-child-item:hover > a,
.cmm-child-item.is-active > a {
    background: #d5dae3 !important;
    color: #0b1530 !important;
    font-weight: 600 !important;
}

/* ============================================
   Column 3: Live preview
   ============================================ */
.cmm-col-preview {
    padding-left: 8px;
}

.cmm-preview {
    display: none;
}

.cmm-preview.is-active {
    display: block;
    animation: cmmFade 0.25s ease;
}

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

.cmm-preview-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(180deg, #f2f4f8 0%, #dbdfe6 100%);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.cmm-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cmm-preview-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #b8bfcc;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.cmm-preview-title {
    font-size: 18px;
    font-weight: 700;
    color: #0b1530;
    margin: 0 0 8px;
    line-height: 1.3;
}

.cmm-preview-title a {
    color: inherit;
    text-decoration: none;
}

.cmm-preview-title a:hover {
    text-decoration: underline;
}

.cmm-preview-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #8a94a6;
    margin: 0;
}

/* Admin notice when no menu found */
.cmm-notice {
    padding: 12px 16px;
    background: #fff3cd;
    border-left: 4px solid #f0b429;
    color: #664d03;
    font-size: 14px;
}

/* ============================================
   Simple Dropdown (for top-level items where
   "Show as Mega Menu" is unchecked)
   ============================================ */
li.cmm-has-dropdown {
    position: relative;
}

ul.cmm-dropdown {
    list-style: none !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 9999;
    margin-top: 8px !important;
}

/* Reveal the first-level dropdown on hover of the top-level item */
li.cmm-has-dropdown:hover > ul.cmm-dropdown,
li.cmm-has-dropdown:focus-within > ul.cmm-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Reveal nested submenus on hover of the parent dropdown item */
.cmm-dropdown-item.has-submenu:hover > ul.cmm-dropdown,
.cmm-dropdown-item.has-submenu:focus-within > ul.cmm-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cmm-dropdown-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

.cmm-dropdown-item > a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 18px !important;
    font-size: 15px !important;
    color: #1e2a44 !important;
    text-decoration: none !important;
    line-height: 1.35 !important;
    background: transparent !important;
    font-weight: 400 !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.cmm-dropdown-item > a:hover,
.cmm-dropdown-item:hover > a {
    background: #f2f4f8 !important;
    color: #0b1530 !important;
}

/* Nested dropdown (side-opening flyout) */
.cmm-dropdown-item.has-submenu > ul.cmm-dropdown {
    top: 0 !important;
    left: 100% !important;
    margin-top: 0 !important;
    margin-left: 4px !important;
    transform: translateX(10px);
}

.cmm-dropdown-item.has-submenu:hover > ul.cmm-dropdown,
.cmm-dropdown-item.has-submenu:focus-within > ul.cmm-dropdown {
    transform: translateX(0);
}

/* If the flyout would overflow the right viewport edge, this class (added by JS)
   pins it to the left side instead */
.cmm-dropdown-item.has-submenu.cmm-flyout-left > ul.cmm-dropdown {
    left: auto !important;
    right: 100% !important;
    margin-left: 0 !important;
    margin-right: 4px !important;
}

.cmm-dd-arrow {
    font-size: 16px;
    color: #8a94a6;
    line-height: 1;
}

/* ============================================
   Responsive - Desktop-only behavior
   Minor layout tweaks for smaller desktops,
   then fully hide below 1025px (tablet/mobile).
   Use Elementor Nav Menu widget for tablet/mobile
   with Responsive Visibility settings.
   ============================================ */
@media (max-width: 1200px) {
    .cmm-panel-inner {
        grid-template-columns: 200px 1fr 260px;
    }
}

/* Hide completely on tablet and mobile */
@media (max-width: 1024px) {
    .cmm-nav {
        display: none !important;
    }
}
