/* US Transceivers - Header Styles */

/* Header Main Container */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Top Header Bar */
.header-top-bar {
    background: #ffffff;
    padding: 22px 0;
    border-bottom: 1px solid #e5e7eb;
}

.header-top-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top-bar .site-branding {
    flex-shrink: 0;
}

.header-top-bar .site-branding img {
    width: auto;
    display: block;
}

/* Search Bar */
.header-search-bar {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    position: relative;
}

.header-search-form {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 20px;
    overflow: hidden;
}

.header-search-form input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    color: #374151;
}

.header-search-form input[type="search"]::placeholder {
    color: #9ca3af;
}

.header-search-form button[type="submit"] {
    background: #ea272f;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    transition: background 0.3s ease;
    color: #ffffff;
    font-size: 16px;
    border-radius: 0px 20px 20px 0px;
}

.header-search-form button[type="submit"]:hover {
    background: #c21f26;
}

.header-search-form button[type="submit"] i {
    display: block;
}

/* Search Results Dropdown */
.header-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
}

.header-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.header-search-result-item:last-of-type {
    border-bottom: none;
}

.header-search-result-item:hover {
    background: #f9fafb;
}

.header-search-result-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: #f3f4f6;
}

.header-search-result-img-placeholder {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 16px;
}

.header-search-result-info {
    flex: 1;
    min-width: 0;
}

.header-search-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-search-result-sku {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.header-search-result-price {
    font-size: 13px;
    font-weight: 700;
    color: #304b92;
    flex-shrink: 0;
}

.header-search-results-footer {
    display: block;
    text-align: center;
    padding: 10px 16px;
    font-size: 13px;
    color: #304b92;
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
    transition: background 0.2s ease;
}

.header-search-results-footer:hover {
    background: #f3f4f6;
    color: #ea272f;
}

.header-search-no-results,
.header-search-loading {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

/* Header Right Section */
.header-right-section {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Welcome and Login */
.header-account {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.header-welcome {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-login-link {
    color: #304b92;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-login-link:hover {
    color: #ea272f;
}

/* Cart */
.header-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #304b92;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-cart-icon:hover {
    background: #ea272f;
    transform: scale(1.05);
}

.header-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ea272f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.header-cart-icon:hover .header-cart-count {
    background: #304b92;
}

.header-cart-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-cart-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-cart-total {
    color: #304b92;
    font-weight: 700;
    font-size: 16px;
}

/* Cart Update Animation */
.header-cart-wrapper.cart-updated .header-cart-icon {
    animation: cartPulse 0.3s ease;
}

.header-cart-wrapper.cart-updated .header-cart-count {
    animation: countBounce 0.3s ease;
}

@keyframes cartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes countBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Navigation Menu */
.header-navigation {
    background: #304b92;
}

.header-navigation .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-navigation {
    flex: 1;
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    display: block;
    padding: 16px 11px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: normal;
    transition: all 0.3s ease;
    position: relative;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a {
    background: #ea272f;
    color: #ffffff;
}

/* Dropdown Menu */
.primary-menu li.menu-item-has-children > a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 6px;
    font-size: 12px;
}

.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: max-content;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.primary-menu .sub-menu li a:hover {
    background: #f3f4f6;
    color: #ea272f;
    padding-left: 24px;
}

/* Give each sub-menu li its own positioning context so nested
   submenus open aligned with the hovered link, not the top of the list */
.primary-menu .sub-menu li {
    position: relative;
}

/* Nested Submenus (Categories >> Subcategories) */
.primary-menu .sub-menu .sub-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
}

.primary-menu .sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Arrow indicator for items with children */
.primary-menu .sub-menu li.menu-item-has-children > a::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    padding-left: 15px;
    float: right;
}

.primary-menu .sub-menu li.menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header Hotline */
.header-hotline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.header-hotline:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.hotline-icon {
    width: 15px;
    height: 15px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 15px;
    flex-shrink: 0;
}

.hotline-icon i {
    font-size: 15px;
}

.hotline-icon img {
    width: 15px;
    height: 15px;
    display: block;
}

.hotline-text {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.hotline-label {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 12px;
    line-height: 13.5px;
    letter-spacing: 0%;
    vertical-align: middle;
    color: #ffffff;
}

.hotline-number {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 12px;
    line-height: 14.62px;
    letter-spacing: 0%;
    vertical-align: middle;
    color: #ffffff;
    text-decoration: none;
}

.hotline-number:hover {
    color: #e5e7eb;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .header-top-bar .container,
    .header-navigation .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .header-search-bar {
        max-width: 350px;
        margin: 0 20px;
    }

    .header-right-section {
        gap: 20px;
    }

    .header-welcome,
    .header-cart-label {
        display: none;
    }

    .primary-menu > li > a {
        padding: 16px 14px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .header-top-bar {
        padding: 15px 0;
    }

    .header-top-bar .container {
        flex-wrap: wrap;
        gap: 12px;
        padding: 0 15px;
    }

    .header-top-bar .site-branding img {
        max-height: 45px;
        width: auto;
    }

    .header-right-section {
        gap: 15px;
    }

    .header-login-link {
        font-size: 13px;
    }

    .header-cart-icon {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    .header-cart-total {
        font-size: 14px;
    }

    .header-search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .header-search-form input[type="search"] {
        padding: 10px 16px;
        font-size: 13px;
    }

    .header-search-form button[type="submit"] {
        padding: 10px 20px;
        font-size: 14px;
    }

    .header-navigation .container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-menu-toggle {
        display: block;
        order: 1;
    }

    .header-hotline {
        order: 2;
        width: auto;
    }

    .main-navigation {
        display: none;
        width: 100%;
        order: 3;
    }

    .main-navigation.active {
        display: block;
    }

    .primary-menu {
        flex-direction: column;
        gap: 0;
    }

    .primary-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .primary-menu > li > a {
        padding: 14px 20px;
    }

    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.1);
        display: none;
    }

    .primary-menu li.menu-item-has-children.open > .sub-menu {
        display: block;
    }
}

@media (max-width: 480px) {
    .header-top-bar {
        padding: 12px 0;
    }

    .header-top-bar .container {
        gap: 10px;
        padding: 0 12px;
    }

    .header-top-bar .site-branding img {
        max-height: 38px;
        width: auto;
    }

    .header-right-section {
        gap: 12px;
    }

    .header-account {
        align-items: flex-end;
    }

    .header-welcome {
        font-size: 10px;
        margin-bottom: 1px;
    }

    .header-login-link {
        font-size: 12px;
    }

    .header-cart-icon {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .header-cart-count {
        font-size: 10px;
        min-width: 18px;
        height: 18px;
        top: -4px;
        right: -4px;
    }

    .header-cart-label {
        font-size: 10px;
    }

    .header-cart-total {
        font-size: 13px;
    }

    .header-search-form input[type="search"] {
        padding: 9px 14px;
        font-size: 12px;
    }

    .header-search-form button[type="submit"] {
        padding: 9px 18px;
        font-size: 13px;
    }

    .mobile-menu-toggle {
        font-size: 22px;
        padding: 6px;
    }

    .primary-menu > li > a {
        padding: 12px 15px;
        font-size: 13px;
    }

    .primary-menu .sub-menu li a {
        padding: 9px 15px;
        font-size: 13px;
    }

    .header-hotline {
        padding: 8px 15px;
    }

    .hotline-icon img,
    .hotline-icon i {
        width: 13px;
        height: 13px;
        font-size: 13px;
    }

    .hotline-label,
    .hotline-number {
        font-size: 11px;
    }
}
