/**
 * NextLVL — Vertical Menu Widget.
 *
 * Vertical list navigation with hover glider + mobile accordion.
 * Defaults below match the original design; Elementor style controls
 * override colours/sizes via selectors.
 *
 * @package NextLVL
 */

/* === Container === */
.nlvm-container {
    width: 100%;
    max-width: 320px;
    font-family: inherit;
    box-sizing: border-box;
}
.nlvm-container * { box-sizing: border-box; }

/* === Menu shell ===
 * Background / border / shadow / padding / radius are all driven by Elementor
 * Container style controls (with matching defaults), so they are NOT hardcoded
 * here — a hardcoded value would beat the control selectors. Only structural
 * rules remain.
 *
 * Header colour resolution (one variable, no specificity fights):
 *   --nlvm-color-closed / --nlvm-color-open are published by the two Elementor
 *   colour controls. --nlvm-title-color is the *resolved* colour the title and
 *   chevron actually read. Default state = closed; .open and desktop switch it
 *   to the open colour. */
.nlvm-menu {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --nlvm-color-closed: #111827;
    --nlvm-color-open: #9CA3AF;
    --nlvm-title-color: var(--nlvm-color-closed);
}
/* Mobile: expanded → open colour */
.nlvm-menu.open {
    --nlvm-title-color: var(--nlvm-color-open);
}

/* === Header === */
.nlvm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    /* padding, margin-bottom, divider colour come from Header style controls */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    -webkit-tap-highlight-color: transparent;
}

.nlvm-title {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    /* Resolved by .nlvm-menu (closed) / .nlvm-menu.open / desktop @media. */
    color: var(--nlvm-title-color, #111827);
    transition: color 0.3s ease;
}

.nlvm-chevron {
    flex-shrink: 0;
    /* width/height/margin come from Chevron Size / Gap controls */
    color: var(--nlvm-title-color, #111827);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}
.nlvm-chevron svg { display: block; width: 100%; height: 100%; }

/* Open state — only the chevron flip is structural; colours come from controls */
.nlvm-menu.open .nlvm-chevron {
    transform: rotate(180deg);
}

/* === List === */
.nlvm-list-wrapper {
    position: relative;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.nlvm-menu.open .nlvm-list-wrapper {
    max-height: 1200px;
    opacity: 1;
    visibility: visible;
}

.nlvm-list,
.nlvm-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nlvm-sublist {
    padding-left: 20px;
    margin-top: 4px;
}

/* === Glider === */
.nlvm-glider {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 48px;
    background: #F3F4F6;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    /* transform animates the glide between items; opacity fades it in/out. On
       first appearance the JS snaps transform (transition:none) so the pill
       materialises in place rather than sliding from a parked position. */
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

/* === Item === */
.nlvm-item,
.nlvm-subitem {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 12px;
    text-decoration: none;
    color: #111827;
    z-index: 1;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.2s, color 0.2s;
}
.nlvm-subitem {
    height: 40px;
    font-size: 0.92em;
    opacity: 0.9;
}

.nlvm-icon-box {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.2s;
}
.nlvm-icon-box svg,
.nlvm-icon-box img { display: block; width: 22px; height: 22px; object-fit: contain; }
/* Icon-font glyph (Font Awesome <i>) sizes with its font-size, not width/height. */
.nlvm-icon-box i {
    display: block;
    font-size: 20px;
    line-height: 1;
}

.nlvm-text {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nlvm-item:hover .nlvm-icon-box,
.nlvm-current .nlvm-icon-box {
    opacity: 1;
    transform: scale(1.1);
}

/* Current page */
.nlvm-current { font-weight: 700; }

/* === Desktop (≥768px) === */
@media (min-width: 768px) {
    .nlvm-list-wrapper {
        max-height: none;
        opacity: 1;
        visibility: visible;
    }
    .nlvm-chevron { display: none; }
    .nlvm-header { cursor: default; }
    /* Desktop is always "open" — the list is permanently expanded and there is
       no chevron, so the header uses the Open colour regardless of .open. */
    .nlvm-menu {
        --nlvm-title-color: var(--nlvm-color-open);
    }
}

/* === Mobile (≤767px) === */
@media (max-width: 767px) {
    .nlvm-container { max-width: 100%; }
}

/* === Editor empty notice === */
.nlvm-empty {
    padding: 24px;
    text-align: center;
    color: #6b7280;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    font-size: 14px;
}
