.custom-menu {
    --custom-menu-bg: transparent;
    --custom-menu-text: inherit;
    --custom-menu-border: rgba(3, 102, 214, 0.3);
    --custom-menu-hover-bg: #ddd;
    --custom-menu-hover-text: inherit;
    --custom-menu-active-bg: #007bff;
    --custom-menu-active-text: #fff;
    --custom-menu-toggle-color: #000;
    --custom-menu-card-border: #000;
    --custom-menu-card-hover-bg: #ddd;
    --custom-menu-gap: 0.5rem;
    --custom-menu-padding: 1.5rem;
    --custom-menu-radius: 8px;
    --custom-menu-transition: all 0.3s ease;
    --custom-menu-shadow: rgba(3, 102, 214, 0.3) 0px 0px 0px 3px;
    --custom-menu-card-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

[data-theme="dark"] .custom-menu {
    --custom-menu-hover-bg: #444;
    --custom-menu-hover-text: inherit;
    --custom-menu-active-bg: #0050cc;
    --custom-menu-active-text: #fff;
    --custom-menu-toggle-color: #fff;
    --custom-menu-card-border: #fff;
    --custom-menu-card-hover-bg: #444;
}

.custom-menu {
    list-style: none;
    padding: var(--custom-menu-padding);
    border-radius: var(--custom-menu-radius);
    transition: var(--custom-menu-transition);
    margin: 0.5rem;
    display: flex;
    flex-wrap: wrap;
}

    .custom-menu.custom-menu-vertical {
        box-shadow: var(--custom-menu-shadow);
    }

.custom-menu-item {
    position: relative;
    cursor: pointer;
    transition: var(--custom-menu-transition);
    border-radius: 0.6rem;
    margin: 0.8rem 0 !important;
    padding: 0 !important;
    width: 100%;
}

    .custom-menu-item.open div {
        margin-bottom: 0.5rem;
    }

.custom-menu-leaf {
    margin: 0 !important;
}

.custom-menu-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    width: 100%;
}

.custom-menu-col {
    flex: 0 0 auto;
    padding: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 0) {
    .custom-menu-col {
        width: 100%;
    }
}

@media (min-width: 576px) {
}

@media (min-width: 768px) {
    .custom-menu-col {
        width: 50%;
    }
}

@media (min-width: 992px) {
}

@media (min-width: 1200px) {
    .custom-menu-col {
        width: 33.333333%;
    }
}

@media (min-width: 1400px) {
    .custom-menu-col {
        width: 25%;
    }
}

.custom-menu-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    color: var(--custom-menu-text);
    word-wrap: break-word;
    background-color: var(--custom-menu-bg);
    background-clip: border-box;
    border: 1px solid var(--custom-menu-card-border);
    border-radius: 0.6rem;
    box-shadow: var(--custom-menu-card-shadow);
    transition: var(--custom-menu-transition);
    text-decoration: none;
    padding: 2rem 1rem;
    text-align: center;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

    .custom-menu-card:hover {
        background-color: var(--custom-menu-card-hover-bg);
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }

.custom-menu-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.custom-menu-card-image {
    width: 100px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.custom-menu-card-icon {
    font-size: 2rem;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2.5rem;
}

.custom-menu-card-content {
    text-align: center;
    width: 100%;
}

.custom-menu-card-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
}

.custom-menu li {
    position: relative;
    cursor: pointer;
    transition: var(--custom-menu-transition);
    border-radius: 0.6rem;
    margin: 0.2rem;
    padding: 0.1rem 0;
}

    .custom-menu li > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
    }

    .custom-menu li:not(:has(ul)) a:hover {
        background: var(--custom-menu-hover-bg);
        padding-inline-start: 0.5rem;
        border-radius: 0.6rem;
        transition: var(--custom-menu-transition);
    }

    .custom-menu li:not(:has(ul)):not(.custom-menu > li) > a span::before {
        content: "-";
        margin-inline-end: 8px;
    }

    .custom-menu li a {
        text-decoration: none;
        color: var(--custom-menu-text);
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box;
        padding: 0.8rem 0.5rem;
        cursor: pointer;
    }

.custom-menu ul {
    list-style: none;
    padding-inline-start: 15px;
    cursor: default;
    display: block;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease-in-out, max-height 0.3s ease-in-out;
}

.custom-menu .open > ul {
    opacity: 1;
    max-height: 1000px;
}

.custom-menu .custom-menu-toggle {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-right: 2px solid var(--custom-menu-toggle-color);
    border-bottom: 2px solid var(--custom-menu-toggle-color);
    transition: transform 0.3s ease-out;
}

:not([dir]) .custom-menu .custom-menu-toggle {
    transform: rotate(-45deg);
}

:not([dir]) .custom-menu .open > div .custom-menu-toggle {
    transform: rotate(45deg);
}

[dir="rtl"] .custom-menu .custom-menu-toggle {
    transform: rotate(135deg);
}

[dir="rtl"] .custom-menu .open > div .custom-menu-toggle {
    transform: rotate(45deg);
}

.custom-menu li.active > a {
    background: var(--custom-menu-active-bg);
    color: var(--custom-menu-active-text);
    padding-inline-start: 0.5rem;
    font-weight: bold;
    border-radius: 0.6rem;
    box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px;
    transition: var(--custom-menu-transition);
}

    .custom-menu li.active > a:hover {
        background: color-mix(in srgb, var(--custom-menu-active-bg) 80%, black);
    }

.custom-menu-separator {
    width: 100%;
    margin: 0.5rem 0;
    font-weight: bold;
    padding: 0.5rem;
    border-bottom: 1px solid var(--custom-menu-border);
}

.custom-menu-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0.5rem 0;
    width: 100%;
}

.custom-menu-container {
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    margin-right: auto;
    margin-left: auto;
}
