/* Mega Menu Styling */
/* Removed empty container ruleset */


.nav-item.dropdown-mega {
    position: relative !important;
    display: flex;
    align-items: center;
    height: 100%;
    /* Ensure it spans the full header height */
}

.main-header .dropdown-menu {
    display: none;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 20px 0;
    margin-top: 0 !important;
    animation: slideDownFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    top: var(--header-height) !important;
    margin-top: 5px !important;

    /* Center under parent link */
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: max-content !important;
    min-width: 420px !important;
    max-width: 580px !important;

    background: #ffffff;
    z-index: 1050;
    max-height: none !important;
    overflow-y: visible !important;
}

/* Match dark mode background exactly */
[data-theme="dark"] .main-header .dropdown-menu {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.main-header .dropdown-menu.show {
    display: block !important;
}

.mega-menu-content-wrapper {
    width: 100%;
    padding: 0 16px;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.mega-menu-container {
    display: block;
    width: 100%;
}

@media (max-width: 991px) {
    .mega-menu-container {
        grid-template-columns: 1fr;
    }
}

.mega-menu-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

[data-theme="dark"] .mega-menu-section:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.02);
}

.mega-menu-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.05);
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .mega-menu-title {
    color: #94a3b8;
}

.mega-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #475569;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    background: transparent;
}

[data-theme="dark"] .mega-menu-item {
    color: #cbd5e1;
}

.mega-menu-item:hover {
    background: rgba(59, 130, 246, 0.03);
    transform: translateX(2px);
    color: var(--primary-color);
}

[data-theme="dark"] .mega-menu-item:hover {
    background: rgba(255, 255, 255, 0.015);
    color: #ffffff;
}

.mega-menu-icon {
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 18px;
    color: #3b82f6;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.mega-menu-item:hover .mega-menu-icon {
    background: #3b82f6;
    color: #ffffff;
    transform: scale(1.05);
}

.mega-menu-info {
    flex-grow: 1;
    padding-right: 10px;
    overflow: hidden;
}

.mega-menu-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .mega-menu-name {
    color: #f1f5f9;
}

.mega-menu-desc {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 0;
    white-space: normal;
    opacity: 0.8;
}

.mega-menu-price-col {
    padding-left: 14px;
    border-left: 1px solid rgba(226, 232, 240, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 90px;
    text-align: left;
}

[data-theme="dark"] .mega-menu-price-col {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.mega-menu-price-col span {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mega-menu-price-col strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-dark);
}

[data-theme="dark"] .mega-menu-price-col strong {
    color: #f1f5f9;
}

/* Nav Link Polish - Clean & Consistent */
.main-header .nav-link {
    cursor: pointer;
    padding: 0 20px !important;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark) !important;
    transition: all 0.2s ease;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    text-transform: capitalize;
}

[data-theme="dark"] .main-header .nav-link {
    color: #e2e8f0 !important;
}

.main-header .nav-link:hover,
.main-header .nav-item.show .nav-link {
    color: var(--primary-color) !important;
}

/* Custom Dropdown Arrow */
.main-header .nav-link::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    opacity: 0.5;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: none !important;
    margin-left: 0;
}

.main-header .nav-item.show .nav-link::after {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary-color);
}

/* Clean up Bootstrap defaults */
.main-header .dropdown-toggle::before {
    display: none !important;
}

/* Mega Menu Badge Modernization */
.mega-menu-badge {
    padding: 2px 8px;
    font-size: 9px;
    font-weight: 800;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-popular {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-new {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-hot {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-ai {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}