/* ═══════════════════════════════════════════════
   Cascading Mega Menu – Styles
   ═══════════════════════════════════════════════ */

/* ── Root container ── */
.cmm-root {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-height: 180px;
}

/* ── Columns ── */
.cmm-col {
    min-width: 220px;
    flex-shrink: 0;
    display: none; /* hidden by default, JS adds .cmm-col-visible */
}

/* Visible columns (class added by JS, or pre-set by PHP for initial state) */
.cmm-col.cmm-col-visible {
    display: block;
}

/* Column separators */
.cmm-col.cmm-col-visible + .cmm-col.cmm-col-visible {
    border-left: 1px solid #e5e7eb;
}

/* ── Groups (one <ul> per parent, hidden by default) ── */
.cmm-group {
    display: none;
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.cmm-group.is-visible {
    display: block;
    animation: cmm-fade-in 0.15s ease-out;
}

/* ── Column headings ── */
.cmm-group-heading {
    padding: 12px 20px 8px;
    font-weight: 700;
    font-size: 13px;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 4px;
    list-style: none;
}

/* ── Items ── */
.cmm-item {
    margin: 0;
    padding: 0;
}

.cmm-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
    border-left: 3px solid transparent;
    transition: background-color 0.12s ease,
                border-left-color 0.12s ease,
                color 0.12s ease;
    cursor: pointer;
}

.cmm-item a:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* Active state – blue accent */
.cmm-item.is-active > a {
    background-color: #eff6ff;
    border-left-color: #2563eb;
    color: #1d4ed8;
    font-weight: 500;
}

/* ── Arrow / icon indicator ── */
.cmm-arrow {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: color 0.12s ease;
}

.cmm-arrow svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.cmm-item.is-active .cmm-arrow {
    color: #2563eb;
}

.cmm-item.is-active .cmm-arrow svg {
    fill: currentColor;
}

/* ── Fade-in animation ── */
@keyframes cmm-fade-in {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Responsive: stack on mobile ── */
@media (max-width: 767px) {
    .cmm-root {
        flex-direction: column;
        min-height: auto;
    }

    .cmm-col {
        min-width: 100% !important;
    }

    .cmm-col.cmm-col-visible + .cmm-col.cmm-col-visible {
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}
