/* ===================================
   Ignite Mega Menu - Frontend Styles
   =================================== */

/* Menu Trigger Button */
.ignite-mega-menu-trigger-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ignite-mega-menu-trigger {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    background-color: var(--ignite-button-bg) !important;
    color: var(--ignite-button-text) !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.ignite-mega-menu-trigger:hover,
.ignite-mega-menu-trigger:focus {
    background-color: var(--ignite-button-hover-bg) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.ignite-mega-menu-trigger:active {
    transform: translateY(0) !important;
}

.ignite-mega-menu-trigger[aria-expanded="true"] .ignite-mega-menu-trigger-icon {
    transform: rotate(180deg) !important;
}

.ignite-mega-menu-trigger-icon {
    display: inline-flex !important;
    transition: transform 0.3s ease !important;
    margin-top: 2px !important;
}

.ignite-mega-menu-trigger-icon svg {
    width: 12px !important;
    height: 8px !important;
}

/* Overlay */
.ignite-mega-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: var(--ignite-overlay-bg) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity var(--ignite-animation-speed) ease, visibility var(--ignite-animation-speed) ease !important;
    z-index: 99998 !important;
    backdrop-filter: blur(2px) !important;
}

.ignite-mega-menu-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Dropdown Container */
.ignite-mega-menu-dropdown {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.95) !important;
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 85vh !important;
    background-color: var(--ignite-dropdown-bg) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all var(--ignite-animation-speed) ease !important;
    z-index: 99999 !important;
    overflow: hidden !important;
}

.ignite-mega-menu-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

.ignite-mega-menu-container {
    position: relative !important;
    height: 100% !important;
    overflow-y: auto !important;
    padding: 40px 30px 30px !important;
}

/* Custom Scrollbar */
.ignite-mega-menu-container::-webkit-scrollbar {
    width: 8px !important;
}

.ignite-mega-menu-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 10px !important;
}

.ignite-mega-menu-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 10px !important;
}

.ignite-mega-menu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

/* Close Button */
.ignite-mega-menu-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
    padding: 0 !important;
}

.ignite-mega-menu-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    transform: rotate(90deg) !important;
}

.ignite-mega-menu-close svg {
    width: 20px !important;
    height: 20px !important;
    color: var(--ignite-dropdown-text) !important;
}

/* Menu Grid */
.ignite-mega-menu-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
}

/* Menu Item */
.ignite-mega-menu-item {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    background: #FFFFFF !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.ignite-mega-menu-item:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.ignite-mega-menu-item.clickable-entire {
    cursor: pointer !important;
}

.ignite-mega-menu-item.clickable-entire:active {
    transform: translateY(-2px) !important;
}

/* Menu Item Image */
.ignite-mega-menu-item-image {
    width: 100% !important;
    height: 180px !important;
    overflow: hidden !important;
    background: #F5F5F5 !important;
}

.ignite-mega-menu-item-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.ignite-mega-menu-item:hover .ignite-mega-menu-item-image img {
    transform: scale(1.05) !important;
}

/* Menu Item Content */
.ignite-mega-menu-item-content {
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    flex: 1 !important;
}

.ignite-mega-menu-item-title {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: inherit !important;
}

.ignite-mega-menu-item-description {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: inherit !important;
    opacity: 0.8 !important;
}

.ignite-mega-menu-item-button {
    display: inline-block !important;
    padding: 10px 20px !important;
    background-color: #FF6B35 !important;
    color: #FFFFFF !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    margin-top: auto !important;
    border: none !important;
    cursor: pointer !important;
}

.ignite-mega-menu-item-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    filter: brightness(1.1) !important;
}

.ignite-mega-menu-item-button:active {
    transform: translateY(0) !important;
}

/* Prevent click on button when entire item is clickable */
.ignite-mega-menu-item.clickable-entire .ignite-mega-menu-item-button {
    pointer-events: none !important;
}

/* Responsive Design */
@media screen and (max-width: 995px) {
    .ignite-mega-menu-dropdown {
        width: 98% !important;
        max-height: 90vh !important;
    }
    
    .ignite-mega-menu-container {
        padding: 50px 20px 20px !important;
    }
    
    .ignite-mega-menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 15px !important;
    }
}

@media screen and (max-width: 768px) {
    .ignite-mega-menu-trigger {
        padding: 10px 20px !important;
        font-size: 15px !important;
    }
    
    .ignite-mega-menu-dropdown {
        width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: translateX(100%) !important;
    }
    
    .ignite-mega-menu-dropdown.active {
        transform: translateX(0) !important;
    }
    
    .ignite-mega-menu-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .ignite-mega-menu-item-image {
        height: 150px !important;
    }
}

@media screen and (max-width: 480px) {
    .ignite-mega-menu-trigger {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
    
    .ignite-mega-menu-container {
        padding: 50px 15px 15px !important;
    }
    
    .ignite-mega-menu-item-content {
        padding: 15px !important;
    }
    
    .ignite-mega-menu-item-title {
        font-size: 16px !important;
    }
    
    .ignite-mega-menu-item-description {
        font-size: 13px !important;
    }
}

/* Accessibility */
.ignite-mega-menu-trigger:focus-visible,
.ignite-mega-menu-close:focus-visible,
.ignite-mega-menu-item-button:focus-visible {
    outline: 3px solid var(--ignite-button-bg) !important;
    outline-offset: 2px !important;
}

.ignite-mega-menu-item.clickable-entire:focus-visible {
    outline: 3px solid var(--ignite-button-bg) !important;
    outline-offset: 2px !important;
}

/* Prevent body scroll when menu is open */
body.ignite-mega-menu-open {
    overflow: hidden !important;
}

/* Animation for menu items */
@keyframes igniteMenuItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item {
    animation: igniteMenuItemFadeIn 0.4s ease forwards !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(1) {
    animation-delay: 0.05s !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(2) {
    animation-delay: 0.1s !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(3) {
    animation-delay: 0.15s !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(4) {
    animation-delay: 0.2s !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(5) {
    animation-delay: 0.25s !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(6) {
    animation-delay: 0.3s !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(7) {
    animation-delay: 0.35s !important;
}

.ignite-mega-menu-dropdown.active .ignite-mega-menu-item:nth-child(8) {
    animation-delay: 0.4s !important;
}
