/* =========================================================
   RAPID SERVICES — SHARED NAVBAR
   Isolated from legacy per-page nav CSS via #rapidNavbar
   ========================================================= */

/* Hide legacy inline nav as soon as shared CSS loads */
nav:not(.navbar) {
    display: none !important;
}

:root {
    --nav-black: #050608;
    --nav-panel: #11151b;
    --nav-red: #ff3038;
    --nav-text: #f5f5f6;
    --nav-muted: #89909c;
}

/* Reserve space for fixed navbar */
body.rapid-has-navbar {
    padding-top: 95px !important;
}

@media (max-width: 650px) {
    body.rapid-has-navbar {
        padding-top: 88px !important;
    }
}

/* =========================================================
   RESET — override legacy page nav styles
   ========================================================= */

#rapidNavbar.navbar,
nav.navbar#rapidNavbar {
    all: unset;
    box-sizing: border-box;
    position: fixed !important;
    top: 15px !important;
    left: 20px !important;
    right: auto !important;
    transform: none !important;
    width: calc(100% - 40px) !important;
    max-width: none !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 15px 0 22px !important;
    margin: 0 !important;
    background: linear-gradient(180deg, rgb(26, 26, 26), rgb(17, 16, 16)) !important;
    border: 1px solid rgba(82, 68, 68, 0.18) !important;
    border-radius: 32px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.507) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    z-index: 99999 !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

#rapidNavbar.navbar::before {
    content: "";
    position: absolute;
    left: 75px;
    right: 75px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
    pointer-events: none;
}

#rapidNavbar .logo {
    all: unset;
    box-sizing: border-box;
    width: 45px !important;
    height: 45px !important;
    flex: 0 0 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    margin: 0 !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 2 !important;
}

#rapidNavbar .logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 50% !important;
    filter: none !important;
    transform: none !important;
}

#rapidNavbar .logo:hover img {
    filter: none !important;
    transform: none !important;
}

#rapidNavbar .nav-center {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 448px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    padding: 4px !important;
    margin: 0 !important;
    background: linear-gradient(180deg, #000000 0%, #00000070 100%) !important;
    border: 1px solid rgba(148, 158, 173, .22) !important;
    border-radius: 23px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 2px 8px rgba(0, 0, 0, .35) !important;
    overflow: visible !important;
    flex: none !important;
    order: unset !important;
}

#rapidNavbar .nav-link {
    all: unset;
    box-sizing: border-box;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 !important;
    color: #858d99 !important;
    text-decoration: none !important;
    border-radius: 19px !important;
    border: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    min-width: unset !important;
    min-height: unset !important;
    text-shadow: none !important;
    transition: color .18s ease, background .18s ease !important;
}

#rapidNavbar .nav-link.home { width: 96px !important; }
#rapidNavbar .nav-link.products { width: 120px !important; }
#rapidNavbar .nav-link.status { width: 101px !important; }
#rapidNavbar .nav-link.support { width: 111px !important; }

#rapidNavbar .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(180deg, #ff3d45 0%, #ef252e 48%, #e91e27 100%) !important;
    box-shadow: 0 3px 12px rgba(255, 25, 35, .30), inset 0 1px 1px rgba(255, 255, 255, .18) !important;
    border: none !important;
    text-shadow: none !important;
}

#rapidNavbar .nav-link:hover {
    color: #d9dde3 !important;
    background: rgba(255, 255, 255, .045) !important;
    border: none !important;
    text-shadow: none !important;
}

#rapidNavbar .nav-link.active:hover {
    color: #ffffff !important;
    background: linear-gradient(180deg, #ff4a51 0%, #f12a33 50%, #e91d26 100%) !important;
    border: none !important;
    text-shadow: none !important;
}

#rapidNavbar .nav-link.products:hover {
    color: #f1f2f4 !important;
    bbackground: rgba(255, 255, 255, .045) !important;
    border: none !important;
}

#rapidNavbar .icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    flex: 0 0 16px;
}

#rapidNavbar .icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#rapidNavbar .nav-right {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
    margin: 0 !important;
    order: unset !important;
}

#rapidNavbar .search {
    width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #858d99;
    border: 0 !important;
    background: transparent !important;
    cursor: pointer;
    padding: 0;
    min-width: unset !important;
    min-height: unset !important;
    transition: color .18s ease;
}

#rapidNavbar .search:hover {
    color: #ffffff;
    border: none !important;
    background: transparent !important;
}

#rapidNavbar .search svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
}

#rapidNavbar .rapid-nav-cart-btn {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    height: 40px !important;
    color: #858d99 !important;
    border: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    padding: 0 !important;
    min-width: unset !important;
    min-height: unset !important;
    transition: color .18s ease !important;
}

#rapidNavbar .rapid-nav-cart-btn:hover {
    color: #ffffff !important;
    border: none !important;
    background: transparent !important;
}

#rapidNavbar .rapid-nav-cart-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#rapidNavbar .customer {
    width: 172px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, #ff444c 0%, #f02730 50%, #df1b24 100%) !important;
    border: none !important;
    box-shadow: 0 5px 16px rgba(0, 0, 0, .35) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    min-width: unset !important;
    min-height: unset !important;
    transition: filter .15s ease, transform .15s ease !important;
}

#rapidNavbar .customer:hover {
    filter: brightness(1.06) !important;
    transform: translateY(-1px) !important;
    border: none !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4) !important;
}

#rapidNavbar .nav-mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    background: rgba(255, 255, 255, .06) !important;
    border-radius: 12px;
    color: #f5f5f6;
    cursor: pointer;
    margin-left: auto;
    margin-right: 8px;
    padding: 0;
    min-width: unset !important;
    min-height: unset !important;
    transition: background .15s ease;
}

#rapidNavbar .nav-mobile-toggle:hover {
    background: rgba(255, 255, 255, .1) !important;
    border: none !important;
    color: #fff !important;
}

#rapidNavbar .nav-mobile-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* =========================================================
   LEGACY CLASS ALIASES (kept for compatibility)
   ========================================================= */

.navbar {
    position: fixed;
    top: 15px;
    left: 20px;
    width: calc(100% - 40px);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 15px 0 22px;
    background: linear-gradient(180deg, rgba(12, 15, 20, .97), rgba(7, 9, 13, .97));
    border: 1px solid rgba(148, 158, 173, .18);
    border-radius: 32px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 99999;
    transform: none;
}

.navbar .logo {
    width: 45px;
    height: 48px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
}

.navbar .logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.nav-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 448px;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 4px;
    background: linear-gradient(180deg, #15191f 0%, #101419 100%);
    border: 1px solid rgba(148, 158, 173, .22);
    border-radius: 23px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 2px 8px rgba(0, 0, 0, .35);
}

.nav-link {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    color: #858d99;
    text-decoration: none;
    border-radius: 19px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease;
}

.nav-link.home { width: 96px; }
.nav-link.products { width: 120px; }
.nav-link.status { width: 101px; }
.nav-link.support { width: 111px; }

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(180deg, #ff3d45 0%, #ef252e 48%, #e91e27 100%);
    box-shadow: 0 3px 12px rgba(255, 25, 35, .30), inset 0 1px 1px rgba(255, 255, 255, .18);
}

.nav-link.active:hover {
    background: linear-gradient(180deg, #ff4a51 0%, #f12a33 50%, #e91d26 100%);
}

.nav-link.products:hover {
    color: #f1f2f4;
    background: linear-gradient(180deg, #3c424a 0%, #343a42 100%);
}

.nav-link.status:hover,
.nav-link.support:hover {
    color: #d9dde3;
    background: rgba(255, 255, 255, .045);
}

.navbar .icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    flex: 0 0 16px;
}

.navbar .icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-right {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar .search {
    width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #858d99;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: color .18s ease;
}

.navbar .search:hover {
    color: #ffffff;
}

.navbar .search svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
}

.search-panel {
    position: fixed;
    top: 90px;
    right: 35px;
    width: min(360px, calc(100vw - 40px));
    display: none;
    flex-direction: column;
    z-index: 100000;
}

.search-panel.open {
    display: flex;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 48px;
    background: #11151b;
    border: 1px solid rgba(148, 158, 173, .25);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

.search-box svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: #858d99;
    stroke-width: 1.65;
    stroke-linecap: round;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
}

.search-box input::placeholder {
    color: #858d99;
}

.search-results {
    margin-top: 8px;
    max-height: 320px;
    overflow-y: auto;
    background: #11151b;
    border: 1px solid rgba(148, 158, 173, .2);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
    display: none;
}

.search-results.has-results {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #f5f5f6;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    transition: background .15s ease;
}

.search-result-item:last-child {
    border-bottom: 0;
}

.search-result-item:hover,
.search-result-item.focused {
    background: rgba(255, 255, 255, .06);
}

.search-result-item img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: #1a1f27;
}

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

.search-result-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 12px;
    color: #858d99;
    margin-top: 2px;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: #858d99;
    font-size: 14px;
}

.search-view-all {
    display: block;
    padding: 12px 16px;
    text-align: center;
    color: #ff4a51;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.search-view-all:hover {
    background: rgba(255, 255, 255, .04);
}

/* =========================================================
   CART
   ========================================================= */

.navbar .cart,
.navbar .rapid-nav-cart-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    color: #858d99;
    text-decoration: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    padding: 0;
    transition: color .18s ease;
}

.navbar .cart:hover,
.navbar .rapid-nav-cart-btn:hover {
    color: #ffffff;
}

.rapid-nav-cart-count {
    background: #ff3038;
    color: #fff;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    margin-left: 2px;
}

.rapid-nav-cart-count.empty {
    display: none;
}

.customer-arrow {
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-arrow svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.nav-mobile-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.nav-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 85vw);
    height: 100%;
    background: linear-gradient(180deg, #12161c 0%, #0a0c10 100%);
    border-right: 1px solid rgba(148, 158, 173, .15);
    z-index: 99999;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    padding: 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-mobile-drawer.open {
    transform: translateX(0);
}

.nav-mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav-mobile-drawer-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-mobile-close {
    width: 36px;
    height: 36px;
    border: 0;
    background: rgba(255, 255, 255, .06);
    border-radius: 10px;
    color: #f5f5f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-mobile-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #c5c9d0;
    text-decoration: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.nav-mobile-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav-mobile-link.active {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: 1px solid rgba(148, 158, 173, .2);
}

.nav-mobile-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.nav-mobile-search {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 44px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
}

.nav-mobile-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
}

.nav-mobile-search input::placeholder {
    color: #858d99;
}

.nav-mobile-actions {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-mobile-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    color: #f5f5f6;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.nav-mobile-customer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: linear-gradient(180deg, #ff444c 0%, #df1b24 100%);
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    #rapidNavbar.navbar,
    nav.navbar#rapidNavbar {
        left: 12px !important;
        width: calc(100% - 24px) !important;
        padding: 0 12px 0 16px !important;
        transform: none !important;
        top: 15px !important;
        right: auto !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        max-width: none !important;
        background: linear-gradient(180deg, rgba(20, 12, 12, 0.97), rgba(0, 0, 0, 0.97)) !important;
        border: 1px solid rgba(148, 158, 173, .18) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, .45) !important;
    }

    #rapidNavbar .nav-center {
        display: none !important;
    }

    #rapidNavbar .nav-mobile-toggle {
        display: flex !important;
    }

    #rapidNavbar .search {
        display: none !important;
    }

    #rapidNavbar .rapid-nav-cart-btn > span:not(.rapid-nav-cart-count) {
        display: none !important;
    }

    #rapidNavbar .customer {
        display: none !important;
    }

    .search-panel {
        right: 12px;
        left: 12px;
        width: auto;
    }
}

@media (max-width: 400px) {
    #rapidNavbar.navbar,
    nav.navbar#rapidNavbar {
        left: 8px !important;
        width: calc(100% - 16px) !important;
        height: 60px !important;
    }

    #rapidNavbar .logo {
        width: 38px !important;
        height: 38px !important;
        flex-basis: 38px !important;
    }
}

body.nav-mobile-open {
    overflow: hidden;
}
