/* =============================
   CONTAINER
============================= */
.ca-ml-container {
    max-width: 1200px;
    padding: 0;
}

/* =============================
   WRAPPER (FIXED HEIGHT + SCROLL CONTROL)
============================= */
.ca-ml-wrapper {
    display: flex;
    height: 500px; /* ✅ MAIN FIX */
    overflow: hidden;
    position: relative;
}

/* =============================
   LEVEL PANELS
============================= */
.ca-ml-level {
    width: 280px;
    height: 100%; /* ✅ REQUIRED */
    border-right: 1px solid #f0f0f0;
    background: #fafafa;
    display: none;
    flex-shrink: 0;
    overflow-y: auto; /* ✅ SCROLL ENABLE */
    scroll-behavior: smooth;
    position: relative;
    transition: all 0.3s ease;
}

/* First level always visible */
.ca-ml-level[data-level="1"] {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

/* Active levels */
.ca-ml-level.active {
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* =============================
   ITEMS
============================= */
.ca-ml-item {
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

/* LEFT BORDER ANIMATION */
.ca-ml-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #ff0068;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.ca-ml-item:hover::before,
.ca-ml-item.active::before {
    transform: translateX(0);
}

/* =============================
   TITLE
============================= */
.ca-ml-title {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
}

/* LINK */
.ca-ml-title a {
    padding: 0 !important;
    font-weight: 400 !important;
    text-decoration: none;
    color: inherit;
    font-family: inherit !important;
}

/* HOVER */
.ca-ml-title:hover {
    background: #f8f9ff;
    color: #ff0068;
}

/* ACTIVE */
.ca-ml-item.active > .ca-ml-title {
    background: #f0f4ff;
    color: #ff0068;
    font-weight: 600;
    box-shadow: inset 4px 0 0 #ff0068;
}

/* =============================
   ARROW
============================= */
.ca-ml-arrow {
    font-size: 18px;
    color: #aaa;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.ca-ml-item:hover .ca-ml-arrow {
    color: #ff0068;
    transform: translateX(3px);
}

/* Hide arrow if no children */
.ca-ml-item[data-has-children="0"] .ca-ml-arrow {
    visibility: hidden;
}

/* =============================
   SCROLLBAR
============================= */
.ca-ml-level::-webkit-scrollbar {
    width: 6px;
}

.ca-ml-level::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ca-ml-level::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.ca-ml-level::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* =============================
   HOVER EFFECT LINE
============================= */
.ca-ml-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff0068;
    transition: width 0.3s ease;
}

.ca-ml-item:hover .ca-ml-title::after {
    width: 100%;
}

/* =============================
   LEVEL VISUAL INDICATOR
============================= */
.ca-ml-level::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff0068;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ca-ml-level.active::before {
    opacity: 1;
}

/* =============================
   ANIMATION
============================= */
.ca-ml-level {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =============================
   TYPOGRAPHY LEVELS
============================= */
.ca-ml-level[data-level="1"] .ca-ml-title {
    font-size: 16px;
}

.ca-ml-level[data-level="2"] .ca-ml-title {
    font-size: 15px;
}

.ca-ml-level[data-level="3"] .ca-ml-title {
    font-size: 14px;
}

/* =============================
   MOBILE
============================= */
@media (max-width: 768px) {
    .ca-ml-wrapper {
        flex-direction: column;
        height: auto;
    }

    .ca-ml-level {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #eee;
        overflow-y: visible;
    }

    .ca-ml-title {
        padding: 16px 20px;
    }
}

/* =============================
   CUSTOM SCROLLBAR (PRO LEVEL)
============================= */

/* Chrome, Edge, Safari */
.ca-ml-level::-webkit-scrollbar {
    width: 4px; 
}

.ca-ml-level::-webkit-scrollbar-track {
    background: transparent;
}

.ca-ml-level::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 88, 0.6);
    border-radius: 10px;
    transition: background 0.3s ease;
}

/* Hover effect */
.ca-ml-level::-webkit-scrollbar-thumb:hover {
    background: #ff0058;
}

.ca-ml-level {
    scrollbar-width: thin;
    scrollbar-color: #ff0058 transparent;
}