/**
 * Welt Mega Menu Styles
 */

/* Base Menu Styles */
.welt-mega-menu-item {
    position: relative;
}

/* Hide mega menu dropdown by default */
.welt-mega-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: auto;
    max-width: 95vw;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 15px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease;
    pointer-events: none;
}

/* Show mega menu on hover (desktop only) */
@media (min-width: 1025px) {
    .welt-mega-menu-item.welt-mega-menu-active > .welt-mega-menu-dropdown {
        display: flex;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Hide on mobile/tablet */
@media (max-width: 1024px) {
    .welt-mega-menu-dropdown {
        display: none !important;
    }
}

/* Mega Menu Layout - Left and Right Split */
.welt-mega-menu-dropdown {
    display: flex;
}

/* Left side - Categories List */
.welt-mega-menu-left {
    flex: 0 0 220px;
    /*border-right: 1px solid #e5e5e5;*/
    padding-right: 25px;
}

.welt-mega-menu-left .mega-menu-categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.welt-mega-menu-left .mega-menu-categories > li {
    margin: 0;
    padding: 0;
    position: relative;
}

.welt-mega-menu-left .mega-menu-categories > li > a {
    display: block;
    padding: 12px 25px 12px 4px;
    color: #333;
    font-family: ct_font_a_rchy, Sans-Serif;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.welt-mega-menu-left .mega-menu-categories > li > a::after {
    content: '\203A';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.welt-mega-menu-left .mega-menu-categories > li > a:hover,
.welt-mega-menu-left .mega-menu-categories > li.welt-category-active > a {
    background: #fff;
    color: #000;
    padding-left: 8px;
}


.welt-mega-menu-left .ct-toggle-dropdown-desktop{
    display: none!important;
}

.welt-mega-menu-left .mega-menu-categories > li > a:hover::after,
.welt-mega-menu-left .mega-menu-categories > li.welt-category-active > a::after {
    opacity: 1;
    right: 8px;
}



/* Right side - Submenu Items Container */
.welt-mega-menu-right-container {
    flex: 0 0 0;
    min-height: 300px;
    position: relative;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.welt-mega-menu-right-container.welt-has-active {
    flex: 1 1 auto;
    min-width: 400px;
    width: auto;
    overflow: visible;
}

/* Right side content that shows on category hover */
.welt-mega-menu-right {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.welt-mega-menu-right.welt-active {
    display: block;
    opacity: 1;
}

.welt-mega-menu-right .mega-menu-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.welt-mega-menu-right .mega-menu-items > li {
    margin: 0;
    padding: 0;
}

.welt-mega-menu-right .mega-menu-items > li > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 100%;
}

.welt-mega-menu-right .mega-menu-items > li > a:hover {
    background: #fff;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.1);
}

/* Menu Item Image */
.menu-item-image-wrapper {
    width: 100%;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e5e5;
}

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

.welt-mega-menu-right .mega-menu-items > li > a:hover .menu-item-image {
    transform: scale(1.1);
}

/* Menu Item Text */
.menu-item-text {
    display: flex;
    align-items: center;
    /*justify-content: center;*/
    width: 100%;
    text-align: center;
}

/* Items without images */
.welt-mega-menu-right .mega-menu-items > li:not(.has-menu-image) > a {
    padding: 20px;
    justify-content: center;
    text-align: center;
    min-height: 80px;
}

.welt-mega-menu-right .mega-menu-items > li:not(.has-menu-image) .menu-item-text {
    font-size: 15px;
}

/* Loading State */
.welt-mega-menu-right-container.welt-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: welt-spin 1s linear infinite;
}

@keyframes welt-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Grid - Adjust columns based on screen size */
@media (min-width: 1400px) {
    .welt-mega-menu-right .mega-menu-items {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .welt-mega-menu-right .mega-menu-items {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (min-width: 1025px) and (max-width: 1199px) {
    .welt-mega-menu-right .mega-menu-items {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .menu-item-image-wrapper {
        height: 100px;
    }

    .menu-item-text {
        font-size: 13px;
    }
}

/* Responsive - Ensure mega menu is hidden on smaller screens */
@media (max-width: 1024px) {
    .welt-mega-menu-item .welt-mega-menu-dropdown {
        display: none !important;
    }
}

/* Fine-tune positioning based on theme */
.welt-mega-menu-item > .welt-mega-menu-dropdown {
    margin-top: 0;
}

/* Arrow indicator for mega menu items */
.welt-mega-menu-item > a::after {
    content: '\25BC';
    font-size: 10px;
    margin-left: 6px;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

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