/* ============================================
   BROLLO KENYA - Executive Navigation System
   REDESIGNED - Cleaner mega menu, better spacing
   Brand colors: Navy (#1A2B4C), Red (#E63946)
   ============================================ */

/* ---------- VARIABLES EXTENSION ---------- */
:root {
    /* Brand Colors - Updated to match official Brollo logo */
    --brand-navy: #1A2B4C;
    --brand-red: #E63946;
    --brand-black: #1A1A1A;
    --brand-white: #FFFFFF;
    
    /* Brand Extended */
    --navy-light: #2A3F66;
    --navy-dark: #0F1A30;
    --red-light: #FF6B7A;
    --red-dark: #C41E2C;
    
    /* Grayscale */
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    
    /* Bevel System */
    --bevel-light: rgba(255, 255, 255, 0.9);
    --bevel-shadow: rgba(0, 0, 0, 0.15);
    --bevel-emboss: inset 0 1px 3px var(--bevel-light), inset 0 -2px 3px var(--bevel-shadow);
    --bevel-deboss: inset 0 2px 4px var(--bevel-shadow), inset 0 -1px 2px var(--bevel-light);
    
    /* Navigation Specific */
    --nav-height: 85px;
    --nav-top-height: 40px;
    --container-width: 1280px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --transition-executive: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- EXECUTIVE HEADER ---------- */
.executive-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--brand-white);
    box-shadow: 0 4px 20px rgba(26, 43, 76, 0.08);
}

/* Top Bar - Contact & Certifications */
.header-top {
    background: linear-gradient(90deg, var(--brand-navy) 0%, var(--navy-dark) 100%);
    color: var(--brand-white);
    height: var(--nav-top-height);
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--brand-red);
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-rail {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.contact-chip {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: 500;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
}

.chip-icon {
    font-size: var(--font-size-sm);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.certification-rail {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.cert-chip {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--brand-white);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.cert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background-color: var(--brand-red);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Main Navigation Bar */
.header-main {
    height: var(--nav-height);
    background-color: var(--brand-white);
    border-bottom: 1px solid var(--gray-200);
}

.header-main .header-container {
    height: 100%;
}

/* Logo with Bevel Effect */
.logo-container {
    flex-shrink: 0;
}

.logo-bevel {
    display: inline-block;
    position: relative;
    padding: 4px;
    background: linear-gradient(145deg, var(--bevel-light), var(--bevel-shadow));
    border-radius: 10px;
}

.logo-bevel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--bevel-emboss), var(--bevel-deboss));
    pointer-events: none;
}

.logo-image {
    display: block;
    height: 70px;
    width: auto;
    position: relative;
    z-index: 1;
    border-radius: 6px;
}

/* ---------- EXECUTIVE NAVIGATION ---------- */
.executive-nav {
    flex: 1;
    margin-left: var(--spacing-xl);
    height: 100%;
}

.nav-primary {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    gap: var(--spacing-xs);
}

.nav-item {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-item--mega {
    position: static;
}

.nav-item--dropdown {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-lg);
    height: 100%;
    color: var(--brand-black);
    font-weight: 600;
    font-size: var(--font-size-base);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-executive);
    position: relative;
    letter-spacing: 0.3px;
}

.nav-link .link-chevron {
    font-size: 10px;
    color: var(--gray-500);
    transition: transform var(--transition-executive);
}

.nav-item:hover .nav-link {
    color: var(--brand-red);
    border-bottom-color: var(--brand-red);
}

.nav-item:hover .link-chevron {
    transform: rotate(180deg);
    color: var(--brand-red);
}

.nav-item.active .nav-link {
    color: var(--brand-red);
    border-bottom-color: var(--brand-red);
    font-weight: 700;
}

/* ===== REDESIGNED MEGA MENU - CLEANER LAYOUT ===== */
.nav-item--mega {
    position: static;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 1100px;
    max-width: 90vw;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(26, 43, 76, 0.25);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.nav-item--mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0;
}

/* Categories Section - Left Side */
.mega-categories {
    padding: 30px;
    background: white;
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.categories-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    position: relative;
    padding-bottom: 8px;
}

.categories-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--brand-red);
    border-radius: 2px;
}

.view-all-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-red);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(230, 57, 70, 0.05);
    border-radius: 30px;
    transition: all 0.2s;
}

.view-all-link:hover {
    background: var(--brand-red);
    color: white;
}

.view-all-link:hover .link-arrow {
    transform: translateX(4px);
}

.link-arrow {
    transition: transform 0.2s;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.category-group {
    margin-bottom: 0;
}

.category-parent {
    font-weight: 700;
    color: var(--brand-navy);
    text-decoration: none;
    font-size: 15px;
    display: inline-block;
    margin-bottom: 15px;
    border-left: 3px solid var(--brand-red);
    padding-left: 12px;
    transition: all 0.2s;
}

.category-parent:hover {
    color: var(--brand-red);
    transform: translateX(3px);
}

.parent-count {
    color: var(--brand-red);
    font-weight: 600;
    margin-left: 5px;
    font-size: 13px;
}

.category-children {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-children li {
    margin-bottom: 10px;
}

.category-child {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    padding: 2px 0;
}

.category-child:hover {
    color: var(--brand-red);
    transform: translateX(3px);
}

.child-count {
    color: var(--gray-400);
    font-size: 11px;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Featured Section - Right Side - FIXED OVERFLOW */
.mega-featured {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    padding: 30px;
    border-left: 1px solid var(--gray-200);
}

.featured-header {
    margin-bottom: 20px;
}

.featured-badge {
    display: inline-block;
    background: var(--brand-red);
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.featured-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0 0 5px 0;
}

.featured-subtitle {
    color: var(--gray-500);
    font-size: 13px;
    margin: 0;
}

.featured-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar */
.featured-grid::-webkit-scrollbar {
    width: 4px;
}

.featured-grid::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.featured-grid::-webkit-scrollbar-thumb {
    background: var(--brand-red);
    border-radius: 4px;
}

.featured-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.featured-card:hover {
    transform: translateX(5px);
    border-color: var(--brand-red);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.1);
}

.featured-image {
    width: 50px;
    height: 50px;
    background: var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-image span {
    font-size: 24px;
    color: var(--gray-500);
}

.featured-info {
    flex: 1;
    min-width: 0;
}

.featured-name {
    display: block;
    color: var(--brand-navy);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-grade {
    color: var(--gray-500);
    font-size: 12px;
}

.featured-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

/* Context Footer - FIXED */
.mega-context {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 15px 30px;
}

.context-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.context-label {
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.context-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.context-tag {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 16px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 30px;
    transition: all 0.2s;
    font-weight: 500;
}

.context-tag:hover {
    background: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
    transform: translateY(-2px);
}

/* ===== SERVICES DROPDOWN - IMPROVED ===== */
.nav-item--dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(26, 43, 76, 0.15);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 25px;
}

.nav-item--dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-grid--services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.service-group-title {
    color: var(--brand-navy);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
}

.service-group-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--brand-red);
}

.dropdown-item {
    display: block;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    transition: all 0.2s;
    border-bottom: 1px dashed var(--gray-200);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    color: var(--brand-red);
    transform: translateX(5px);
}

.dropdown-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.dropdown-footer .btn-text {
    color: var(--brand-red);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.dropdown-footer .btn-text:hover {
    color: var(--brand-navy);
}

/* ---------- HEADER ACTIONS ---------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.search-toggle {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    color: var(--brand-navy);
    cursor: pointer;
    transition: all var(--transition-executive);
}

.search-toggle:hover {
    background: var(--brand-navy);
    color: var(--brand-white);
    border-color: var(--brand-navy);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: all var(--transition-executive);
    border: 2px solid transparent;
    letter-spacing: 0.3px;
}

.btn--primary {
    background: var(--brand-navy);
    color: var(--brand-white);
}

.btn--primary:hover {
    background: var(--navy-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(26, 43, 76, 0.2);
}

.btn--outline {
    background: transparent;
    border: 2px solid var(--brand-navy);
    color: var(--brand-navy);
}

.btn--outline:hover {
    background: var(--brand-navy);
    color: var(--brand-white);
    transform: translateY(-2px);
}

.btn--small {
    padding: 0.5rem 1.25rem;
    font-size: var(--font-size-sm);
}

.btn--block {
    display: block;
    width: 100%;
}

/* ---------- SEARCH OVERLAY ---------- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(26, 43, 76, 0.98);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-executive);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    position: relative;
    width: 600px;
    max-width: 90%;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--brand-white);
    border-radius: 60px;
    padding: 5px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.search-input {
    flex: 1;
    height: 70px;
    padding: 0 30px;
    border: none;
    background: transparent;
    font-size: var(--font-size-lg);
    color: var(--brand-black);
    outline: none;
}

.search-input::placeholder {
    color: var(--gray-400);
    font-weight: 300;
}

.search-submit {
    width: 70px;
    height: 70px;
    border: none;
    background: var(--brand-red);
    color: var(--brand-white);
    border-radius: 60px;
    cursor: pointer;
    transition: all var(--transition-executive);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background: var(--red-dark);
    transform: scale(0.95);
}

.search-close {
    position: absolute;
    top: -80px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--brand-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-executive);
}

.search-close:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
}

/* ---------- MOBILE NAVIGATION ---------- */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background: var(--brand-navy);
    transition: all var(--transition-executive);
    border-radius: 3px;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: var(--brand-white);
    z-index: 2001;
    overflow-y: auto;
    transition: left var(--transition-executive);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-nav-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-300);
    background: var(--brand-white);
    border-radius: 10px;
    font-size: 18px;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-nav-close:hover {
    background: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
}

.mobile-nav-content {
    padding: var(--spacing-md);
}

.mobile-nav-section {
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--spacing-md);
}

.mobile-nav-link {
    display: block;
    padding: var(--spacing-sm) 0;
    color: var(--brand-black);
    font-weight: 600;
    text-decoration: none;
    font-size: var(--font-size-md);
}

.mobile-nav-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    background: transparent;
    border: none;
    font-weight: 600;
    font-size: var(--font-size-md);
    color: var(--brand-black);
    cursor: pointer;
}

.toggle-icon {
    transition: transform var(--transition-executive);
}

.mobile-nav-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.mobile-submenu {
    display: none;
    padding: var(--spacing-sm) 0 var(--spacing-sm) var(--spacing-md);
}

.mobile-submenu.active {
    display: block;
}

.mobile-submenu-link {
    display: block;
    padding: var(--spacing-xs) 0;
    color: var(--gray-600);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color 0.2s;
}

.mobile-submenu-link:hover {
    color: var(--brand-red);
}

.mobile-submenu-link--all {
    color: var(--brand-red);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.mobile-category-group {
    margin-bottom: var(--spacing-md);
}

.mobile-category-parent {
    display: block;
    font-weight: 700;
    color: var(--brand-navy);
    text-decoration: none;
    padding: var(--spacing-xs) 0;
    margin-bottom: var(--spacing-xs);
}

.mobile-category-children {
    padding-left: var(--spacing-md);
}

.mobile-category-child {
    display: block;
    padding: var(--spacing-xs) 0;
    color: var(--gray-600);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.mobile-nav-actions {
    margin: var(--spacing-lg) 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.mobile-nav-contact {
    background: var(--gray-100);
    padding: var(--spacing-md);
    border-radius: 12px;
}

.mobile-contact-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-sm);
}

.contact-label {
    color: var(--gray-600);
}

.contact-value {
    color: var(--brand-black);
    font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
    .mega-menu {
        width: 900px;
    }
    
    .categories-grid {
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .executive-nav {
        margin-left: var(--spacing-md);
    }
    
    .header-actions .btn {
        display: none;
    }
    
    .mega-menu {
        width: 800px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top {
        display: none;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .executive-nav {
        margin-left: 0;
    }
    
    .nav-primary {
        display: none;
    }
    
    .header-main .header-container {
        justify-content: space-between;
    }
    
    .header-actions {
        margin-left: auto;
    }
    
    .search-toggle {
        display: flex;
    }
    
    .mega-menu,
    .dropdown-menu {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo-bevel {
        width: 140px;
    }
    
    .logo-image {
        height: 55px;
    }
}