.shm-11117-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.shm-11117-item {
    display: inline-block;
    position: relative;
}

.shm-11117-item-link,
.shm-11117-submenu-link {
    display: block;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.shm-11117-item-link {
    padding: 10px 20px;
}

.shm-11117-submenu-link {
    padding: 10px 20px;
    font-size: 0.9em;
    color: #333;
}

.shm-11117-text-wrapper {
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}

.shm-11117-primary,
.shm-11117-secondary {
    display: block;
    white-space: nowrap;
    line-height: 1.2;
    transition: opacity 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}

.shm-11117-primary {
    opacity: 1;
}

/* Hover effect on the link text itself */
.shm-11117-item-link:hover .shm-11117-primary,
.shm-11117-item:hover > .shm-11117-item-link .shm-11117-primary,
.shm-11117-submenu-link:hover .shm-11117-primary {
    opacity: 0;
}

/* Slide Up Animation */
.shm-11117-dir-up .shm-11117-secondary {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    text-align: inherit;
    padding: inherit;
}

.shm-11117-dir-up .shm-11117-item-link:hover .shm-11117-text-wrapper,
.shm-11117-dir-up .shm-11117-item:hover > .shm-11117-item-link .shm-11117-text-wrapper,
.shm-11117-dir-up .shm-11117-submenu-link:hover .shm-11117-text-wrapper {
    transform: translateY(-100%);
}

/* Slide Down Animation */
.shm-11117-dir-down .shm-11117-secondary {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    text-align: inherit;
    padding: inherit;
}

.shm-11117-dir-down .shm-11117-item-link:hover .shm-11117-text-wrapper,
.shm-11117-dir-down .shm-11117-item:hover > .shm-11117-item-link .shm-11117-text-wrapper,
.shm-11117-dir-down .shm-11117-submenu-link:hover .shm-11117-text-wrapper {
    transform: translateY(100%);
}

/* Mega Menu & Submenu Base Styles */
.shm-11117-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    --shm-x: -50%;
    --shm-y: 10px;
    transform: translateX(var(--shm-x)) translateY(var(--shm-y));
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    background-color: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 0;
}

/* Modifier classes for JS positioning */
.shm-11117-dropdown.shm-11117-align-left {
    left: 0;
    transform: translateX(0) translateY(var(--shm-y));
}
.shm-11117-dropdown.shm-11117-align-right {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(var(--shm-y));
}

/* Ensure a safe hover area so menu doesn't close prematurely */
.shm-11117-dropdown::before {
    content: '';
    position: absolute;
    top: calc(-1 * var(--shm-y) - 10px);
    left: 0;
    width: 100%;
    height: calc(var(--shm-y) + 10px);
    min-height: 20px;
}

/* Hover State triggers the dropdown */
.shm-11117-item:hover > .shm-11117-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.shm-11117-item:hover > .shm-11117-dropdown:not(.shm-11117-align-left):not(.shm-11117-align-right) {
    transform: translateX(var(--shm-x)) translateY(0);
}
.shm-11117-item:hover > .shm-11117-dropdown.shm-11117-align-left,
.shm-11117-item:hover > .shm-11117-dropdown.shm-11117-align-right {
    transform: translateX(0) translateY(0);
}

.shm-11117-mega-content {
    padding: 20px;
    width: 100%;
}

/* Submenu specific styles */
.shm-11117-submenu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
}

.shm-11117-submenu-item {
    display: block;
}