/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic:wght@400;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Base header styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 80px;
    z-index: 9999;
    /* backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); */
    /* transition: all 0.3s ease; */
    height: 100px;
    background-color: transparent;
    width: 100vw;
}
.site-header::before {
    content: '';
    position: absolute;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background-color: #DEDFE0;
    display: none;
}

/* Show all submenus when any menu item is hovered */
.header-navigation:hover .submenu-expanded {
    visibility: visible !important;
    pointer-events: auto;
    transition: all 0.1s ease-in;
    transition-delay: 0.3s;
    transform: translateY(0);
    /* max-height: max-content; */
}
.submenu-bg.show  {
    display: block;
    position: absolute;
    width: 100%;
    left: 0;
    top: 100px;
    background: #F5F5F5;   
    border-top: 1px solid #DEDFE0;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.site-header:hover::before {
    display: block !important;
}
.header-container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    /* padding: 0 40px; */
}

.header-company-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    height: 48px;
}

.header-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 50px;
    flex-shrink: 0;
}

.header-logo {
    width: 200px;
    height: 52px;
    object-fit: contain;
}

.header-logo-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Logo switching based on hover state */
.header-logo-default {
    display: block;
}

.header-logo-hover {
    display: none;
}

/* When site-header is hovered, switch to hover logo (only on homepage) */
.site-header:hover .header-logo-default {
    display: none;
}

.site-header:hover .header-logo-hover {
    display: block;
}

/* Scrolled state styles (only on homepage) */
.site-header.scrolled {
    background-color: #FFFFFF !important;
    transition: all 0.3s ease;
}

/* When scrolled, change all text colors (only on homepage) */
.site-header.scrolled .header-menu-item,
.site-header.scrolled .language-switcher-item{
    color: #0F0F0F !important;
}
.site-header.scrolled .mobile-menu-toggle>span {
    background-color: #0F0F0F !important;
}
.site-header.scrolled .header-company-text {
    color: #0F0F0F !important;
}

/* When scrolled, switch to hover logo (only on homepage) */
.site-header.scrolled .header-logo-default {
    display: none;
}

.site-header.scrolled .header-logo-hover {
    display: block;
}

/* Homepage specific styles - allow background switching */
.home .site-header,
.front-page .site-header {
    background-color: transparent;
    transition: background-color 0.3s ease;
}

/* When homepage is scrolled or hovered */
.home .site-header.scrolled,
.front-page .site-header.scrolled,
.home .site-header:hover,
.front-page .site-header:hover {
    background-color: #FFFFFF !important;
}

/* For non-homepage pages, always show default logo and set background */
/* Base style for all menu-section after elements (hidden by default) */
/* Base style for all menu-section after elements (hidden by default) */
.menu-section::after {
    content: "";
    position: absolute;
    top: 69px;
    left: 50%;
    margin-left: -6px;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 100%;
    opacity: 0;
    z-index: 2;
    transform: translateY(-20px);
    transition: opacity .3s ease, transform .3s ease;
}

.menu-section.active>.header-menu-item {
    color: var(--primary-color) !important;
}

/* Show the dot with animation when menu-section has active class */
.menu-section.active::after {
    opacity: 1;
    transform: translateY(0);
    animation: dotDropDown .2s ease-out;
}

/* Animation keyframes for dot dropping down */
@keyframes dotDropDown {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header-company-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.5em;
    color: #F6F6F6;
}
.submenu-expanded {
  position: absolute;
  top: 74px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0px);
  pointer-events: none;
  z-index: 1000;
}

.header-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0;
    opacity: 1;
    visibility: visible;
}

.header-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* width: 123px; */
    height: 48px;
    text-decoration: none;
     
    font-weight: 600;
    font-size: 18px;
    line-height: 150%;
    letter-spacing: 0;
    color: #FFFFFF;
    position: relative;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    border-radius: 12px;
}

.language-switcher-item{
    color: #FFFFFF;
    font-weight: 400;
    font-size: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
}
.header-menu-item:hover {
    color: #0F0F0F;
}
.header-navigation:hover .submenu-expanded {
    display: block;
}

/* When any header-menu-item is hovered, all header-menu-items get the same color */
.header-menu-item:hover ~ .header-menu-item,
.header-menu-item:hover + .header-menu-item,
.header-navigation:hover .header-menu-item,
.header-navigation:hover .language-switcher-item {
    color: #0F0F0F;
}

/* Alternative approach using parent selector */
.header-navigation:has(.header-menu-item:hover) .header-menu-item, .header-navigation:has(.language-switcher-item:hover) .language-switcher-item {
    color: #0F0F0F;
}

/* When expanded menu is shown, all header menu items get the same color */
.header-expanded-menu.show ~ .header-navigation .header-menu-item,
.header-expanded-menu.show + .header-navigation .header-menu-item,
.header-navigation:has(~ .header-expanded-menu.show) .header-menu-item,
.header-navigation:has(~ .header-expanded-menu.show) .language-switcher-item {
    color: #0F0F0F;
}

/* Alternative approach using sibling selector */
.site-header:has(.header-expanded-menu.show) .header-menu-item, .site-header:has(.language-switcher-item:hover) .language-switcher-item {
    color: #0F0F0F;
}

/* When site-header is hovered, all header menu items get the same color */
.site-header:hover .header-menu-item, .site-header:hover .language-switcher-item {
    color: #0F0F0F;
}
.site-header:hover .mobile-menu-toggle>span {
    background-color: #0F0F0F !important;
}
/* Change site-header background when header-menu-item is hovered */
.header-menu-item:hover ~ .site-header,
.header-menu-item:hover + .site-header,
.site-header:hover {
    background-color: #FFFFFF !important;
}

/* Alternative approach using parent selector */
.site-header:has(.header-menu-item:hover) {
    background-color: #FFFFFF !important;
}

.header-menu-item.active {
    font-weight: 600;
}
.header-menu-item.active::after {
    width: 6px;
    height: 6px;
    background: linear-gradient(180deg, #97C686 0%, #6CC6F3 100%);
    border-radius: 50%;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.header-menu-item.has-children {
    gap: 8px;
}

.header-dropdown-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.header-menu-item:hover .header-dropdown-icon {
    transform: rotate(180deg);
}

/* Expanded Menu Dropdown */
.header-expanded-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #FFFFFF;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    /* Add padding-top to create a bridge to the header */
    margin-top: -10px;
    padding: 0 40px;
    max-height: 0;
    overflow: hidden;
}

.submenu-expanded.show{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Create a bridge between header and dropdown */
.header-expanded-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background-color: transparent;
}

.expanded-menu-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    /* padding: 0 40px; */
}

.expanded-menu-block {
    width: 162px;
    height: 50px;
    background-color: #FFFFFF;
    flex-shrink: 0;
}

.expanded-menu-content {
    /* display: flex;
    gap: 0;
    max-width: 80%; */

    display: flex;
    justify-content: center;
    visibility: visible;
}

.menu-section {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 120px;
    text-align: center;
    align-items: center;
    position: relative;
    margin: 10px;
}

.menu-section-item:nth-child(1) {
    margin-top: 30px;
}

.menu-section-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* width: 123px; */
    /* height: 48px; */
    padding: 8px 0;
    text-decoration: none;
     
    font-weight: 400;
    font-size: 16px;
    color: #0F0F0F;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 12px;
    text-align: center;
    overflow: hidden;
    width: 100%;
}

.menu-section-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.menu-section-item:hover::before {
    transform: translateX(0);
}

.menu-section-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

.menu-section-item:hover {
    color: var(--primary-color);
}

.menu-section-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.menu-section-item:active::before {
    transform: translateX(0);
    opacity: 0.5;
    transition: all 0.1s ease;
}

.menu-separator {
    width: 1px;
    height: 378px;
    background-color: #DEDFE0;
    margin: 0 20px;
}

/* Dropdown Submenu */
.header-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.header-menu-item:hover .header-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-submenu-item {
    display: block;
    padding: 8px 16px;
    color: #161C2D;
    text-decoration: none;
     
    font-size: 14px;
    transition: all 0.3s ease;
}

.header-submenu-item:hover {
    background: #F6F6F6;
    color: var(--primary-color);
}

.header-menu-mobile{
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 8px;
    
}
/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Hide mobile menu toggle on larger screens */
@media (min-width: 1200px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    .header-menu-mobile{
        display: none !important;
    }
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background-color: #F2F3F5;
    transition: all 0.3s ease;
    border-radius: 1.5px;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay - covers entire page */
.mobile-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 9999;
}

.mobile-menu.active::before {
    opacity: 1;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    background-color: #FFFFFF;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 120px;
}

.mobile-menu.active .mobile-menu-container {
    transform: translateX(0);
}

.mobile-menu-home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 88px;
    padding: 0 0 0 20px;
    cursor: pointer;
    font-size: 19px;
    line-height: 1.5em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

/* Mobile menu close button */
.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close img {
    width: 24px;
    height: 24px;
}

.mobile-menu-section-icon {
    background-image: url('/wp-content/themes/rootslab/assets/images/arrow-menu-down.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 24px;
    height: 24px;
    margin-right: 20px;
}

.mobile-menu-close:hover {
    background-color: rgba(83, 185, 144, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
    color: #0F0F0F;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover svg {
    color: var(--primary-color);
}

.mobile-menu-header {
    position: relative;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.mobile-menu-section {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.mobile-menu-section:last-child {
    border-bottom: none;
}

.mobile-menu-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-section-header:hover {
    background-color: rgba(83, 185, 144, 0.05);
}

.mobile-menu-section-header:has(.active) {
    background-color: var(--primary-color);
}
.mobile-menu-section:has(.active) .mobile-menu-section-header {
    background-color: var(--primary-color);
}

.mobile-menu-section:has(.active) .mobile-menu-section-header .mobile-menu-section-icon {
    background-image: url('/wp-content/themes/rootslab/assets/images/arrow-menu-up.png');
}

.mobile-menu-section:has(.active) .mobile-menu-section-title {
    color: #FFFFFF;
}
.mobile-menu-section-header:has(.active) .mobile-menu-section-title {
    color: #FFFFFF;
}
.mobile-menu-section:has(.active) svg {
    path {
        stroke: #FFFFFF !important;
    }
}
.mobile-menu-section-content.active > .mobile-menu-item {
    background-color: #F5F5F5;
    border-bottom: 1px solid #DEDFE0;
}
.mobile-menu-section-content.active > .mobile-menu-item:last-child {
    border-bottom: none;
}
.mobile-menu-section-title {
    line-height: 1.5em;
    letter-spacing: 0;
    font-weight: 700;
    font-size: 19px;
    color: #242424;
    padding-left: 20px;
}

.mobile-menu-arrow {
    margin-right: 16px;
    transition: transform 0.3s ease;
}

.mobile-menu-arrow.active {
    transform: rotate(180deg);
}

.mobile-menu-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu-section-content.active {
    max-height: 500px;
}

.mobile-menu-item {
    display: block;
    padding: 12px 0;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5em;
    color: #454545;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-menu-item:hover {
    color: var(--primary-color);
    background-color: rgba(83, 185, 144, 0.05);
    border-left-color: var(--primary-color);
}

.mobile-menu-item.active {
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
    background-color: rgba(83, 185, 144, 0.1);
}
/* Responsive */

@media (min-width: 1700px) {
    .menu-section {
        width: 160px;
    }
    .header-menu-item {
        font-size: 18px;
        font-weight: 600;
        letter-spacing: 0.04em;
    }
    .menu-section-item {
        font-size: 17px;
        font-weight: 400;
        line-height: 140%;
        letter-spacing: 0;
    }
}
@media (max-width: 1200px) {

    .language-switcher-wrapper {
        margin-left: auto !important;
    }
    
    .header-navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide expanded menu on mobile */
    .header-expanded-menu {
        display: none !important;
    }
}

@media (max-width: 1439px) and (min-width: 1024px) {
    .menu-section {
        width: 100px;
        padding: 0;
    }
    .site-header {
        padding: 0px 30px;
    }
    .header-logo {
        width: 160px;
        height: 42px;
    }
    .header-menu-item {
        font-size: 16px;
    }
    a.language-switcher-item .language-code .code {
        font-size: 16px;
        font-weight: 700;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .site-header {
        padding: 0px 30px;
        height: 74px;
    }
    .header-logo {
        width: 160px;
        height: 42px;
    }

    
    .mobile-menu-section-header {
        padding: 10px 0;
    }

    .mobile-menu-section-icon {
        width: 24px;
        height: 24px;
        margin-right: 20px;
    }

    .mobile-menu-section {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}
@media (max-width: 1023px) {
    .site-header:hover .submenu-expanded {
        display: none !important;
    }
    
    .site-header:hover::before {
        display: none !important;
    }
}
@media (max-width: 767px) {
    
    .site-header {
        padding: 16px;
        height: 64px;
    }

    .header-logo {
        width: 100%;
    }
    .header-company-profile {
        gap: 6px;
    }
    
    .header-logo-container {
        width: 122px;
        height: 32px;
    }
    
    .header-company-text {
        font-size: 10px;
    }
    
    .mobile-menu-container {
        width: 240px;
        padding-top: 12px;
    }

    .mobile-menu-home {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 55px;
        padding: 0 0 0 20px;
        cursor: pointer;
        font-size: 19px;
        line-height: 1.5em;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        font-weight: 700;
    }

    .mobile-menu-close {
        width: 20px;
        height: 20px;
    }

    .mobile-menu-close img {
        width: 20px;
        height: 20px;
    }

    
    .mobile-menu-section-header {
        padding: 10px 0;
    }

    .mobile-menu-section-icon {
        width: 20px;
        height: 20px;
        margin-right: 20px;
    }

    .mobile-menu-section-title {
        padding-right: 0;
        padding-left: 20px;
        font-size: 19px;
        line-height: 1.5em;
    }
    
    .mobile-menu-item {
        padding-left: 20px;
        padding-right: 20px;
        font-size: 16px;
        border-left: none;
        font-weight: 400;
        line-height: 1.5em;
    }

    .mobile-menu-container {
        padding-bottom: 80px;
    }
}

/* Prevent body scroll when mobile menu is open - simplified approach */
body.mobile-menu-open {
    overflow: hidden;
    height: 100vh;
}

/* Ensure smooth transitions without scroll jumps */

/* Ensure mobile menu covers entire viewport */
.mobile-menu {
    width: 100vw;
    height: 100vh;
}

.mobile-menu::before {
    /* Ensure overlay covers entire screen including scrolled content */
    min-height: 100vh;
    min-width: 100vw;
}


html {
    scroll-behavior: smooth;
}

html.mobile-menu-active,
html.mobile-menu-active *,
body.mobile-menu-open,
body.mobile-menu-open *,
body.mobile-menu-open html,
body.mobile-menu-open html * {
    scroll-behavior: auto !important;
    transition: none !important;
}

.mobile-menu-active {
    scroll-behavior: auto !important;
}

.mobile-menu-active * {
    scroll-behavior: auto !important;
    transition: none !important;
} 

.language-switcher-wrapper {
    list-style: none;        
    float: right;
    display: flex;          
    position: relative;
    right: 0px;            
    padding: 0;              
    margin: 0;          
    flex-direction: row;  
    width: 120px;
    min-width: 120px;
    margin-top: 8px;
}

a.header-menu-item {
    text-decoration: none;   
}

.language-code {
    font-weight: 400;
    transition: color 0.3s ease;
    cursor: pointer;
    line-height: 26px;
}

a.language-switcher-item.active .language-code .code {
    color: var(--primary-color);
    font-weight: 700;
}

a.language-switcher-item:not(.active) .language-code .code:hover {
    color: inherit;
}

.language-code .pipe {
    display: inline-block;
    width: 1px;
    height: 14px;
    background-color: #DEDFE0;
    margin: 0 8px;
    vertical-align: middle;
}

.menu-section-item.active_submenu {
    color: var(--primary-color, #4CAF50) !important;
    font-weight: 600;
    background-color: rgba(76, 175, 80, 0.1);
    padding-left: 12px;
}


.header-menu-item.active_menu:hover {
    color: var(--primary-color, #4CAF50) !important;
    opacity: 0.8;
}

.menu-section-item.active_submenu:hover {
    background-color: rgba(76, 175, 80, 0.15);
}