/* ============================================================
   Erlab Products Mega Menu — additive stylesheet
   Scoped entirely to .erlab-* classes / #erlabMegaMenu.
   Does not modify or override any existing site selectors.
   ============================================================ */

#erlabMegaMenu {
    display: none;
    position: fixed;
    top: 104px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 104px);
    background: var(--white, #fff);
    z-index: 1001; /* above .product-menu (1000) */
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.1));
    border-top: 1px solid var(--border, #e4e7ec);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.26s cubic-bezier(0.4,0,0.2,1), transform 0.26s cubic-bezier(0.4,0,0.2,1);
    /* Modern, minimal scrollbar — shows only when content overflows */
    scrollbar-width: thin;
    scrollbar-color: var(--border, #e4e7ec) transparent;
}

/* Webkit/Blink scrollbar (Chrome, Edge, Safari) */
#erlabMegaMenu::-webkit-scrollbar { width: 8px; height: 8px; }
#erlabMegaMenu::-webkit-scrollbar-track { background: transparent; }
#erlabMegaMenu::-webkit-scrollbar-thumb {
    background-color: var(--border, #e4e7ec);
    border-radius: 8px;
}
#erlabMegaMenu::-webkit-scrollbar-thumb:hover {
    background-color: var(--muted, #8a95a3);
}

#erlabMegaMenu.erlab-open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.erlab-mega-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 8% 56px;
}

.erlab-mega-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border, #e4e7ec);
}

.erlab-mega-title {
    font-family: var(--font-display, serif);
    font-size: 24px;
    font-weight: 400;
    color: var(--heading, #111620);
}

.erlab-mega-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--muted, #8a95a3);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}
.erlab-mega-close:hover,
.erlab-mega-close:focus-visible {
    color: var(--heading, #111620);
    background: var(--hover-bg, #f0f5ff);
    outline: none;
}

.erlab-mega-body {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.erlab-mega-columns {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.erlab-col-title {
    font-family: var(--font-display, serif);
    font-size: 19px;
    font-weight: 400;
    color: var(--heading, #111620);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent, #1a56db);
    display: inline-block;
}

.erlab-group { margin-bottom: 22px; }
.erlab-group:last-child { margin-bottom: 0; }

.erlab-group-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted, #8a95a3);
    margin-bottom: 8px;
}

.erlab-list { list-style: none; }
.erlab-list li { margin: 0; padding: 0; }

.erlab-link {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--body, #2c3340);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, padding-left 0.2s ease, border-color 0.2s ease;
}

.erlab-link:hover,
.erlab-link:focus-visible,
.erlab-link.erlab-active {
    color: var(--accent, #1a56db);
    padding-left: 8px;
    outline: none;
}
.erlab-link:focus-visible { text-decoration: underline; }

/* ── Preview panel ─────────────────────────────────────────── */
.erlab-preview {
    flex: 0 0 300px;
    min-height: 340px;
    background: var(--hover-bg, #f0f5ff);
    border: 1px solid var(--border, #e4e7ec);
    border-radius: var(--radius-lg, 12px);
    padding: 22px;
    position: sticky;
    top: 0;
}

.erlab-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 296px;
    color: var(--muted, #8a95a3);
    font-size: 13px;
}
.erlab-preview-empty-icon { font-size: 30px; margin-bottom: 10px; opacity: .6; }

.erlab-preview-content {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}
.erlab-preview-content.erlab-visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.erlab-preview-img {
    width: 100%;
    height: 140px;
    border-radius: var(--radius, 8px);
    background: var(--white, #fff);
    border: 1px solid var(--border, #e4e7ec);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: var(--accent, #1a56db);
}
.erlab-preview-img svg { width: 64px; height: 64px; }

.erlab-preview-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--heading, #111620);
    margin-bottom: 8px;
    line-height: 1.35;
}

.erlab-preview-desc {
    font-size: 13px;
    color: var(--body, #2c3340);
    line-height: 1.6;
    margin-bottom: 16px;
}

.erlab-learn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent, #1a56db);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: var(--radius, 8px);
    transition: background 0.2s ease, transform 0.2s ease;
}
.erlab-learn-more:hover,
.erlab-learn-more:focus-visible {
    background: var(--accent2, #0e3a9e);
    transform: translateY(-1px);
    outline: none;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .erlab-mega-body { flex-direction: column; }
    .erlab-preview {
        position: static;
        width: 100%;
        flex: 1 1 auto;
        min-height: unset;
    }
    .erlab-preview-empty { min-height: 80px; }
    .erlab-mega-columns { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    #erlabMegaMenu { top: 84px; height: calc(100vh - 84px); }
}

@media (max-width: 700px) {
    .erlab-mega-columns { grid-template-columns: 1fr; }
    .erlab-mega-inner { padding: 24px 6% 48px; }
}

@media (max-width: 600px) {
    #erlabMegaMenu { top: 76px; height: calc(100vh - 76px); }
    .erlab-mega-title { font-size: 20px; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #erlabMegaMenu,
    .erlab-preview-content,
    .erlab-link { transition: none !important; }
}
