/**
 * Header CSS
 */

.xtech-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.xtech-header.scrolled {
    background: rgba(8, 8, 8, 0.92);
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.xtech-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.xtech-header__logo a {
    display: inline-flex;
    align-items: center;
}

.xtech-header__logo img {
    height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.xtech-header__logo-text {
    font-family: var(--xtech-font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.xtech-header__logo-text span {
    color: var(--xtech-primary);
}

/* ---------- Desktop Navigation ---------- */
.xtech-nav {
    display: none;
}

@media (min-width: 1024px) {
    .xtech-nav {
        display: block;
        flex: 1 1 auto;
    }
}

.xtech-nav__list {
    display: flex;
    list-style: none;
    gap: 2.25rem;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

.xtech-nav__list > li {
    position: relative;
}

.xtech-nav__list a {
    color: var(--xtech-text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.6rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.01em;
    transition: color 0.25s ease;
}

.xtech-nav__list a:hover,
.xtech-nav__list .current-menu-item > a,
.xtech-nav__list li:hover > a {
    color: #fff;
}

.xtech-nav__list > li > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--xtech-gradient);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.xtech-nav__list > li:hover > a::after,
.xtech-nav__list .current-menu-item > a::after {
    width: 100%;
}

/* Caret */
.xtech-nav__caret {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.xtech-nav__has-dropdown:hover .xtech-nav__caret {
    transform: rotate(-180deg);
    opacity: 1;
}

/* Mega dropdown */
.xtech-nav__mega {
    display: block !important;
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    width: 320px;
    max-width: 92vw;
    background: rgba(12, 12, 12, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--xtech-radius-xl);
    padding: 1.25rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 140, 0, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s 0.28s;
    z-index: 120;
}

.xtech-nav__has-dropdown:hover .xtech-nav__mega,
.xtech-nav__has-dropdown:focus-within .xtech-nav__mega,
.xtech-nav__has-dropdown.is-open .xtech-nav__mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.xtech-nav__mega::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 0;
    width: 100%;
    height: 18px;
}

.xtech-nav__mega-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.xtech-nav__mega-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--xtech-radius-lg);
    border: 1px solid transparent;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.015);
}

.xtech-nav__mega-item:hover {
    background: rgba(255, 140, 0, 0.08);
    border-color: rgba(255, 140, 0, 0.25);
    transform: translateX(2px);
}

.xtech-nav__mega-item strong,
.xtech-nav__mega-item em {
    display: block;
    font-style: normal;
}

.xtech-nav__mega-item strong {
    color: #fff;
    font-weight: 700;
    font-size: 0.98rem;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.xtech-nav__mega-item em {
    color: var(--xtech-text-muted);
    font-size: 0.78rem;
}

.xtech-nav__mega-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 140, 0, 0.12);
    color: var(--xtech-primary);
    border: 1px solid rgba(255, 140, 0, 0.2);
}

.xtech-nav__mega-icon svg {
    width: 22px;
    height: 22px;
}

/* ---------- Header Actions ---------- */
.xtech-header__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.xtech-header__action-btn {
    background: none;
    border: none;
    color: var(--xtech-text-secondary);
    cursor: pointer;
    position: relative;
    padding: 0.55rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s ease, background 0.25s ease;
}

.xtech-header__action-btn:hover {
    color: var(--xtech-primary);
    background: rgba(255, 140, 0, 0.08);
}

.xtech-cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--xtech-gradient);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    height: 16px;
    min-width: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(10, 10, 10, 0.92);
}

@media (max-width: 1023px) {
    .xtech-header__action-btn--account { display: none; }
}

/* ---------- Hamburger ---------- */
.xtech-hamburger {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 16px;
    width: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    z-index: 1100; /* above mobile menu */
}

@media (min-width: 1024px) {
    .xtech-hamburger {
        display: none;
    }
}

.xtech-hamburger__line {
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.xtech-hamburger.active .xtech-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.xtech-hamburger.active .xtech-hamburger__line:nth-child(2) {
    opacity: 0;
}
.xtech-hamburger.active .xtech-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile Menu ---------- */
.xtech-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh;
    background: rgba(8, 8, 8, 0.96);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

@media (max-width: 480px) {
    .xtech-mobile-menu { max-width: 100%; }
}

.xtech-mobile-menu.active {
    right: 0;
}

.xtech-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.xtech-mobile-menu__logo img {
    height: 34px;
    width: auto;
}

.xtech-mobile-menu__close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.xtech-mobile-menu__close:hover,
.xtech-mobile-menu__close:focus {
    background: rgba(255, 140, 0, 0.15);
    border-color: rgba(255, 140, 0, 0.4);
    color: var(--xtech-primary);
    transform: rotate(90deg);
}

/* Mobile inline search */
.xtech-mobile-menu__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 1.5rem 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.xtech-mobile-menu__search:focus-within {
    border-color: rgba(255, 140, 0, 0.5);
    background: rgba(255, 140, 0, 0.05);
}

.xtech-mobile-menu__search svg {
    color: var(--xtech-text-muted);
    flex-shrink: 0;
}

.xtech-mobile-menu__search input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}

.xtech-mobile-menu__search input::placeholder {
    color: var(--xtech-text-muted);
}

.xtech-mobile-menu__body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.xtech-mobile-menu__list {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
}

.xtech-mobile-menu__list--premium li {
    margin-bottom: 0.85rem;
    transform: translateX(24px);
    opacity: 0;
    transition: transform 0.45s ease, opacity 0.45s ease;
}

.xtech-mobile-menu.active .xtech-mobile-menu__list--premium li {
    transform: translateX(0);
    opacity: 1;
}

.xtech-mobile-menu.active .xtech-mobile-menu__list--premium li:nth-child(1) { transition-delay: 0.08s; }
.xtech-mobile-menu.active .xtech-mobile-menu__list--premium li:nth-child(2) { transition-delay: 0.14s; }
.xtech-mobile-menu.active .xtech-mobile-menu__list--premium li:nth-child(3) { transition-delay: 0.20s; }
.xtech-mobile-menu.active .xtech-mobile-menu__list--premium li:nth-child(4) { transition-delay: 0.26s; }
.xtech-mobile-menu.active .xtech-mobile-menu__list--premium li:nth-child(5) { transition-delay: 0.32s; }
.xtech-mobile-menu.active .xtech-mobile-menu__list--premium li:nth-child(6) { transition-delay: 0.38s; }

.xtech-mobile-menu__list--premium a {
    display: flex;
    align-items: center;
    background: rgba(22, 22, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--xtech-radius-lg);
    padding: 0.95rem 1.1rem;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.xtech-mobile-menu__list--premium a:hover {
    background: rgba(30, 30, 30, 0.92);
    border-color: rgba(255, 140, 0, 0.35);
    transform: translateX(3px);
}

.xtech-mobile-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 140, 0, 0.12);
    border-radius: 10px;
    margin-right: 1rem;
    color: var(--xtech-primary);
    border: 1px solid rgba(255, 140, 0, 0.2);
    flex-shrink: 0;
}

.xtech-mobile-cat-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--xtech-font-heading);
}

/* Utility block inside mobile menu */
.xtech-mobile-menu__utility {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.xtech-mobile-menu__utility-link {
    color: var(--xtech-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.25rem;
}

.xtech-mobile-menu__utility-link:hover {
    color: var(--xtech-primary);
}

/* ---------- Search Overlay ---------- */
.xtech-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(8, 8, 8, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.xtech-search-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.xtech-search-overlay__form {
    width: 100%;
    max-width: 820px;
    padding: 0 2rem;
    position: relative;
}

.xtech-search-overlay__input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--xtech-border);
    color: #fff;
    font-size: 2.25rem;
    font-family: var(--xtech-font-heading);
    font-weight: 700;
    padding: 1rem 0;
    outline: none;
    transition: border-color 0.3s ease;
    letter-spacing: -0.01em;
}

.xtech-search-overlay__input:focus {
    border-color: var(--xtech-primary);
}

.xtech-search-overlay__input::placeholder {
    color: #555;
}

.xtech-search-overlay__close {
    position: absolute;
    top: -62px;
    right: 2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.25s ease;
}

.xtech-search-overlay__close:hover {
    background: rgba(255, 140, 0, 0.15);
    border-color: rgba(255, 140, 0, 0.45);
    color: var(--xtech-primary);
    opacity: 1;
    transform: rotate(90deg);
}

/* Body lock when menus open */
body.xtech-menu-open,
body.xtech-search-open {
    overflow: hidden;
}
