/* Mega Menu Styles */
.mega-menu-wrapper {
    position: static !important;
    overflow: visible !important;
}

.main-menu {
    position: static !important;
    overflow: visible !important;
}

#header-sticky {
    overflow: visible !important;
    position: relative;
    z-index: 1000;
}

#header-sticky .container {
    overflow: visible !important;
    position: static !important;
}

header,
header > *,
.header-area,
.header-area > *,
.navbar,
.navbar > * {
    overflow: visible !important;
}

.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

.menu-item {
    position: relative;
}

.menu-item > .nav-link {
    display: flex;
    align-items: center;
    padding: 18px 14px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.menu-item > .nav-link:hover,
.menu-item.active > .nav-link {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Mega Menu Dropdown - HIDE BY DEFAULT */
.mega-menu {
    display: none !important;
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 8px;
    padding: 0;
    margin: 0 !important;
    z-index: 99999 !important;
}

/* Position mega menu below the header */
.mega-menu-item {
    position: relative !important;
}

.mega-menu-wrapper {
    position: relative !important;
    overflow: visible !important;
}

/* Show mega menu when visible */
.mega-menu[style*="display: block"],
.mega-menu[style*="display: flex"] {
    display: block !important;
}

.mega-menu-inner {
    padding: 30px 40px;
    width: 100%;
}

.mega-menu-content {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: space-between;
}

.mega-menu-col {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.mega-menu-col.mega-menu-image {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    flex: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
}

.mega-menu-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a !important;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
    display: block;
}

.mega-menu-links {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 15px 30px !important;
    width: 100% !important;
}

.mega-menu-link-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    flex: 1 1 180px !important;
    min-width: 180px !important;
}

.mega-menu-link-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mega-menu-link {
    color: #4a5568 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 0;
    transition: all 0.2s ease;
    display: block;
    white-space: nowrap;
}

.mega-menu-link:hover {
    color: #1a1a1a !important;
    transform: translateX(3px);
}

.mega-menu-image {
    display: none !important;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.mega-menu-slideshow {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-menu-slideshow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mega-menu-item:hover .mega-menu-slideshow img {
    transform: scale(1.05);
}

/* Regular Dropdown (for Brand menu) - HIDE BY DEFAULT */
.menu-item-has-children .dropdown-menu.sub-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 300px;
    max-width: 500px;
    background: #ffffff;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    padding: 20px 0;
    margin-top: 0;
    z-index: 9999;
    list-style: none;
}

/* Show dropdown when visible */
.dropdown-menu.sub-menu[style*="display: block"],
.dropdown-menu.sub-menu[style*="display: flex"] {
    display: block !important;
}

.dropdown-menu.sub-menu li {
    list-style: none;
}

.dropdown-menu.sub-menu li a {
    display: block;
    padding: 12px 25px;
    color: #1a1a1a !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 10px;
}

.dropdown-menu.sub-menu li a:hover {
    background: #f8f9fa;
    color: #ff324d !important;
    padding-left: 30px;
    transform: translateX(5px);
}

/* Mobile Menu Items - hide on desktop */
.mobile-menu-item {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1199px) {
    .mega-menu-content {
        flex-direction: column;
        min-height: auto;
    }

    .mega-menu-col.mega-menu-image {
        flex: 0 0 auto;
        max-width: 100%;
        max-height: 250px;
    }

    .mega-menu {
        min-width: 600px;
    }

    .mega-menu-links {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .main-menu ul {
        flex-direction: column;
        gap: 0;
    }

    .menu-item > .nav-link {
        width: 100%;
        text-align: left;
    }

    .mega-menu,
    .dropdown-menu.sub-menu {
        position: static !important;
        display: none !important;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        padding: 0 0 0 20px;
        background: transparent;
    }

    .mega-menu[style*="display: block"],
    .mega-menu[style*="display: flex"],
    .dropdown-menu.sub-menu[style*="display: block"],
    .dropdown-menu.sub-menu[style*="display: flex"] {
        display: block !important;
    }

    .mega-menu-inner {
        padding: 15px;
    }

    .mega-menu-title {
        font-size: 16px;
        color: rgba(255, 255, 255, 0.9) !important;
        border-color: rgba(255, 255, 255, 0.2);
    }

    .mega-menu-link {
        color: rgba(255, 255, 255, 0.8) !important;
    }

    .mega-menu-link:hover {
        color: #ffffff !important;
    }

    .mobile-menu-item {
        display: list-item !important;
    }

    .mega-menu {
        min-width: auto;
        width: 100%;
    }
}

/* Active State */
.menu-item.active > .nav-link {
    color: var(--primary-color, #ff324d);
    background: rgba(255, 255, 255, 0.1);
}

/* Dropdown Arrow Indicator */
.menu-item-has-children > .nav-link::after,
.mega-menu-item > .nav-link::after {
    content: "▾";
    margin-left: 5px;
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.menu-item-has-children.active > .nav-link::after,
.mega-menu-item.active > .nav-link::after {
    transform: rotate(180deg);
}

/* Ensure proper z-index stacking */
#header-sticky {
    position: relative;
    z-index: 100;
}

/* Search results and cart must be above sticky header */
.product_search_form .panel--search-result {
    z-index: 10000 !important;
}

.cart_dropdown .cart_box {
    z-index: 10001 !important;
}

.header-main {
    position: relative;
}

/* Better hover state */
.mega-menu-item:hover > .nav-link,
.menu-item-has-children:hover > .nav-link {
    background: rgba(255, 255, 255, 0.1);
}
