/* =====================================================================
 * NGS Category Navigation Floater — DARK THEME (v1.41.1)
 *
 * Mirrors the product-page Jump-to bubble (.ngs-ps-bubble) styling so
 * the two feel like one system. Black/teal gradient bubble, cyan accent,
 * white text. Only difference: this one lives on CATEGORY archive pages
 * and lists categories (with optional per-cat subtitles and grouping).
 * ===================================================================== */

/* ---------- Outer container (bottom-left fixed) ---------- */
.ngst-cn-floater {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 99989;       /* one below .ngs-ps-floater in case both load */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.ngst-cn-floater[hidden] {
    display: block !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.ngst-cn-floater:not([hidden]) {
    opacity: 1;
    visibility: visible;
}
.ngst-cn-floater * { pointer-events: auto; }

@media (min-width: 992px) {
    .ngst-cn-floater { left: 24px; bottom: 24px; }
}

/* ---------- The pill ---------- */
.ngst-cn-jump {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px 11px 15px;
    background: linear-gradient(135deg, #00b5bd, #0076bd) !important;
    color: #fff;
    border: 0;
    border-radius: 999px;
    font: 700 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    box-shadow:
        0 6px 20px rgba(0, 118, 189, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}
.ngst-cn-jump:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 26px rgba(0, 118, 189, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.ngst-cn-jump:active { transform: translateY(-1px); }
.ngst-cn-jump:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Glow halo behind the pill (matches .ngs-ps-jump pattern) */
.ngst-cn-jump::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    background: radial-gradient(closest-side, rgba(0, 118, 189, 0.5), transparent 70%);
    z-index: -1;
    opacity: 0.85;
    animation: ngst-cn-pulse 2.6s ease-in-out infinite;
    pointer-events: none;
}
.ngst-cn-jump__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: ngst-cn-blink 1.4s ease-in-out infinite;
    flex: 0 0 auto;
}
.ngst-cn-jump__label { font: inherit; }
.ngst-cn-jump__caret { display: inline-flex; transition: transform 0.25s ease; margin-left: 1px; }
.ngst-cn-floater.is-open .ngst-cn-jump__caret { transform: rotate(180deg); }
.ngst-cn-floater.is-open .ngst-cn-jump::after { animation: none; opacity: 0; }

@keyframes ngst-cn-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.85; }
    50%      { transform: scale(1.14); opacity: 0.35; }
}
@keyframes ngst-cn-blink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

/* ---------- Bubble ---------- */
.ngst-cn-bubble {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    min-width: 320px;
    max-width: min(380px, calc(100vw - 32px));
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgb(28, 29, 29) 100%), #000;
    border: 0;
    border-radius: 18px;
    box-shadow:
        inset 0 0 0 1px rgb(0, 140, 189),
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(0, 141, 189, 0.20);
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    transform-origin: bottom left;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    z-index: 9999;
}
.ngst-cn-bubble[hidden] {
    display: block !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
.ngst-cn-floater.is-open .ngst-cn-bubble {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}
.ngst-cn-bubble__inner {
    padding: 16px 10px 10px;
    max-height: 72vh;
    overflow-y: auto;
}

/* ---------- Header ---------- */
.ngst-cn-bubble__header {
    padding: 4px 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}
.ngst-cn-bubble__title {
    font: 700 18px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
    margin: 0 0 4px;
}
.ngst-cn-bubble__subtitle {
    font: 500 11.5px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
    margin: 0;
}

/* ---------- List items ---------- */
.ngst-cn-bubble__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ngst-cn-bubble__list a,
.ngst-cn-bubble__list button {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 9px;
    border: 0;
    width: 100%;
    text-align: left;
    background: transparent;
    border-radius: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
}
.ngst-cn-bubble__list a .ngst-cn-icon,
.ngst-cn-bubble__list button .ngst-cn-icon {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.25s ease;
    flex: 0 0 18px;
    margin-top: 1px;
}
.ngst-cn-bubble__list a:hover,
.ngst-cn-bubble__list button:hover {
    background: rgba(0, 181, 189, 0.12);
    color: #fff;
}
.ngst-cn-bubble__list a:hover .ngst-cn-icon,
.ngst-cn-bubble__list button:hover .ngst-cn-icon { color: #00b5bd; }

/* Current category — same active state as the product page */
.ngst-cn-bubble__list .ngst-cn-item.is-current > a {
    background: linear-gradient(135deg, rgba(0, 181, 189, 0.35) 0%, rgba(0, 138, 144, 0.22) 100%);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 181, 189, 0.4);
}
.ngst-cn-bubble__list .ngst-cn-item.is-current > a .ngst-cn-icon { color: #00b5bd; }

/* Jump to top — same dividing rule as .ngs-ps-bubble__top */
.ngst-cn-bubble__list .ngst-cn-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
    padding-bottom: 13px;
}
.ngst-cn-bubble__list .ngst-cn-top:hover .ngst-cn-icon {
    color: #00b5bd;
    transform: translateY(-2px);
    transition: color 0.25s, transform 0.25s;
}

/* Per-category subtitle (smaller, muted) */
.ngst-cn-text {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}
.ngst-cn-name { display: block; line-height: 1.2; }
.ngst-cn-desc {
    display: block;
    font: 500 10.5px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1px;
}

/* Group title — small uppercase header that separates clusters */
.ngst-cn-group {
    list-style: none;
    padding: 12px 9px 6px;
    font: 700 9.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(0, 181, 189, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 4px;
}
/* First group with no preceding items shouldn't draw a top border */
.ngst-cn-bubble__list > .ngst-cn-group:first-child {
    border-top: 0;
    padding-top: 4px;
    margin-top: 0;
}

/* ---------- Bottom arrow pointer ---------- */
.ngst-cn-bubble__arrow {
    position: absolute;
    bottom: -7px;
    left: 28px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgb(0, 141, 189) 100%), #000;
    border-right: 1px solid rgb(0, 140, 189);
    border-bottom: 1px solid rgb(0, 140, 189);
    transform: rotate(45deg);
}

/* iPhone notch safe area */
@supports (padding: max(0px)) {
    .ngst-cn-floater {
        bottom: max(16px, env(safe-area-inset-bottom));
        left: max(16px, env(safe-area-inset-left));
    }
}

@media (prefers-reduced-motion: reduce) {
    .ngst-cn-floater, .ngst-cn-bubble, .ngst-cn-jump,
    .ngst-cn-jump::after, .ngst-cn-jump__dot,
    .ngst-cn-jump__caret { transition: none !important; animation: none !important; }
}
