/* Container defaults */
.ssp-menu-wrapper {
    position: relative;
    width: 100%;
}

/* Reset Lists with important */
.ssp-menu,
.ssp-menu ul {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

/* Desktop Structure */
.ssp-menu-header-mobile,
.ssp-menu-close-mobile {
    display: none;
}

.ssp-menu-logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

.ssp-menu-logo.ssp-logo-desktop {
    margin-right: 30px;
}

/* Level 1 */
.ssp-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0 !important;
    line-height: 1 !important;
}

.ssp-menu>li {
    position: relative;
}

.ssp-menu>li>a {
    padding: 15px;
    text-decoration: none;
    color: #333;
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* Desktop Arrow for submenu */
.ssp-menu li.menu-item-has-children>a::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    vertical-align: middle;
    margin-bottom: 3px;
    transition: transform 0.2s ease;
}

/* Base styles for close buttons */
.ssp-menu-hamburger {
    width: 22px;
    height: 17px;
    display: flex;
    /* controlled by parent */
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.ssp-hamburger-line {
    width: 100%;
    height: 3px;
    background: #262626;
    border-radius: 4px;
}

.ssp-menu-close-mobile {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
}

/* Level 2 (Dropdown) */
.ssp-menu ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    width: max-content;
    max-width: 400px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.ssp-menu>li:hover>ul.sub-menu {
    visibility: visible;
    opacity: 1;
}

.ssp-menu ul.sub-menu a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
}

.ssp-menu ul.sub-menu li:last-child a {
    border-bottom: none;
}

.ssp-menu ul.sub-menu a:hover {
    background: #f9f9f9;
}

/* Level 3 (Flyout to the right) */
.ssp-menu ul.sub-menu li {
    position: relative;
}

.ssp-menu ul.sub-menu ul.sub-menu {
    top: 0;
    left: 100%;
}

.ssp-menu ul.sub-menu li:hover>ul.sub-menu {
    visibility: visible;
    opacity: 1;
}

/* Mobile header structure - Overridden in max-width PHP block but default rules here */
.ssp-menu-header-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.ssp-hamburger-left .ssp-menu-header-mobile {
    flex-direction: row;
}

.ssp-hamburger-right .ssp-menu-header-mobile {
    flex-direction: row-reverse;
}

/* The spacer dynamically matches hamburger to center logo */
.ssp-menu-spacer {
    width: 30px;
}

/* Mobile inner panel logo wrapper */
.ssp-menu-logo-inner-mobile {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.ssp-menu-logo-inner-mobile img {
    max-height: 60px;
}

/* Prevent scrolling when mobile menu is open */
html.ssp-menu-is-open,
html.ssp-menu-is-open body,
body.ssp-menu-is-open {
    overflow: hidden !important;
}