/**
 * Header Styles for Titan Fitnes Theme
 * 
 * @package Titan_Fitnes
 * @since 1.0.0
 */

/* ==========================================================================
   Override Parent Theme Styles
   ========================================================================== */
   .site-header {
    padding-block-start: 0 !important;
    padding-block-end: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ==========================================================================
   Top Bar
   ========================================================================== */
.top-bar {
    background-color: #000;
    color: #fff;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.top-bar-container {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 75px;
    height: 80px;
    position: relative;
}

/* ==========================================================================
   Desktop Navigation Bar
   ========================================================================== */
.desktop-navigation {
    background-color: #333333;
    width: 100%;
    height: 50px;
    display: none; /* Hidden on mobile, shown on desktop */
}

.desktop-nav-container {
    width: 100%;
    height: 100%;
    padding: 0 75px;
}

.desktop-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 100%;
}

.desktop-menu > li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.desktop-menu > li > a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 30px;
    color: #fff;
    font-family: 'Sofia Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.desktop-menu > li > a:hover {
    background-color: rgba(198, 255, 10, 0.1);
    border-bottom-color: var(--titan-primary);
}

/* First and Last Menu Items - Lime Background with Black Text */
.desktop-menu > li:first-child > a,
.desktop-menu > li:last-child > a {
    background-color: var(--titan-primary);
    color: #000;
    font-weight: 600;
    border-radius: 0;
}

.desktop-menu > li:first-child > a:hover,
.desktop-menu > li:last-child > a:hover {
    background-color: var(--titan-primary);
    opacity: 0.9;
    border-bottom-color: transparent;
}

/* Active Menu Item */
.desktop-menu > li.current-menu-item > a,
.desktop-menu > li.current_page_item > a {
    border-bottom-color: var(--titan-primary);
}

/* First/Last items - keep lime background even when active */
.desktop-menu > li:first-child.current-menu-item > a,
.desktop-menu > li:last-child.current-menu-item > a,
.desktop-menu > li:first-child.current_page_item > a,
.desktop-menu > li:last-child.current_page_item > a {
    background-color: var(--titan-primary);
    color: #000;
    border-bottom-color: transparent;
}

/* ==========================================================================
   Top Bar Left - Hamburger Menu
   ========================================================================== */
.top-bar-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s ease;
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu:hover .hamburger-line {
    background-color: var(--titan-primary);
}

/* Hamburger Animation when menu is open */
body.mobile-menu-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

body.mobile-menu-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

body.mobile-menu-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ==========================================================================
   Top Bar Center - Logo
   ========================================================================== */
.top-bar-center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.site-logo {
    max-width: 250px;
}

.site-logo a {
    display: inline-block;
    line-height: 0;
}

.logo-image {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

/* ==========================================================================
   Top Bar Right - Icons
   ========================================================================== */
.top-bar-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    padding: 8px;
}

.header-icon:hover {
    color: var(--titan-primary);
}

.header-icon svg {
    width: 24px;
    height: 24px;
}

/* Cart Count Badge */
.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--titan-primary);
    color: #000;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Favorites Count Badge */
.favorites-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* ==========================================================================
   Mobile Navigation Menu (Sidebar)
   ========================================================================== */
.main-navigation {
    position: relative;
}

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

/* Menu Wrapper */
.mobile-menu-wrapper {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background-color: #000;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    overflow-y: auto;
}

body.mobile-menu-open .mobile-menu-wrapper {
    left: 0;
}

/* Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--titan-spacing-sm);
    background-color: #000;
    color: #fff;
}

.mobile-menu-title {
    font-size: 20px;
    font-weight: 700;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.mobile-menu-close:hover {
    color: var(--titan-primary);
}

/* Menu Content */
.mobile-menu-content {
    padding: var(--titan-spacing-sm);
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu li:last-child {
    border-bottom: none;
}

.primary-menu a {
    display: block;
    padding: 15px 10px;
    color: #808080;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.primary-menu a:hover {
    color: #fff;
    padding-left: 20px;
}

.primary-menu li.current-menu-item > a,
.primary-menu li.current_page_item > a {
    color: var(--titan-primary);
}

/* Submenu */
.primary-menu .sub-menu {
    list-style: none;
    padding-left: 20px;
    margin: 0;
}

.primary-menu .sub-menu a {
    font-size: 14px;
    padding: 10px 10px;
}

/* Menu Footer - Social Icons */
.mobile-menu-footer {
    width: 100%;
    padding: 0;
    margin-top: auto;
}

.mobile-menu-logo {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0 20px 0;
}

.footer-logo-image {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.mobile-social-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
    padding: 20px 0;
    width: 100%;
}

/* ==========================================================================
   Search Modal
   ========================================================================== */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
}

.search-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s ease;
}

.search-modal-close:hover {
    color: var(--titan-primary);
}

.search-form-wrapper {
    background-color: #fff;
    padding: var(--titan-spacing-md);
    border-radius: 8px;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 18px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-form input[type="search"]:focus {
    border-color: var(--titan-primary);
}

.search-form button,
.search-form input[type="submit"] {
    margin-top: var(--titan-spacing-sm);
    width: 100%;
    padding: 15px 20px;
    background-color: var(--titan-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover,
.search-form input[type="submit"]:hover {
    background-color: var(--titan-secondary);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile: Hide all icons except cart */
@media (max-width: 767px) {
    .top-bar-container {
        padding: 0 20px;
    }
    
    .header-icons {
        gap: 15px;
    }
    
    /* Hide search, favorites, and profile on mobile */
    .search-icon,
    .favorites-icon,
    .profile-icon {
        display: none;
    }
    
    /* Keep cart icon visible and prominent */
    .cart-icon {
        display: flex !important;
        padding: 10px;
    }
    
    .cart-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .site-logo {
        max-width: 180px;
    }
    
    .logo-image,
    .custom-logo {
        max-height: 50px;
    }
}

@media (min-width: 768px) {
    .top-bar-container {
        height: 100px;
    }
    
    .top-bar-right {
        flex: 0 0 150px;
    }
    
    .header-icons {
        gap: 25px;
    }
    
    .site-logo {
        max-width: 300px;
    }
    
    .logo-image,
    .custom-logo {
        max-height: 70px;
    }
}

@media (min-width: 1024px) {
    .header-icons {
        gap: 30px;
    }
    
    /* Show desktop navigation on larger screens */
    .desktop-navigation {
        display: block;
    }
}

@media (min-width: 1200px) {
    .desktop-menu > li > a {
        padding: 0 35px;
        font-size: 16px;
    }
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

.social-icon {
    border: 1px solid #808080;
    padding: 20px 40px 10px 40px;
}

.mobile-social-icons a {
    color: #808080;
    
}