/**
 * Category Bar Styles
 * 
 * Dark horizontal navigation bar used on product pages
 * 
 * Version: 1.0.0
 */

/* ============================================
   Category Bar Container
   ============================================ */

.category-bar {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 0;
    border-radius: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* When NOT inside content-header-controls (old pages), use negative margin */
.entry-product > .category-bar {
    margin-top: -60px;
}
.postid-18952 .entry-product > .category-bar {
    margin-top: 0px;
}
/* When inside content-header-controls, no extra margin needed */
.content-header-controls .category-bar {
    margin-top: 0;
}

.category-bar-inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 1440px;
    padding: 0px 15px 0px 130px;
    min-height: 50px;
}

@media (max-width: 1439px) {
    .category-bar-inner {
        padding: 0px 30px;
    }
}

@media (max-width: 1199px) {
    .category-bar-inner {
        padding: 0px 20px;
    }
}

@media (min-width: 1600px) {
    .category-bar-inner {
        justify-content: center;
    }
}

/* ============================================
   Category Items
   ============================================ */

.category-item {
    display: inline-flex;
    align-items: center;
    padding: 16px 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.category-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.category-item.active {
    color: #fff;
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
}

.cat-bar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #c9a227;
    color: #1a2742;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
}

/* ============================================
   Dropdown Wrapper
   ============================================ */

.category-item-wrapper {
    position: relative;
    display: inline-flex;
}

.category-item-wrapper .category-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.category-item-wrapper:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* ============================================
   Dropdown Menu
   ============================================ */

.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.category-dropdown.dropdown-right {
    left: auto;
    right: 0;
}

.category-item-wrapper:hover .category-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s ease;
}

.category-dropdown a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* ============================================
   Hamburger Menu Button
   ============================================ */

.category-bar-hamburger {
    display: none; /* Hidden on desktop */
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    width: 100%;
    justify-content: center;
}

.category-bar-hamburger:hover {
    background: rgba(255, 255, 255, 0.15);
}

.category-bar-hamburger svg {
    flex-shrink: 0;
}

/* Hamburger icon with 3 bars */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

.category-bar-hamburger.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.category-bar-hamburger.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.category-bar-hamburger.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 992px) {
    /* Show hamburger button */
    .category-bar-hamburger {
        display: flex;
    }
    
    /* Hide menu by default on mobile */
    .category-bar-inner {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        background: #1e293b;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Show menu when open */
    .category-bar-inner.mobile-open {
        display: flex;
    }
    
    /* Stack items vertically */
    .category-item-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .category-item {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
        justify-content: space-between;
        border-radius: 0;
        border-bottom: none;
    }
    
    /* Mobile dropdown styling - appears below parent */
    .category-dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        background: rgba(0, 0, 0, 0.2) !important;
        border-radius: 0 !important;
        display: none;
        padding: 0;
        width: 100%;
        min-width: auto;
        left: auto !important;
        right: auto !important;
    }
    
    .category-item-wrapper.dropdown-open .category-dropdown {
        display: block;
    }
    
    .category-dropdown a {
        padding: 12px 20px 12px 40px;
        color: rgba(255, 255, 255, 0.7);
        font-size: 13px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .category-dropdown a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    /* Show dropdown arrow on mobile */
    .dropdown-arrow {
        display: block;
        transition: transform 0.2s ease;
    }
    
    .category-item-wrapper.dropdown-open .dropdown-arrow {
        transform: rotate(180deg);
    }
}
