/**
 * Mega Menu Styles
 * Products dropdown with image preview
 * Matches Vee Edge dark theme
 */

/* Menu item with dropdown */
.has-mega-menu {
    position: relative;
}

/* Mega Menu Container */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-20%) translateY(10px);
    min-width: 570px;
    background: rgba(26, 29, 36, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

/* Show on hover */
.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-20%) translateY(0);
}

/* Mega Menu Inner Layout */
.mega-menu__inner {
    display: flex;
    min-height: 250px;
}

/* Left Column - Menu Names */
.mega-menu__list {
    width: 40%;
    padding: 24px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

/* Menu Item */
.mega-menu__item {
    position: relative;
    padding: 14px 28px;
    color: var(--bringer-s-text, #C5C7CE);
    font-family: var(--bringer-t-content-ff, 'Inter', sans-serif);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    display: block;
}

/* Left accent bar - hidden by default */
.mega-menu__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--bringer-s-heading, #F5F7FA);
    border-radius: 0 2px 2px 0;
    transition: height 0.25s ease;
}

/* Hover state */
.mega-menu__item:hover,
.mega-menu__item.active {
    color: var(--bringer-s-heading, #F5F7FA);
    background: rgba(255, 255, 255, 0.05);
    padding-left: 32px;
}

.mega-menu__item:hover::before,
.mega-menu__item.active::before {
    height: 60%;
}

/* Right Column - Image Preview */
.mega-menu__preview {
    width: 60%;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

/* Preview Image Container */
.mega-menu__image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

/* Individual Preview Images */
.mega-menu__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block; /* Added for anchor tags */
    border-radius: 8px;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none; /* Prevent clicking when hidden */
    text-decoration: none; /* Remove underline from links */
}

.mega-menu__image.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto; /* Allow clicking when visible */
    z-index: 2; /* Ensure active link is on top */
}

/* Subtle gradient overlay on image */
.mega-menu__image-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(26, 29, 36, 0.6), transparent);
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}

/* Image caption (optional) */
.mega-menu__caption {
    position: absolute;
    bottom: 10px;
    left: 22px;
    right: 16px;
    color: var(--bringer-s-heading, #F5F7FA);
    font-family: var(--bringer-t-heading-ff, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 600;
    z-index: 2;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.mega-menu__caption.active {
    opacity: 1;
    transform: translateY(0);
}

/* Arrow indicator for dropdown */
.has-mega-menu > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.has-mega-menu:hover > a::after {
    transform: rotate(180deg);
}

/* Hide mobile sub-menu on desktop — mega-menu handles it */
.has-mega-menu > .sub-menu {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .mega-menu {
        min-width: 520px;
    }
    
    .mega-menu__item {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .mega-menu__item:hover,
    .mega-menu__item.active {
        padding-left: 28px;
    }
}

@media (max-width: 768px) {
    /* Hide mega menu on mobile - will use standard mobile menu */
    .mega-menu {
        display: none;
    }
    
    .has-mega-menu > a::after {
        display: none;
    }
}