/* Mega Menu Header Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --border-color: #e2e8f0;
    --white: #ffffff;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Header Container */
.custom-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header-logo img {
    max-height: 40px;
    width: auto;
}

.site-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Navigation */
.header-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 2rem;
}

.mega-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.mega-menu-item {
    position: relative;
}

.mega-menu-item > a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mega-menu-item > a:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.mega-menu-item.has-mega-dropdown > a::after {
    content: '▼';
    margin-left: 0.5rem;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

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

/* Mega Menu Dropdown */
.mega-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 800px;
    max-width: 1000px;
}

.mega-menu-item:hover .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    margin-top: 1rem;
}

.mega-menu-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem;
}

/* Mega Menu Columns */
.mega-menu-column {
    min-width: 180px;
}

.mega-menu-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mega-menu-title .arrow {
    font-size: 1rem;
    color: var(--text-gray);
}

.mega-menu-column .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-menu-column .sub-menu li {
    margin: 0;
}

.mega-menu-column .sub-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mega-menu-column .sub-menu a:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    padding-left: 1rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.btn-secondary,
.btn-primary {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-secondary {
    color: var(--text-dark);
    background: transparent;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: var(--text-gray);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .mega-menu-dropdown {
        min-width: 700px;
    }
    
    .mega-menu-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-navigation,
    .header-actions .btn-secondary {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .header-navigation.mobile-active {
        display: block;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        padding: 2rem;
        overflow-y: auto;
    }
    
    .header-navigation.mobile-active .mega-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .header-navigation.mobile-active .mega-menu-item > a {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .header-navigation.mobile-active .mega-menu-dropdown {
        position: static;
        transform: none;
        box-shadow: none;
        margin: 0;
        opacity: 1;
        visibility: visible;
        min-width: auto;
        display: none;
    }
    
    .header-navigation.mobile-active .mega-menu-item.mobile-open .mega-menu-dropdown {
        display: block;
    }
    
    .header-navigation.mobile-active .mega-menu-container {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }
}

/* Special styling for first child (Products like in Zoom) */
.mega-menu-item:first-child > a {
    color: var(--primary-color);
    font-weight: 600;
}
