/*
Theme Name: Brilliant Silver Header
Description: Custom WordPress theme with advanced header menu system featuring desktop hover menus and mobile hamburger navigation
Version: 1.0.0
Author: Your Name
Text Domain: brilliant-silver-header
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #E5E4E2;
    position: relative;
    padding-top: 100px; /* Add space for fixed header positioned 40px from top */
}

body.menu-open {
    overflow: hidden;
}

/* Header wrapper to contain the menu */
.header-wrapper {
    position: fixed;
    top: 40px; /* Position header 40px from top */
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    background-color: #01153E;
}

.header-wrapper.header-hidden {
    transform: translateY(-140px); /* Move up by header height + 40px offset */
}

/* Ensure menu appears below the fixed header */
.unified-menu {
    top: 100%;
    margin-top: 10px; /* Small gap below header */
}

/* Menu and Icons column */
.menu-icons-column {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: #01153E;
    position: relative;
}

/* Desktop-specific styles */
@media (min-width: 769px) {
    .menu-icons-column {
        max-width: 800px;
        margin: 0 0 0 auto; /* Right align the header */
    }
}

.left-section {
    display: flex;
    align-items: center;
    gap: 30px;
}

.right-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.shop-link {
    color: #E5E4E2;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
}

.left-section i,
.right-section i {
    color: #E5E4E2;
    font-size: 18px;
    cursor: pointer;
}

.header-link {
    color: #E5E4E2;
    text-decoration: none;
    font-size: 14px;
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ffd700;
    color: #01153E;
    font-size: 10px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Unified Menu */
.unified-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #E5E4E2;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
    overflow-y: auto;
}

/* Desktop-specific menu positioning */
@media (min-width: 769px) {
    .unified-menu {
        right: 0;
        width: 800px;
        left: auto;
        transform: none;
        top: 100%;
        margin-top: 10px; /* Small gap below header */
        border-top: 5px solid transparent; /* Add invisible border to bridge gap */
        position: absolute;
    }
    
    /* Add a hover bridge to prevent menu from closing */
    .header-wrapper::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 15px; /* Adjusted for smaller gap */
        background: transparent;
        z-index: 999;
    }
}

.unified-menu.active {
    display: block;
}

.menu-promo {
    background-color: #8B0000;
    color: #E5E4E2;
    padding: 15px;
    text-align: center;
    font-size: 14px;
}

.menu-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.back-btn, .close-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

.back-btn {
    visibility: hidden;
}

.back-btn.visible {
    visibility: visible;
}

.close-btn {
    font-size: 24px;
}

.menu-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
}

/* Category list - first level menu */
.category-container {
    flex: 1;
}

.category-list {
    padding: 30px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

/* Desktop-specific category list styling */
@media (min-width: 769px) {
    .category-list {
        display: flex !important;
        flex-direction: column;
    }
}

/* Mobile-specific category list styling */
@media (max-width: 768px) {
    .category-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
        border-right: none;
    }
    
    .category-list.mobile-hidden {
        display: none !important;
    }
    
    .menu-header {
        display: flex;
    }
    
    .menu-container {
        flex-direction: column;
    }
    
    .category-container {
        width: 100%;
    }
    
    .category-item {
        flex-direction: column;
        text-align: center;
        padding: 0;
        border-bottom: none;
        background-color: #f8f8f8;
        border-radius: 5px;
        overflow: hidden;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .mobile-category-image-container {
        display: block;
        position: relative;
    }
    
    .category-name {
        padding: 12px 10px;
        font-weight: bold;
    }
    
    .category-item .promo-tag {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
    }
    
    .subcategory-content {
        padding: 15px;
        display: block;
    }
    
    .subcategory-list {
        width: 100%;
    }
    
    .subcategory-list.active {
        display: block;
    }
    
    .subcategory-item {
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 16px;
    }
    
    .desktop-only {
        display: none;
    }
    
    /* Make unified menu full screen on mobile */
    .unified-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin-top: 0;
        border: none;
    }
}

.category-item {
    display: flex;
    align-items: center;
    color: #01153E;
    text-decoration: none;
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.mobile-category-image-container {
    display: none;
}

.mobile-category-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.category-name {
    flex: 1;
}

.category-item .promo-tag {
    display: inline-block;
    font-size: 10px;
    color: #E5E4E2;
    background-color: #d20000;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 10px;
    vertical-align: middle;
}

.category-item:hover {
    color: #8B0000;
}

.category-item.active {
    color: #8B0000;
    font-weight: bold;
}

/* Subcategory content - second level menu */
.subcategory-content {
    flex: 2;
    padding: 30px;
    display: flex;
}

.subcategory-list {
    flex: 1;
    display: none;
}

.subcategory-list.active {
    display: flex;
}

.subcategory-list-content {
    flex: 1;
}

.subcategory-promo {
    flex: 1;
    margin-left: 30px;
    text-align: center;
}

.subcategory-promo img {
    max-width: 100%;
    border-radius: 5px;
    margin-bottom: 15px;
}

.subcategory-promo .flash-sale {
    margin-top: 10px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 12px;
    color: #d20000;
}

.subcategory-promo .promo-price {
    font-size: 20px;
    font-weight: bold;
    margin: 5px 0 15px;
}

.subcategory-item {
    display: block;
    color: #01153E;
    text-decoration: none;
    padding: 10px 0;
    font-size: 15px;
}

.subcategory-item:hover {
    color: #8B0000;
}

.shop-all-btn {
    background-color: #01153E;
    color: #E5E4E2;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: background-color 0.3s;
}

.shop-all-btn:hover {
    background-color: #333;
}

/* Desktop-specific styles */
.desktop-only {
    display: block;
}
