/* ===============================
   PREMIUM HEADER FIX
   يحيد user line و يصلح search/header
================================ */

body {
    overflow-x: hidden;
}

/* Hide old duplicated bars/search from previous headers */
.z12-header,
.z12-mobile-search,
.site-header:not(.premium-header) {
    display: none !important;
}

.premium-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    background:
        linear-gradient(180deg, rgba(2,8,18,0.98), rgba(2,8,18,0.94)) !important;
    border-bottom: 1px solid rgba(0,157,255,0.18);
    backdrop-filter: blur(14px);
}

.premium-header-inner {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    min-height: 86px;
    padding: 0 34px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 640px;
    gap: 22px;
    align-items: center;
}

.premium-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
}

.premium-logo img {
    width: 270px;
    max-height: 72px;
    object-fit: contain;
    display: block;
}

.premium-logo-fallback strong {
    display: block;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    letter-spacing: 1px;
}

.premium-logo-fallback span {
    color: rgba(255,255,255,0.62);
    font-size: 13px;
}

.premium-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.premium-nav::-webkit-scrollbar {
    display: none;
}

.premium-nav a {
    position: relative;
    min-height: 54px;
    padding: 0 14px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.88) !important;
    text-decoration: none;
    font-weight: 950;
    white-space: nowrap;
    border: 1px solid transparent;
}

.premium-nav a span {
    font-size: 18px;
    line-height: 1;
}

.premium-nav a b {
    color: inherit !important;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.premium-nav a:hover,
.premium-nav a.active {
    color: #fff !important;
    background: rgba(255,122,0,0.13);
    border-color: rgba(255,122,0,0.18);
}

.premium-nav a.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -8px;
    height: 2px;
    border-radius: 10px;
    background: linear-gradient(90deg, #ff8500, #ffb000);
}

.premium-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.premium-search {
    width: 330px;
    height: 48px;
    display: grid;
    grid-template-columns: 1fr 78px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.12);
}

.premium-search input {
    min-width: 0;
    width: 100%;
    height: 48px;
    border: 0 !important;
    outline: 0;
    padding: 0 15px;
    background: transparent !important;
    color: #fff !important;
    font-size: 14px;
}

.premium-search input::placeholder {
    color: rgba(255,255,255,0.50);
}

.premium-search button {
    height: 48px;
    border: 0;
    cursor: pointer;
    color: #fff;
    font-weight: 950;
    background: linear-gradient(135deg, #ff8500, #ffb000);
}

.premium-icon-link,
.premium-account-link {
    position: relative;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff !important;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.premium-icon-link {
    font-size: 22px;
}

.premium-icon-link span,
.premium-account-link span {
    font-size: 14px;
    color: #fff !important;
}

.premium-cart-link em {
    position: absolute;
    top: 2px;
    left: 13px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #ff8500;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
}

.premium-menu-btn {
    display: none;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    font-size: 23px;
    background: linear-gradient(135deg, #ff8500, #ffb000);
}

/* يحيد السطر الأزرق القديم نهائياً */
.z12-actions,
.z12-cart-btn,
.z12-account-btn,
.z12-menu-btn,
.nav-badge {
    display: none !important;
}

/* Main spacing */
.premium-site-main,
.site-main {
    padding-top: 0 !important;
}

/* Light mode يخلي header dark حتى ف light */
body.theme-light .premium-header {
    background:
        linear-gradient(180deg, rgba(2,8,18,0.98), rgba(2,8,18,0.94)) !important;
}

body.theme-light .premium-nav a,
body.theme-light .premium-nav a b,
body.theme-light .premium-icon-link,
body.theme-light .premium-account-link,
body.theme-light .premium-account-link span,
body.theme-light .premium-icon-link span {
    color: #fff !important;
}

/* Responsive */
@media (max-width: 1500px) {
    .premium-header-inner {
        grid-template-columns: 270px minmax(0, 1fr) 520px;
        padding: 0 24px;
    }

    .premium-logo img {
        width: 235px;
    }

    .premium-search {
        width: 260px;
    }

    .premium-nav a {
        padding: 0 11px;
    }
}

@media (max-width: 1200px) {
    .premium-header-inner {
        grid-template-columns: 240px 1fr auto;
    }

    .premium-search {
        display: none;
    }

    .premium-icon-link span,
    .premium-account-link span {
        display: none;
    }
}

@media (max-width: 900px) {
    .premium-header-inner {
        min-height: 78px;
        grid-template-columns: 1fr auto;
        padding: 0 14px;
    }

    .premium-logo img {
        width: 210px;
    }

    .premium-nav {
        position: fixed;
        top: 78px;
        left: 12px;
        right: 12px;
        display: none;
        padding: 12px;
        border-radius: 18px;
        background: rgba(2,8,18,0.98);
        border: 1px solid rgba(0,157,255,0.20);
        box-shadow: 0 18px 55px rgba(0,0,0,0.35);
        overflow: visible;
        flex-direction: column;
        align-items: stretch;
    }

    .premium-nav.open {
        display: flex;
    }

    .premium-nav a {
        width: 100%;
        justify-content: flex-start;
    }

    .premium-nav a.active::after {
        display: none;
    }

    .premium-header-right {
        gap: 8px;
    }

    .premium-icon-link {
        display: none;
    }

    .premium-menu-btn {
        display: grid;
        place-items: center;
    }
}

@media (max-width: 560px) {
    .premium-logo img {
        width: 178px;
    }

    .premium-account-link {
        display: none;
    }

    .premium-header-inner {
        min-height: 72px;
    }

    .premium-nav {
        top: 72px;
    }
}