/* ==========================================================
   NEXUS DARK MD · RED SIGNATURE
   Encabezado con logotipo panorámico (grande) + fondo negro
   ========================================================== */

/* ---------- AJUSTES RÁPIDOS DEL LOGO ----------
   --logo-w    : ancho de la caja del logo
   --logo-h    : alto de la caja (la barra mide 80px)
   --logo-zoom : agranda la imagen para recortar el margen vacío
                 (1 = sin zoom, 1.4 = recomendado, 1.8 = muy grande)
------------------------------------------------ */
.compras-topbar {
    --logo-w: 380px;
    --logo-h: 80px;
    --logo-zoom: 1.45;
}

/* ICONOS */
.compras-topbar svg,
.nexus-global-header svg {
    width: 17px;
    height: 17px;
    flex: none;
    max-width: 48px;
    max-height: 48px;
}

/* BARRA PRINCIPAL */
.compras-topbar {
    height: 80px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2.4%;
    position: sticky;
    top: 0;
    z-index: 60;
    isolation: isolate;

    /* Negro uniforme de punta a punta */
    background: linear-gradient(180deg, #080607 0%, #050304 100%);

    backdrop-filter: blur(15px) saturate(130%);
    -webkit-backdrop-filter: blur(15px) saturate(130%);

    border-top: 1px solid rgba(255,255,255,.08);

    box-shadow:
        0 8px 25px rgba(0,0,0,.55),
        inset 0 1px 0 rgba(255,255,255,.04);

    color: #f7f5f5;
    font-family: 'Segoe UI', Arial, sans-serif;
    width: 100%;
}

/* TEXTURA (solo rayas grises) */
.compras-topbar:before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .20;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 9px);
}

/* LÍNEA ROJA INFERIOR */
.compras-topbar:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    z-index: 3;
    pointer-events: none;

    background: linear-gradient(
        90deg,
        transparent 0%,
        #8e0018 12%,
        #ff1838 45%,
        #ff6678 50%,
        #ff1838 55%,
        #8e0018 88%,
        transparent 100%
    );

    box-shadow:
        0 0 7px rgba(255,0,35,.9),
        0 0 17px rgba(255,0,35,.55);
}

/* DIAGONALES ROJAS */
.compras-hdr-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.compras-hdr-deco i {
    position: absolute;
    top: 0;
    height: 100%;
    left: 0;
}

.compras-hdr-deco .s2 {
    width: min(29vw,480px);
    background: linear-gradient(180deg,#ff7b88,#ff1838 55%,#a5001b);
    clip-path: polygon(99% 0, 100% 0, 88.5% 100%, 87.5% 100%);
    filter: drop-shadow(0 0 5px #ff1838);
}

.compras-hdr-deco .s1 {
    width: min(29vw,480px);
    background: linear-gradient(180deg, rgba(255,255,255,.8), #ff1838 50%, #800015);
    clip-path: polygon(97.5% 0, 98% 0, 87% 100%, 86.5% 100%);
}

/* ==========================================================
   LOGOTIPO PANORÁMICO
   ========================================================== */
.compras-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    flex: 0 0 var(--logo-w);
    width: var(--logo-w);
    height: var(--logo-h);
    min-width: 0;

    position: relative;
    z-index: 2;

    text-decoration: none;
    color: inherit;
    overflow: hidden;           /* recorta el margen sobrante al hacer zoom */
}

.compras-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;

    object-fit: cover;
    object-position: left center;

    transform: scale(var(--logo-zoom));
    transform-origin: left center;

    mix-blend-mode: screen;

    filter:
        drop-shadow(0 0 4px rgba(255,0,0,.35))
        drop-shadow(0 0 9px rgba(255,0,0,.12));
}

/* LOGOTIPO DE TEXTO (si no hay imagen) */
.compras-brand-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    line-height: 1;
}

.compras-brand-text .nx {
    font-size: 42px;
    font-style: italic;
    letter-spacing: -5px;
    transform: skewX(-8deg);
    display: inline-flex;
}

.compras-brand-text .nx b {
    background: linear-gradient(#fff,#8a8a8a 70%,#ddd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.compras-brand-text .nx i {
    font-style: inherit;
    background: linear-gradient(#ff3b3b,#b00000);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.compras-brand-text .sep {
    width: 1px;
    height: 38px;
    background: rgba(255,255,255,.4);
}

.compras-brand-text h2 {
    font-size: 19px;
    font-style: italic;
    letter-spacing: -.5px;
    margin: 0;
}

.compras-brand-text h2 em {
    color: #ff1838;
}

.compras-brand-text small {
    display: block;
    font-size: 8px;
    letter-spacing: 5px;
    margin-top: 6px;
    font-weight: 500;
    color: #ddd;
}

/* MENÚ */
.compras-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    margin-left: auto;
}

.compras-menu > a,
.compras-menu .dd > a,
.compras-menu .dd > button {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 11px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    color: #e9e5e6;
    cursor: pointer;
    transition: .25s ease;
    white-space: nowrap;
    text-decoration: none;
}

.compras-menu > a.active {
    background: linear-gradient(180deg,rgba(255,35,55,.20),rgba(120,0,0,.13));
    border-color: rgba(255,35,55,.75);
    box-shadow: 0 0 12px rgba(255,0,35,.20), inset 0 0 12px rgba(255,0,35,.10);
}

.compras-menu > a.active .compras-h-ic {
    color: #ff334f;
}

.compras-menu .compras-h-ic {
    width: 17px;
    height: 17px;
    flex: none;
}

.compras-menu .dd {
    position: relative;
}

.compras-menu .dd-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 200px;
    padding: 8px;
    border-radius: 12px;
    display: none;
    background: rgba(12,5,7,.98);
    border: 1px solid rgba(255,40,60,.5);
    box-shadow: 0 12px 30px rgba(0,0,0,.65), 0 0 18px rgba(255,0,35,.16);
}

.compras-menu .dd.open .dd-menu {
    display: block;
}

.compras-menu .dd-menu a,
.compras-menu .dd-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    color: #eee;
    cursor: pointer;
}

.compras-menu .dd-menu a:hover,
.compras-menu .dd-menu button:hover {
    background: rgba(255,30,45,.16);
    color: #fff;
}

/* HERRAMIENTAS */
.compras-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex: none;
    position: relative;
    z-index: 2;
}

.compras-search {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 190px;
    height: 38px;
    padding: 0 12px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(0,0,0,.40);
}

.compras-search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 13.5px;
    color: #fff;
}

.compras-search input::placeholder {
    color: #aaa;
}

.compras-search .compras-h-ic {
    width: 19px;
    height: 19px;
    flex: none;
}

.compras-icon-btn {
    position: relative;
    width: 36px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: .25s;
    flex: none;
    color: inherit;
    text-decoration: none;
}

.compras-icon-btn .compras-h-ic {
    width: 23px;
    height: 23px;
}

.compras-icon-btn .b {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ff1838;
    box-shadow: 0 0 8px #ff1838;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.compras-icon-btn .pt {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff1838;
    box-shadow: 0 0 8px #ff1838;
}

.compras-top-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: none;
    border: 2px solid rgba(255,255,255,.75);
    display: grid;
    place-items: center;
    background: rgba(10,5,6,.7);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: .25s;
}

.compras-top-avatar .compras-h-ic {
    width: 24px;
    height: 24px;
}

.compras-top-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* BRILLO DEL MENÚ */
.compras-menu > a,
.compras-menu .dd > a,
.compras-menu .dd > button,
.compras-icon-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.compras-menu > a::after,
.compras-menu .dd > a::after,
.compras-menu .dd > button::after,
.compras-icon-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(110deg,transparent 18%,rgba(255,255,255,.22) 50%,transparent 82%);
    transform: translateX(-135%);
    transition: transform .6s ease;
}

.compras-menu > a:hover::after,
.compras-menu .dd > a:hover::after,
.compras-menu .dd > button:hover::after,
.compras-icon-btn:hover::after {
    transform: translateX(135%);
}

.compras-menu > a:hover,
.compras-menu .dd > a:hover,
.compras-menu .dd > button:hover,
.compras-icon-btn:hover,
.compras-top-avatar:hover {
    color: #fff;
    background-color: rgba(255,30,50,.14);
    border-color: rgba(255,60,80,.65);
    text-shadow: 0 0 6px rgba(255,255,255,.85), 0 0 13px rgba(255,35,65,.8);
    box-shadow: 0 0 9px rgba(255,35,55,.4), inset 0 0 10px rgba(255,24,56,.13);
    transform: none;
}

.compras-menu > a:hover .compras-h-ic,
.compras-menu .dd > button:hover .compras-h-ic,
.compras-icon-btn:hover .compras-h-ic {
    color: #ff4a5f;
    filter: drop-shadow(0 0 5px rgba(255,35,65,.85));
}

.compras-menu > a:focus-visible,
.compras-menu .dd > button:focus-visible,
.compras-icon-btn:focus-visible {
    outline: 2px solid rgba(255,50,80,.9);
    outline-offset: 3px;
}

/* RESPONSIVE */
@media(max-width:1350px) {
    .compras-topbar { --logo-w: 320px; }

    .compras-search { width: 165px; }

    .compras-menu > a,
    .compras-menu .dd > button {
        padding: 0 8px;
        font-size: 12.5px;
    }
}

@media(max-width:1100px) {
    .compras-topbar { --logo-w: 270px; }

    .compras-search { display: none; }

    .compras-menu { gap: 2px; }
}

@media(max-width:850px) {
    .compras-topbar {
        --logo-w: 260px;
        --logo-h: 60px;
        height: auto;
        min-height: 80px;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .compras-menu {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        margin-left: 0;
    }

    .compras-tools { margin-left: auto; }
}

@media(max-width:520px) {
    .compras-topbar {
        --logo-w: 210px;
        --logo-h: 52px;
    }

    .compras-menu > a,
    .compras-menu .dd > button {
        height: 34px;
        padding: 0 8px;
        font-size: 11px;
    }

    .compras-tools .compras-icon-btn { width: 30px; }

    .compras-top-avatar {
        width: 34px;
        height: 34px;
    }
}

/* ACCESIBILIDAD */
@media(prefers-reduced-motion:reduce) {
    .compras-menu > a::after,
    .compras-menu .dd > button::after,
    .compras-icon-btn::after {
        transition: none;
    }
}/* QUITAR BRILLO AL PASAR EL CURSOR SOBRE LOS LOGOTIPOS */
.nexus-global-header .compras-brand,
.nexus-global-header .compras-brand:hover {
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
    transform: none !important;
    border-color: transparent !important;
}

.nexus-global-header .compras-brand::before,
.nexus-global-header .compras-brand::after {
    box-shadow: none !important;
    filter: none !important;
}

.nexus-global-header .compras-brand-emblem,
.nexus-global-header .compras-brand-wordmark {
    filter: none !important;
}