/* ================================
   Review part 8 — sticky fix, mega menu, reviews intro
   ================================ */

/* ---------- Sidebar sticky robuste ---------- */
html, body { overflow-x: clip; }
.single-test,
.test-body,
.test-layout,
.test-content { overflow: visible !important; }

.test-layout {
    align-items: start !important;
}
.test-sidebar {
    position: sticky !important;
    top: 90px !important;
    align-self: start !important;
    height: fit-content;
    z-index: 5;
}
.sidebar-sticky {
    position: static !important;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}
.sidebar-sticky::-webkit-scrollbar { width: 6px; }
.sidebar-sticky::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
@media (max-width: 1100px) {
    .test-sidebar { position: static !important; }
    .sidebar-sticky { max-height: none; overflow: visible; }
}

/* ---------- Reviews intro ---------- */
.reviews-intro {
    padding: 14px 18px;
    background: var(--bg-elev);
    border-left: 3px solid var(--accent-2);
    border-radius: 0 10px 10px 0;
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 20px;
}
.reviews-intro strong { color: var(--accent-2); }

/* ---------- Mega menu (catégories dans header) ---------- */
.main-nav .menu { display: flex; align-items: center; gap: 4px; list-style: none; padding: 0; margin: 0; }
.main-nav .menu > li { position: relative; }
.main-nav .menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: all .2s;
}
.main-nav .menu > li > a:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.main-nav .menu .caret { transition: transform .2s; }
.main-nav .menu li.has-mega:hover .caret { transform: rotate(180deg); }

.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 480px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    list-style: none;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all .25s;
    z-index: 100;
}
.has-mega:hover .mega-menu,
.has-mega:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.mega-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}
.mega-menu li { margin: 0; }
.mega-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    transition: all .2s;
}
.mega-menu a:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}
.mm-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(6, 182, 212, 0.12));
    border-radius: 12px;
    font-size: 22px;
    flex-shrink: 0;
}
.mm-text { display: flex; flex-direction: column; line-height: 1.3; }
.mm-text strong {
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
}
.mm-text small {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

@media (max-width: 900px) {
    .mega-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        min-width: 0;
        grid-template-columns: 1fr;
        box-shadow: none;
        background: transparent;
        border: none;
        padding: 8px 0;
    }
    .has-mega .caret { display: none; }
}
