/* ==========================================================================
   Header Components - UI.com Style
   Version: 1.0.0
   Based on: https://store.ui.com design
   ========================================================================== */

/* ==========================================================================
   1. SITE HEADER LAYOUT
   ========================================================================== */

.site-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E6E6E6;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 24px;
    max-width: 1440px;
    margin: 0 auto;
}

/* ==========================================================================
   2. BRAND SELECTOR (UniFi/UISP/AmpliFi)
   ========================================================================== */

.brand-selector {
    display: flex;
    align-items: center;
    position: relative;
    height: 48px;
}

.brand-selector-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    height: 48px;
}

.brand-logo {
    height: 36px;
    width: auto;
}

.brand-selector-arrow {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F9F9FA;
    border-radius: 40px;
    transition: transform 0.2s ease;
}

.brand-selector-arrow svg {
    width: 10px;
    height: 10px;
    color: #50565E;
}

.brand-selector.open .brand-selector-arrow {
    transform: rotate(180deg);
}

/* Brand Dropdown */
.brand-dropdown {
    position: absolute;
    top: calc(100% - 5px);
    left: 0;
    z-index: 100000;
    padding: 12px 21px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: rgba(33, 35, 39, 0.08) 0px 8px 24px 0px,
                rgba(33, 35, 39, 0.08) 0px 0px 24px 0px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.brand-selector.open .brand-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.brand-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #808893;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.brand-dropdown-item:hover {
    color: #393939;
}

.brand-dropdown-item.active {
    font-weight: 700;
    color: #006FFF;
}

/* Store Selector (EU Store) */
.store-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 4px 0 4px 4px;
    font-size: 12px;
    line-height: 16px;
    color: #50565E;
    cursor: pointer;
    white-space: nowrap;
}

.store-selector-flag {
    width: 15px;
    height: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.store-selector-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   3. CATEGORY NAVIGATION (Horizontal Tabs)
   ========================================================================== */

.category-nav-uicom {
    display: none !important;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 2 1 0%;
    max-width: 820px;
    height: 48px;
}

.category-nav-wrapper {
    position: relative;
    width: 100%;
    height: 48px;
}

/* Scroll container */
.category-nav-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    height: 48px;
    justify-content: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-nav-scroll::-webkit-scrollbar {
    display: none;
}

/* Navigation items */
.category-nav-item {
    display: flex;
    position: relative;
    height: 100%;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.category-nav-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    font-family: "UI Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #393939;
    text-decoration: none;
    transition: color 0.2s linear;
    border-bottom: 2px solid transparent;
}

.category-nav-link:hover {
    color: #000000;
}

.category-nav-link.active {
    color: #006FFF;
    border-bottom-color: #006FFF;
}

/* Scroll fade indicators */
.category-nav-wrapper::before,
.category-nav-wrapper::after {
    content: "";
    display: block;
    position: absolute;
    width: 56px;
    height: 100%;
    top: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.category-nav-wrapper::before {
    left: -1px;
    background-image: linear-gradient(to right, rgb(255, 255, 255) 20%, rgba(0, 0, 0, 0) 100%);
}

.category-nav-wrapper::after {
    right: -1px;
    background-image: linear-gradient(to left, rgb(255, 255, 255) 20%, rgba(0, 0, 0, 0) 100%);
}

.category-nav-wrapper.scroll-left::before,
.category-nav-wrapper.scroll-right::after {
    opacity: 1;
}

/* Scroll arrows */
.category-nav-arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 100%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.category-nav-arrow svg {
    height: 13px;
    color: #909090;
}

.category-nav-arrow.left {
    left: 0;
}

.category-nav-arrow.right {
    right: 0;
}

.category-nav-wrapper:hover .category-nav-arrow.visible {
    opacity: 1;
}

/* ==========================================================================
   4. HEADER ACTIONS (Right Side)
   ========================================================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #393939;
    transition: color 0.2s ease;
}

.header-btn:hover {
    color: #000000;
}

.header-btn img,
.header-btn svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   5. CART ICON WITH BADGE
   ========================================================================== */

.cart-btn {
    position: relative;
}

.cart-icon-wrapper {
    position: relative;
    width: 16px;
    height: 16px;
}

.cart-icon-wrapper svg {
    width: 16px;
    height: 16px;
    color: #393939;
}

.cart-badge {
    display: flex;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    min-width: 14px;
    padding: 0 2px;
    align-items: center;
    justify-content: center;
    background-color: #006FFF;
    border-radius: 14px;
    font-family: "UI Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    color: #FFFFFF;
    box-shadow: rgb(255, 255, 255) 0px 0px 0px 1px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cart-badge.has-items {
    opacity: 1;
}

/* ==========================================================================
   6. RESPONSIVE - Tablet
   ========================================================================== */

@media (max-width: 1200px) {
    .header-top {
        padding: 0 16px;
    }

    .category-nav-uicom {
    display: none !important;
        max-width: 600px;
    }

    .category-nav-link {
        padding: 0 12px;
        font-size: 13px;
    }

    .store-selector {
        display: none;
    }
}

/* ==========================================================================
   7. RESPONSIVE - Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .brand-selector {
        order: 0;
    }

    .brand-dropdown-item {
        font-size: 14px;
    }

    .category-nav-uicom {
    display: none !important;
        display: none;
    }

    .header-actions {
        margin-left: auto;
    }

    /* Mobile: show old category nav */
    .category-nav {
        display: flex !important;
    }
}

/* Hide old category nav on desktop when using new one */
@media (min-width: 769px) {
    .category-nav {
        display: flex !important;
    }
}

/* ==========================================================================
   8. OLD CATEGORY NAV (Mobile Only)
   ========================================================================== */

.category-nav {
    display: flex;
    justify-content: center;
    padding: 0;
    border-top: 1px solid #E6E6E6;
    background: #fff;
    overflow-x: auto;
}

.category-nav-inner {
    display: flex;
    gap: 0;
    padding: 0 16px;
}

.category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #4D4D4D;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    min-width: 70px;
}

.category-link:hover {
    color: #1A1A1A;
}

.category-link.active {
    color: #006FFF;
    border-bottom-color: #006FFF;
}

.category-link img {
    width: auto;
    height: 28px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.category-link:hover img,
.category-link.active img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Hide scrollbar */
.category-nav::-webkit-scrollbar,
.category-nav-inner::-webkit-scrollbar {
    display: none;
}

.category-nav,
.category-nav-inner {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
