/**
 * Custom Sticky Menu Styles
 * Version: 1.0.0
 */

/* ============================================
   Sticky Menu Base Styles
   ============================================ */

#csm-sticky-menu {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#csm-sticky-menu.csm-position-top {
    top: 0;
    transform: translateY(-100%);
}

#csm-sticky-menu.csm-position-bottom {
    bottom: 0;
    transform: translateY(100%);
}

#csm-sticky-menu.csm-visible {
    transform: translateY(0);
}

#csm-sticky-menu.csm-hidden {
    transform: translateY(-100%);
}

#csm-sticky-menu.csm-position-bottom.csm-hidden {
    transform: translateY(100%);
}

/* ============================================
   Menu Container
   ============================================ */

.csm-menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

/* ============================================
   Logo
   ============================================ */

.csm-logo {
    flex-shrink: 0;
    margin-right: 30px;
}

.csm-logo img {
    height: 40px;
    width: auto;
    display: block;
}

/* ============================================
   Menu Title
   ============================================ */

.csm-menu-title {
    font-size: 18px;
    font-weight: 600;
    margin-right: 30px;
    flex-shrink: 0;
}

/* ============================================
   Menu Wrapper
   ============================================ */

.csm-menu-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

.csm-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================
   Menu Items
   ============================================ */

.csm-menu-item {
    position: relative;
    margin: 0;
    padding: 0;
}

.csm-menu-item a {
    display: block;
    padding: 18px 20px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.csm-menu-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.csm-menu-item.current-menu-item a {
    font-weight: 600;
}

.csm-menu-item.current-menu-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background-color: currentColor;
}

/* ============================================
   Dropdown Menus
   ============================================ */

.csm-menu-item .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: inherit;
    list-style: none;
    margin: 0;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.csm-menu-item:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.csm-menu-item .sub-menu .csm-menu-item a {
    padding: 12px 20px;
}

.csm-menu-item .sub-menu .csm-menu-item a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ============================================
   Mobile Toggle Button
   ============================================ */

.csm-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.csm-hamburger {
    width: 100%;
    height: 3px;
    background-color: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.csm-mobile-toggle.active .csm-hamburger:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.csm-mobile-toggle.active .csm-hamburger:nth-child(2) {
    opacity: 0;
}

.csm-mobile-toggle.active .csm-hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   Responsive Styles
   ============================================ */

@media screen and (max-width: 768px) {
    .csm-mobile-toggle {
        display: flex;
        color: inherit;
    }
    
    .csm-menu-wrapper {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: inherit;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .csm-menu-wrapper.active {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .csm-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .csm-menu-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .csm-menu-item a {
        padding: 15px 20px;
        width: 100%;
    }
    
    .csm-menu-item .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .csm-menu-item.active > .sub-menu {
        max-height: 500px;
    }
    
    .csm-menu-item .sub-menu .csm-menu-item a {
        padding-left: 40px;
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    .csm-logo img {
        height: 35px;
    }
    
    .csm-menu-title {
        font-size: 16px;
        margin-right: auto;
    }
}

@media screen and (max-width: 480px) {
    .csm-menu-container {
        padding: 0 15px;
        min-height: 50px;
    }
    
    .csm-logo {
        margin-right: 15px;
    }
    
    .csm-logo img {
        height: 30px;
    }
    
    .csm-menu-title {
        font-size: 14px;
    }
    
    .csm-menu-wrapper {
        top: 50px;
    }
    
    .csm-menu-wrapper.active {
        max-height: calc(100vh - 50px);
    }
}

/* ============================================
   Accessibility
   ============================================ */

.csm-menu-item a:focus,
.csm-mobile-toggle:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Skip to content link */
.csm-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100000;
}

.csm-skip-link:focus {
    top: 0;
}

/* ============================================
   Animations
   ============================================ */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#csm-sticky-menu.csm-animating {
    animation-duration: 0.3s;
    animation-timing-function: ease-out;
}

#csm-sticky-menu.csm-position-top.csm-animating {
    animation-name: slideDown;
}

#csm-sticky-menu.csm-position-bottom.csm-animating {
    animation-name: slideUp;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    #csm-sticky-menu {
        display: none;
    }
}