/* PPH Media Menu Widget Styles */

.pphmedia-menu-widget {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.pphmedia-menu {
    width: auto;
    position: relative;
    flex: 1;
}

.pphmedia-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
}

.pphmedia-menu-vertical .pphmedia-menu {
    display: flex;
    flex-direction: column;
}

.pphmedia-menu-vertical .pphmedia-menu-list {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
}

.pphmedia-menu-horizontal .pphmedia-menu {
    display: flex;
    flex-direction: row;
}

.pphmedia-menu-horizontal .pphmedia-menu-list {
    flex-direction: row;
    flex-wrap: wrap;
}

.pphmedia-menu-align-left .pphmedia-menu-list {
    justify-content: flex-start;
}

.pphmedia-menu-align-center .pphmedia-menu-list {
    justify-content: center;
}

.pphmedia-menu-align-right .pphmedia-menu-list {
    justify-content: flex-end;
}

.pphmedia-menu-item {
    position: relative;
    margin: 0;
    display: block;
}

.pphmedia-menu-horizontal .pphmedia-menu-item {
    margin-right: 15px;
    display: inline-block;
}

.pphmedia-menu-vertical .pphmedia-menu-item {
    margin-bottom: 10px;
    display: block;
    width: 100%;
}

.pphmedia-menu-link {
    display: block;
    padding: 10px 0;
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pphmedia-menu-link:hover {
    color: #0073aa;
}

.pphmedia-menu-item-has-children > .pphmedia-menu-link::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 8px;
    vertical-align: middle;
}

.pphmedia-menu-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    min-width: 200px;
    z-index: 999;
}

.pphmedia-menu-item-has-children:hover > .pphmedia-menu-submenu {
    display: block;
}

.pphmedia-menu-submenu .pphmedia-menu-item {
    margin: 0;
}

.pphmedia-menu-submenu .pphmedia-menu-link {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.pphmedia-menu-submenu .pphmedia-menu-item:last-child .pphmedia-menu-link {
    border-bottom: none;
}

/* Hamburger Menu Toggle */

.pphmedia-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin: 0;
    z-index: 1000;
}

.pphmedia-menu-toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 20px;
}

.pphmedia-menu-toggle-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333333;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Mobile Styles */

@media (max-width: 768px) {
    .pphmedia-menu-widget {
        flex-direction: row;
        align-items: center;
        position: relative;
        width: 100%;
    }

    .pphmedia-menu-toggle {
        display: block;
        flex-shrink: 0;
        position: relative;
        z-index: 1001;
    }

    .pphmedia-menu {
        width: 100vw;
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        background: #ffffff;
        max-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        margin-left: calc(-50vw + 50%);
    }

    .pphmedia-menu.pphmedia-menu-open {
        max-height: calc(100vh - 60px);
    }

    .pphmedia-menu-list {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100%;
    }

    .pphmedia-menu-item {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .pphmedia-menu-link {
        padding: 15px 20px !important;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }

    .pphmedia-menu-item:last-child .pphmedia-menu-link {
        border-bottom: none;
    }

    .pphmedia-menu-submenu {
        position: static !important;
        display: none !important;
        background: #f9f9f9 !important;
        border: none !important;
        min-width: auto !important;
    }

    .pphmedia-menu-item-has-children:hover > .pphmedia-menu-submenu {
        display: none !important;
    }

    .pphmedia-menu-item-has-children > .pphmedia-menu-link::after {
        display: none;
    }
}

/* Hamburger Animation */

.pphmedia-menu-toggle[aria-expanded="true"] .pphmedia-menu-toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.pphmedia-menu-toggle[aria-expanded="true"] .pphmedia-menu-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.pphmedia-menu-toggle[aria-expanded="true"] .pphmedia-menu-toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}
