/* Mega Menu Custom Styles */

.main-menu ul li {
    position: static !important; /* Required for full-width or large mega menus */
}

.main-menu ul li .mega-menu {
    position: absolute;
    top: 100%;
    padding: 8px 12px;
    width: 70%; /* Further reduced width */
    left: 15%;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 999;
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.main-menu ul li:hover .mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Mega Menu Grid Layout */
.mega-menu-column {
    flex: 1;
    min-width: 140px;
    padding: 0 8px;
    margin-bottom: 10px;
}

.mega-menu-title {
    font-size: 11px;
    font-weight: 700;
    color: #14435c;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.mega-menu-item {
    display: flex !important; /* Force flexbox */
    flex-direction: row !important; /* Force side-by-side */
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #f1f4f8;
    background: #ffffff;
    transition: all 0.3s ease;
    text-decoration: none !important;
    margin-bottom: 6px;
    position: relative;
}

.mega-menu-icon {
    width: 30px;
    height: 30px;
    background: #f1f4fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ed2728;
    font-size: 14px;
    margin-right: 12px; /* Gap between icon and content */
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.mega-menu-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.mega-menu-content h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #14435c;
    line-height: 1.2;
}

.mega-menu-content p {
    margin: 0;
    font-size: 10px;
    color: #6c757d;
    line-height: 1.2;
    display: block; /* Restore description */
}

/* Extra row for description to sit below if needed, but keeping it side-by-side with icon for height */
.mega-menu-item:hover {
    background: #f8f9fa;
    transform: translateX(3px);
    border-color: #ed272844;
}

.mega-menu-item:hover .mega-menu-icon {
    background: #ed2728;
    color: #fff;
}

/* Specific Adjustments for Services Wide Dropdown */
.services-menu {
    left: 20% !important;
    width: 60% !important;
}

.company-menu {
    left: auto !important;
    right: 5% !important;
    width: 55% !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
}

.company-menu .mega-menu-column {
    margin-bottom: 0;
}

.company-menu .mega-menu-item {
    margin-bottom: 0;
}

/* Mobile: Company dropdown items in one row */
.company-dropdown-menu {
    display: none;
}

.company-dropdown-menu.show {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px;
    overflow-x: auto;
    white-space: nowrap;
}

.company-dropdown-menu > li {
    flex: 0 0 auto;
}

.company-dropdown-menu .dropdown-item {
    padding: 6px 10px;
    white-space: nowrap;
}

/* Animation for icons inside submenu to match the premium theme */
.mega-menu-item i {
    transition: transform 0.3s ease;
}

.mega-menu-item:hover i {
    transform: translateX(3px);
}

/* Sticky Header Adjustments */
.header-sticky.sticky-bar .mega-menu {
    top: 100%; /* Adjust based on sticky header height if needed */
}

/* Glassmorphism Effect Option */
.mega-menu-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
