/**
 * Custom Mega Menu Styles
 * Path: modules/custommegamenu/views/css/megamenu.css
 */

.custom-megamenu {
    background-color: #2c3e50;
    padding: 0;
    position: relative;
    z-index: 0;
}

.megamenu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.megamenu-item {
    position: relative;
    margin: 0;
}

.megamenu-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.megamenu-link:hover {
    background-color: #34495e;
    color: #ff6b35;
}

.megamenu-link .material-icons {
    font-size: 18px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.megamenu-item.active .megamenu-link .material-icons,
.megamenu-item:hover .megamenu-link .material-icons {
    transform: rotate(180deg);
}

/* Dropdown styles */
.megamenu-dropdown {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    width: 100vw;
    background-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1;
    border-radius: 0 0 8px 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.megamenu-item:hover .megamenu-dropdown,
.megamenu-item.active .megamenu-dropdown {
    opacity: 1;
    visibility: visible;
}

.megamenu-dropdown-inner {
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
}

.megamenu-content {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 0;
    min-height: 250px;
}

.megamenu-header {
    border-radius: 0;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    box-shadow: none;
}

.megamenu-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    line-height: 1.2;
    word-wrap: break-word;
}

.megamenu-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin-top: 10px;
    max-height: none;
    overflow: visible;
}

.megamenu-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    background-color: #ffffff;
}

/* Subcategories grid */
.megamenu-subcategories {
    padding: 0;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px 15px;
}

.subcategory-item {
    padding: 0;
}
.megamenu-header{
    background-color: #2c3e50 !important;
}

.subcategory-link {
    display: block;
    padding: 5px 0;
    color: #000000 !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600 !important;
    background-color: transparent;
    border-radius: 0;
    transition: none;
    border: none;
}

.subcategory-link:hover {
    background-color: transparent;
    color: #000000 !important;
    border: none;
    transform: none;
    text-decoration: underline;
}

/* Category image */
.megamenu-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border-radius: 0;
    overflow: hidden;
    padding: 0;
    height: 100%;
}

.megamenu-image img {
    max-height: 256px;
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Responsive styles */
@media (max-width: 1200px) {
    .megamenu-dropdown-inner {
        max-width: 100%;
        padding: 0;
    }
    
    .megamenu-content {
        grid-template-columns: 200px 1fr 250px;
        gap: 0;
    }
    
    .megamenu-body {
        padding: 20px;
    }
    
    .subcategories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .megamenu-list {
        flex-wrap: wrap;
    }
    
    .megamenu-dropdown-inner {
        padding: 0;
    }
    
    .megamenu-content {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .megamenu-header {
        padding: 20px;
    }
    
    .megamenu-body {
        padding: 20px;
    }
    
    .megamenu-title {
        font-size: 22px;
    }
    
    .megamenu-image {
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .custom-megamenu {
        overflow-x: auto;
    }
    
    .megamenu-link {
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .megamenu-dropdown {
        border-radius: 0;
    }
    
    .megamenu-dropdown-inner {
        padding: 0;
    }
    
    .megamenu-header {
        padding: 15px;
    }
    
    .megamenu-body {
        padding: 15px;
    }
    
    .megamenu-title {
        font-size: 18px;
    }
    
    .subcategories-grid {
        grid-template-columns: 1fr;
    }
    
    .megamenu-image {
        max-height: 200px;
    }
}