/* --- RESET --- */
.sifency-nav-wrapper ul,
.sifency-nav-wrapper li,
.sifency-nav-wrapper a {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
    box-sizing: border-box;
}

.sifency-nav-wrapper {
    position: relative;
    width: 100%;
}

.sifency-nav-container {
    display: flex;
    align-items: center;
    width: 100%;
}

.sifency-nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
}

.sifency-nav-menu > li {
    position: relative;
}

.sifency-nav-menu a {
    display: inline-block;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 8px 4px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.sifency-nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.sifency-nav-menu > li > a:hover::after,
.sifency-nav-menu > li.active > a::after {
    width: 100%;
}

.sifency-nav-menu ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}

.sifency-nav-menu ul.sub-menu li {
    position: relative;
}

.sifency-nav-menu ul.sub-menu li a {
    display: block;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    transition: all 0.25s ease;
}

.sifency-nav-menu ul.sub-menu li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: currentColor;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.25s ease;
}

.sifency-nav-menu ul.sub-menu li a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    padding-left: 24px;
}

.sifency-nav-menu ul.sub-menu li a:hover::before {
    transform: scaleY(1);
}

/* Hover Effect Desktop */
.sifency-nav-menu li:hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- MOBILE ELEMENTS (Hidden by default) --- */
.sifency-menu-toggle {
    display: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: transparent;
    font-size: 18px;
}
.sifency-menu-toggle svg{
    width: 30px;
}
.sifency-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sifency-mobile-close-btn {
    display: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.sifency-mobile-close-btn svg {
    width: 30px;
}

.sifency-mobile-active .sifency-menu-toggle {
    display: flex;
}

.sifency-mobile-active .sifency-nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    
    /* Animation State: Closed */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(40px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    padding: 40px;
    overflow-y: auto;
}

/* State: Open */
.sifency-mobile-active .sifency-nav-menu.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

/* Mobile Menu Items */
.sifency-mobile-active .sifency-nav-menu > li {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.sifency-mobile-active .sifency-nav-menu > li > a {
    font-size: 22px;
    font-weight: 600;
    padding: 16px 20px;
    display: block;
    border-radius: 12px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.sifency-mobile-active .sifency-nav-menu > li > a:hover {
    background-color: rgba(0, 0, 0, 0.08);
    transform: translateX(8px);
}
.sifency-mobile-active .sifency-nav-menu ul.sub-menu {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.02);
    display: none; /* Hidden for JS toggle */
    padding: 12px 20px;
    border-radius: 12px;
    margin-top: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.sifency-mobile-active .sifency-nav-menu ul.sub-menu li a {
    font-size: 16px;
    padding: 10px 0;
    font-weight: 500;
}

.sifency-mobile-active .sifency-nav-menu ul.sub-menu.sub-is-open {
    display: block;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile Close Button (Inside Menu) */
.sifency-mobile-active .sifency-mobile-close-btn {
    display: flex;
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 32px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sifency-mobile-active .sifency-mobile-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

/* Breakpoint 1024 Logic */
@media (max-width: 1024px) {
    .sifency-bp-1024 .sifency-nav-container { display: block; }
    .sifency-bp-1024 { --is-mobile: 1; }
    .sifency-bp-1024 .sifency-nav-menu { display: none; } /* Initially hide until toggled or fixed */
    .sifency-bp-1024.sifency-nav-wrapper { display: block; } 
}

/* Breakpoint 768 Logic */
@media (max-width: 768px) {
    .sifency-bp-768 { --is-mobile: 1; }
    
    .sifency-mobile-active .sifency-nav-menu > li > a {
        font-size: 20px;
    }
}

/* Breakpoint 480 Logic */
@media (max-width: 480px) {
    .sifency-bp-480 { --is-mobile: 1; }
    
    .sifency-mobile-active .sifency-nav-menu {
        padding: 30px 20px;
    }
    
    .sifency-mobile-active .sifency-nav-menu > li > a {
        font-size: 18px;
        padding: 14px 16px;
    }
    
    .sifency-mobile-active .sifency-mobile-close-btn {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

body.sifency-noscroll {
    overflow: hidden;
}