/*
 * MAIN NAVIGATION CSS
 * Consolidated navigation styles from nevigation.css, style.css, and mobile_style.css
 */

/* ===== GENERAL NAVIGATION STYLES ===== */
body {
    font-family: 'Helvetica', 'Verdana', sans-serif;
}

/* Clearfix */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ===== TOP BAR STYLES ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: rgb(67, 66, 66);
    color: white;
}

.company-icon {
    height: 60px;
    width: auto;
}

/* Search bar styles */
.search-bar {
    display: flex;
    align-items: center;
}

#searchBar {
    padding: 5px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
}

/* Cart icon styles */
.top-bar i.fa-shopping-cart {
    color: white;
    margin-right: 10px;
    cursor: pointer;
    vertical-align: middle;
    font-size: 24px;
}

/* Hide the menu icon by default (for desktop version) */
.menu-icon-bottom {
    display: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px 0;
    text-align: center;
    color: white;
}

/* ===== PRODUCT BAR STYLES ===== */
.product-bar {
    display: flex;
    justify-content: space-between;
    background-color: black;
    padding: 15px 10px;
    margin-bottom: 0;
    align-items: center;
    color: white;
    box-sizing: border-box;
}

.product-bar a {
    text-decoration: none;
    color: white;
    padding: 0 10px;
    text-align: center;
    flex-grow: 1;
}

.product-bar a:hover {
    color: grey;
}

.section {
    flex: 1;
    text-align: center;
    color: white;
}

/* ===== DROPDOWN STYLES ===== */
/* Dropdown styles for desktop */
.dropdown {
    position: relative;
    display: inline-block;
    flex-grow: 1;
    padding: 0;
    margin: 0;
}

.product-bar .dropdown a.section {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0 10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: black;
    width: 100%; /* Match width of parent dropdown */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1000;
    top: 100%;
    left: 0;
    right: 0; /* Ensure it spans the full width */
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: center; /* Center the text */
    border-bottom: 1px solid #333;
}

.dropdown-content a:hover {
    color: grey;
}

/* Nested dropdown styles */
.nested-dropdown {
    position: relative;
    display: block;
}

.nested-dropdown-content {
    display: none;
    position: absolute;
    background-color: #222;
    width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1001;
    left: 100%;
    top: 0;
}

.nested-dropdown:hover .nested-dropdown-content {
    display: block;
}

.nested-dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-bottom: 1px solid #333;
}

.nested-dropdown-content a:hover {
    color: grey;
    background-color: #333;
}

/* Level 2 nested dropdown styles */
.nested-dropdown-level2 {
    position: relative;
    display: block;
}

.nested-dropdown-trigger-level2 {
    position: relative;
}

.nested-dropdown-trigger-level2:after {
    content: "▶";
    position: absolute;
    right: 10px;
    font-size: 10px;
}

.nested-dropdown-content-level2 {
    display: none;
    position: absolute;
    background-color: #333;
    width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1002;
    left: 100%;
    top: 0;
}

.nested-dropdown-level2:hover .nested-dropdown-content-level2 {
    display: block;
}

.nested-dropdown-content-level2 a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-bottom: 1px solid #444;
    background-color: #333;
}

.nested-dropdown-content-level2 a:hover {
    color: grey;
    background-color: #444;
}

/* Mobile nested dropdown styles */
.mobile-nested-dropdown {
    position: relative;
}

.mobile-nested-dropdown-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    cursor: pointer;
    padding: 12px 16px;
    border-bottom: 1px solid #666;
    position: relative;
    background-color: #555;
    color: white;
}

.mobile-nested-dropdown-toggle i {
    position: absolute;
    right: 15px;
}

.mobile-nested-dropdown-content {
    display: none;
    background-color: #666;
    width: 100%;
}

.mobile-nested-dropdown-content.active {
    display: block;
}

.mobile-nested-dropdown-content a {
    padding: 12px 16px;
    border-bottom: 1px solid #777;
    text-align: center;
    background-color: #666;
}

/* Mobile level 2 nested dropdown styles */
.mobile-nested-dropdown-level2 {
    position: relative;
}

.mobile-nested-dropdown-toggle-level2 {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    cursor: pointer;
    padding: 12px 16px;
    border-bottom: 1px solid #777;
    position: relative;
    background-color: #666;
    color: white;
}

.mobile-nested-dropdown-toggle-level2 i {
    position: absolute;
    right: 15px;
}

.mobile-nested-dropdown-content-level2 {
    display: none;
    background-color: #777;
    width: 100%;
}

.mobile-nested-dropdown-content-level2.active {
    display: block;
}

.mobile-nested-dropdown-content-level2 a {
    padding: 12px 16px;
    border-bottom: 1px solid #888;
    text-align: center;
    background-color: #777;
}

/* ===== APPLE SECTION MOBILE ENHANCEMENTS ===== */
/* Apple dropdown toggle button */
#mobile-menu .section:first-child .mobile-dropdown-toggle {
    background-color: #333;
    border-left: 3px solid #0071e3;
    transition: background-color 0.3s ease;
}

#mobile-menu .section:first-child .mobile-dropdown-toggle:hover {
    background-color: #444;
}

#mobile-menu .section:first-child .mobile-dropdown-toggle i {
    color: #0071e3;
    transition: transform 0.3s ease;
}

/* Apple nested dropdowns */
#mobile-apple-dropdown .mobile-nested-dropdown-toggle {
    background-color: #444;
    border-left: 2px solid #0071e3;
    transition: background-color 0.3s ease;
}

#mobile-apple-dropdown .mobile-nested-dropdown-toggle:hover {
    background-color: #555;
}

#mobile-apple-dropdown .mobile-nested-dropdown-toggle i {
    color: #0071e3;
}

/* Apple level 2 nested dropdowns */
#mobile-apple-dropdown .mobile-nested-dropdown-content-level2 {
    border-left: 1px solid rgba(0, 113, 227, 0.3);
}

#mobile-apple-dropdown .mobile-nested-dropdown-toggle-level2 {
    background-color: #555;
    transition: background-color 0.3s ease;
}

#mobile-apple-dropdown .mobile-nested-dropdown-toggle-level2:hover {
    background-color: #666;
}

#mobile-apple-dropdown .mobile-nested-dropdown-toggle-level2 i {
    color: #0071e3;
}

/* Apple links styling */
#mobile-apple-dropdown a {
    transition: background-color 0.3s ease, color 0.3s ease;
}

#mobile-apple-dropdown a:hover {
    background-color: rgba(0, 113, 227, 0.1);
    color: #0071e3;
}

/* Education section styling */
#mobile-education-dropdown .mobile-nested-dropdown-toggle-level2 {
    background-color: #555;
    transition: background-color 0.3s ease;
}

#mobile-education-dropdown .mobile-nested-dropdown-toggle-level2:hover {
    background-color: #666;
}

#mobile-education-dropdown .mobile-nested-dropdown-toggle-level2 i {
    color: #0071e3;
}

#mobile-education-dropdown .mobile-nested-dropdown-content-level2 {
    border-left: 1px solid rgba(0, 113, 227, 0.3);
}

#mobile-education-dropdown a:hover {
    background-color: rgba(0, 113, 227, 0.1);
    color: #0071e3;
}

/* ===== DESKTOP-SPECIFIC STYLES ===== */
@media screen and (min-width: 768px) {
    /* Top bar desktop styles */
    .top-bar {
        justify-content: space-between;
    }

    .company-icon {
        order: -1;
    }

    .search-bar {
        order: 2;
    }

    /* Product bar desktop styles */
    .product-bar {
        padding-left: 20px;
        padding-right: 20px;
    }

    .product-bar a:first-child,
    .product-bar .first-nav-item,
    .product-bar .dropdown:first-child {
        padding-left: 20px;
        margin-left: 0;
    }
    
    .product-bar a:last-child {
        padding-right: 20px;
    }
}

/* ===== MOBILE-SPECIFIC STYLES ===== */
@media screen and (max-width: 767px) {
    /* Top bar mobile styles */
    .top-bar {
        flex-direction: column;
        border: 5px solid rgb(0, 0, 0);
    }

    .menu-icon-bottom {
        display: block;
        order: 1;
        cursor: pointer;
        color: #ddd;
        margin-top: 10px;
        font-size: 24px;
    }

    .company-icon {
        order: -1;
        margin-bottom: 10px;
        height: 80px;
    }

    .search-bar {
        order: 3;
        margin-top: 10px;
    }

    /* Hide Product Bar in Mobile Version */
    .product-bar {
        display: none;
    }

    /* Mobile dropdown styles */
    .mobile-dropdown-content {
        display: none;
        background-color: #555;
        width: 100%; /* Match width of parent */
    }
    
    .mobile-dropdown-content.active {
        display: block;
    }
    
    .mobile-dropdown-content a {
        padding: 12px 16px;
        border-bottom: 1px solid #666;
        text-align: center; /* Center the text */
    }
    
    .mobile-dropdown-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        cursor: pointer;
        padding: 10px 0;
        border-bottom: 1px solid white;
        position: relative;
    }
    
    .mobile-dropdown-toggle i {
        position: absolute;
        right: 15px;
    }
    
    .top-bar .dropdown {
        display: flex;
        align-items: center;
    }
}

/* ===== MOBILE MENU STYLES ===== */
/* Hide mobile menu initially */
#mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100vh;
    background-color: rgb(50, 50, 50);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: left 0.3s ease;
    padding-top: 60px;
}

#mobile-menu.active {
    left: 0;
}

/* Style the links in the mobile menu */
#mobile-menu a {
    display: block;
    text-decoration: none;
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 16px;
    transition: background-color 0.2s ease;
}

#mobile-menu a:hover {
    background-color: rgba(255,255,255,0.05);
}

#mobile-menu a:last-child {
    border-bottom: none;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    background-color: rgba(0,0,0,0.2);
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(0,0,0,0.4);
}

/* Overlay for when menu is active */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

.menu-overlay.active {
    display: block;
}

/* Mobile dropdown styles */
.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: rgb(50, 50, 50);
    color: white;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mobile-dropdown-toggle i {
    transition: transform 0.3s ease;
}

.mobile-dropdown-toggle:hover {
    background-color: rgba(255,255,255,0.05);
}

.mobile-dropdown-content {
    display: none;
    background-color: rgb(60, 60, 60);
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-dropdown-content.active {
    display: block;
    max-height: 1000px;
}

.mobile-dropdown-content a {
    padding: 15px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: left;
    color: rgba(255,255,255,0.9);
    font-size: 15px;
}