/* ==========================================================================
   LSGD Horizontal Header Navigation Menu Stylesheet
   ========================================================================== */

/* Allow flex wrapping and overflow inside header parent container */
.lsgd-header-flex-parent,
.hdrlsgd,
.elementor-element-d5563a0,
header[data-elementor-type="header"] > .e-con,
header[data-elementor-type="header"] > .elementor-element,
header.elementor-location-header {
    flex-wrap: wrap !important;
    overflow: visible !important;
    height: auto !important;
}

/* Hide original Jet Mobile Menu widget and in-page PD Jet Mega Menu on all screen sizes */
.elementor-widget-jet-mobile-menu,
.elementor-widget-jet-mega-menu,
.elementor-element-31097f86,
.elementor-element-723b0f6 {
    display: none !important;
}

/* Eliminate top white space caused by Elementor Sticky Spacer */
.elementor-sticky__spacer,
.elementor-sticky--spacer,
div[class*="elementor-sticky__spacer"],
div[class*="elementor-sticky--spacer"] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

body.home,
body.front-page {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.lsgd-horizontal-header-nav-wrapper {
    display: block !important;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    z-index: 9999999 !important;
    margin-top: 8px;
    margin-bottom: 0;
    padding: 0 20px 10px 20px !important;
    box-sizing: border-box !important;
    font-family: inherit;
    clear: both;
}

.hdrlsgd > .lsgd-horizontal-header-nav-wrapper,
.elementor-element-d5563a0 > .lsgd-horizontal-header-nav-wrapper,
header.elementor-location-header .lsgd-horizontal-header-nav-wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

/* Base Nav Container */
.lsgd-horizontal-nav-container {
    background-color: #2B015B;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Nav Inner & List */
.lsgd-nav-inner {
    width: 100%;
}

.lsgd-horizontal-menu-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0 8px;
}

/* Top Level Items */
.lsgd-horizontal-menu-list > li {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lsgd-horizontal-menu-list > li > .lsgd-menu-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 15px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border-bottom: 3px solid transparent;
}

.lsgd-horizontal-menu-list > li:hover > .lsgd-menu-link,
.lsgd-horizontal-menu-list > li.active > .lsgd-menu-link,
.lsgd-horizontal-menu-list > li.current-menu-item > .lsgd-menu-link,
.lsgd-horizontal-menu-list > li.current-menu-ancestor > .lsgd-menu-link {
    background-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    border-bottom-color: #E53935;
}

/* Priority Items */
.lsgd-horizontal-menu-list > li.priority > .lsgd-menu-link {
    color: #FFD980;
    font-weight: 700;
}

.lsgd-horizontal-menu-list > li.priority > .lsgd-menu-link::before {
    content: "★ ";
    font-size: 11px;
    color: #FFD980;
}

/* Dropdown Arrows */
.lsgd-horizontal-menu-list li.menu-item-has-children > .lsgd-menu-link::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-right: 2px solid rgba(255, 255, 255, 0.85);
    border-bottom: 2px solid rgba(255, 255, 255, 0.85);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.lsgd-horizontal-menu-list li.menu-item-has-children:hover > .lsgd-menu-link::after {
    transform: rotate(225deg) translateY(-2px);
}

/* Desktop Dropdown Submenus (Level 1) */
@media (min-width: 992px) {
    .lsgd-horizontal-menu-toggle {
        display: none !important;
    }

    .lsgd-horizontal-nav-container {
        display: block !important;
    }

    .lsgd-submenu-toggle {
        display: none !important;
    }

    /* General Submenu Styles */
    .lsgd-horizontal-menu-list ul.sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 250px;
        max-width: 320px;
        background: #FFFFFF;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
        border-radius: 0 0 8px 8px;
        list-style: none;
        margin: 0;
        padding: 6px 0;
        z-index: 99999;
        border-top: 3px solid #2B015B;
        pointer-events: none;
    }

    .lsgd-horizontal-menu-list > li:hover > ul.sub-menu {
        display: block;
        pointer-events: auto;
    }

    /* Submenu Items */
    .lsgd-horizontal-menu-list ul.sub-menu li {
        position: relative;
        width: 100%;
        border-bottom: 1px solid #F0F0F0;
    }

    .lsgd-horizontal-menu-list ul.sub-menu li:last-child {
        border-bottom: none;
    }

    .lsgd-horizontal-menu-list ul.sub-menu li .lsgd-menu-link {
        display: block;
        padding: 10px 18px;
        color: #222222;
        font-size: 13.5px;
        font-weight: 500;
        text-decoration: none;
        transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
        border-bottom: none;
    }

    .lsgd-horizontal-menu-list ul.sub-menu li:hover > .lsgd-menu-link,
    .lsgd-horizontal-menu-list ul.sub-menu li.current-menu-item > .lsgd-menu-link {
        background-color: #F4F0F9;
        color: #2B015B;
        padding-left: 22px;
    }

    /* Level 2 Submenu (Nested Dropdown) */
    .lsgd-horizontal-menu-list ul.level-1-menu li.menu-item-has-children > .lsgd-menu-link::after {
        position: absolute;
        right: 14px;
        top: 50%;
        border-right-color: #666666;
        border-bottom-color: #666666;
        transform: rotate(-45deg) translateY(-50%);
    }

    .lsgd-horizontal-menu-list ul.level-1-menu li > ul.level-2-menu {
        display: none;
        top: 0;
        left: 100%;
        margin-top: -6px;
        border-top: 3px solid #A83131;
        border-radius: 0;
        pointer-events: none;
    }

    .lsgd-horizontal-menu-list ul.level-1-menu li:hover > ul.level-2-menu {
        display: block;
        pointer-events: auto;
    }

    /* Mega Dropdown Panel */
    .lsgd-horizontal-menu-list > li.mega > ul.sub-menu {
        min-width: 680px;
        max-width: 820px;
        padding: 16px 22px;
    }

    .lsgd-horizontal-menu-list > li.mega:hover > ul.sub-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 28px;
        align-items: start;
        pointer-events: auto;
    }

    .lsgd-horizontal-menu-list > li.mega > ul.sub-menu > li.mega-heading {
        border-bottom: none;
        width: 100%;
    }

    .lsgd-horizontal-menu-list .lsgd-mega-heading {
        display: block;
        font-weight: 700;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #7A1FA2;
        padding: 2px 0 6px 0;
        margin-bottom: 6px;
        border-bottom: 2px solid #EDE7F6;
    }

    .lsgd-horizontal-menu-list li.mega-heading > ul.sub-menu {
        display: block !important;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        min-width: 0;
        max-width: 100%;
        background: transparent;
        pointer-events: auto;
    }

    .lsgd-horizontal-menu-list li.mega-heading > ul.sub-menu > li {
        border-bottom: none;
    }

    .lsgd-horizontal-menu-list li.mega-heading > ul.sub-menu > li > .lsgd-menu-link {
        padding: 4px 0;
        font-size: 13px;
        color: #2B015B;
        font-weight: 500;
        line-height: 1.4;
    }

    .lsgd-horizontal-menu-list li.mega-heading > ul.sub-menu > li > .lsgd-menu-link:hover {
        background: transparent;
        color: #7A1FA2;
        text-decoration: underline;
        padding-left: 4px;
    }

    /* Align rightmost submenus to right edge to avoid viewport overflow */
    .lsgd-horizontal-menu-list > li:nth-last-child(-n+4) > ul.sub-menu {
        left: auto;
        right: 0;
    }
}

/* Mobile responsive navigation (< 992px) */
@media (max-width: 991px) {
    .lsgd-horizontal-header-nav-wrapper {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0;
        padding: 0 !important;
    }

    /* Mobile Hamburger Button */
    .lsgd-horizontal-menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background-color: transparent;
        color: #FFFFFF;
        border: none;
        padding: 8px 12px;
        border-radius: 3px !important;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        transition: background-color 0.2s ease;
        align-self: center;
        margin-left: auto;
    }

    .lsgd-horizontal-menu-toggle:hover,
    .lsgd-horizontal-menu-toggle:active,
    .lsgd-horizontal-menu-toggle:focus,
    .lsgd-horizontal-menu-toggle[aria-expanded="true"] {
        background-color: rgba(255, 255, 255, 0.15);
        border-radius: 3px !important;
    }

    .lsgd-hamburger-box {
        position: relative;
        display: inline-block;
        width: 20px;
        height: 14px;
    }

    .lsgd-hamburger-inner,
    .lsgd-hamburger-inner::before,
    .lsgd-hamburger-inner::after {
        position: absolute;
        width: 20px;
        height: 2px;
        background-color: #FFFFFF;
        border-radius: 2px;
        transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
    }

    .lsgd-hamburger-inner {
        top: 6px;
    }

    .lsgd-hamburger-inner::before {
        content: "";
        top: -6px;
        left: 0;
    }

    .lsgd-hamburger-inner::after {
        content: "";
        top: 6px;
        left: 0;
    }

    /* Active Hamburger Animation */
    .lsgd-horizontal-menu-toggle[aria-expanded="true"] .lsgd-hamburger-inner {
        background-color: transparent;
    }

    .lsgd-horizontal-menu-toggle[aria-expanded="true"] .lsgd-hamburger-inner::before {
        top: 0;
        transform: rotate(45deg);
    }

    .lsgd-horizontal-menu-toggle[aria-expanded="true"] .lsgd-hamburger-inner::after {
        top: 0;
        transform: rotate(-45deg);
    }

    /* Mobile Drawer */
    .lsgd-horizontal-nav-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #2B015B;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
        z-index: 99999;
        border-top: 3px solid #E53935;
        border-radius: 0 0 8px 8px;
        padding: 10px 0;
        margin-top: 6px;
    }

    .lsgd-horizontal-nav-container.is-open {
        display: block !important;
        animation: lsgdSlideDown 0.25s ease forwards;
    }

    @keyframes lsgdSlideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .lsgd-horizontal-menu-list {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .lsgd-horizontal-menu-list > li {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .lsgd-horizontal-menu-list > li > .lsgd-menu-link {
        flex: 1;
        padding: 12px 18px;
        border-bottom: none;
    }

    /* Mobile Submenu Accordion */
    .lsgd-submenu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #FFFFFF;
        width: 44px;
        height: 44px;
        cursor: pointer;
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        transition: transform 0.2s ease;
    }

    .lsgd-submenu-toggle[aria-expanded="true"] {
        transform: rotate(180deg);
        color: #E53935;
    }

    .lsgd-horizontal-menu-list ul.sub-menu {
        display: none;
        width: 100%;
        list-style: none;
        margin: 0;
        padding: 0;
        background-color: rgba(0, 0, 0, 0.25);
    }

    .lsgd-horizontal-menu-list ul.sub-menu.is-expanded {
        display: block !important;
    }

    .lsgd-horizontal-menu-list ul.sub-menu li {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .lsgd-horizontal-menu-list ul.sub-menu li .lsgd-menu-link {
        flex: 1;
        padding: 10px 18px 10px 30px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 13.5px;
        text-decoration: none;
    }

    .lsgd-horizontal-menu-list ul.level-2-menu li .lsgd-menu-link {
        padding-left: 45px;
    }

    /* Mobile Mega Heading & Sections */
    .lsgd-horizontal-menu-list li.mega-heading {
        display: block !important;
        width: 100%;
        border-bottom: none !important;
        padding: 12px 18px 2px 24px;
    }

    .lsgd-horizontal-menu-list li.mega-heading .lsgd-mega-heading {
        display: block;
        font-weight: 700;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #FFD980;
        padding-bottom: 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        margin-bottom: 4px;
    }

    .lsgd-horizontal-menu-list li.mega-heading > ul.sub-menu {
        display: block !important;
        background: transparent !important;
        padding: 0 0 0 10px;
    }

    .lsgd-horizontal-menu-list li.mega-heading > ul.sub-menu > li .lsgd-menu-link {
        padding: 6px 12px;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.85);
    }
}
