﻿/* Lock body scroll when menu is open */
body.menu-open,
html.menu-open {
    overflow: hidden !important;
    touch-action: none !important;
    height: 100%;
    position: relative;
}

/* Ensure mobile menu can scroll internally */
.mobile-menu {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.navbar-corporate   { background-color: var(--navbar-bg); position: fixed !important; height: var(--navbar-height); top:0 !important; left:0 !important; width:100% !important; border-bottom: 1px solid var(--navbar-border); box-shadow: var(--navbar-shadow);
                      transition: background-color var(--transition-speed) ease; z-index: 1030; }
.navbar-container   { max-width: 1400px; margin: 0 auto; padding: 0 2rem; height: 100%; display: flex; align-items: center; justify-content: space-between; position: relative; }
.navbar-logo        { display: flex; align-items: center; text-decoration: none; z-index: 10; }

/* Desktop Navigation (≥992px) */
.nav-desktop        { flex: 1; margin: 0 2rem; position: relative; height: 100%; display: none; }
@media (min-width: 992px) {
    .nav-desktop    { display: block; }
}

.nav-list       { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; height: 100%; gap: 2rem; justify-content: center; position: relative; }
.nav-item       { height: 100%; display: flex; align-items: center; position: relative; cursor:pointer }
.nav-item > a   { color: var(--navbar-text) !important; text-decoration: none; font-weight: 500; font-size: 1rem; padding: 0 0.25rem; position: relative; transition: color var(--transition-speed) ease; white-space: nowrap; }
.nav-item > a:hover { color: var(--navbar-hover); }

/* Active/Hover Indicator */
.nav-indicator  { position: absolute; bottom: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--navbar-hover), #00c6a7); border-radius: 3px 3px 0 0;
                 transition: left var(--transition-speed) cubic-bezier(0.645, 0.045, 0.355, 1), width var(--transition-speed) cubic-bezier(0.645, 0.045, 0.355, 1); pointer-events: none; will-change: left, width; }

/* Desktop Icons */
.nav-icons-desktop      { display: none; align-items: center; gap: 0.75rem; height: 100%; }
@media (min-width: 992px) {
  .nav-icons-desktop    { display: flex; }
}

.icon-btn { background: none; border: none; color: var(--navbar-text); font-size: 1.25rem; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; 
            transition: all 0.2s ease; position: relative; }

.icon-btn:hover     { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--navbar-hover); transform: translateY(-2px); }
.icon-btn:active    { transform: translateY(0); }

/* Desktop Dropdowns */
.dropdown-hover     { position: relative; }
.dropdown-hover .dropdown-menu          { margin-top: 0.5rem; border: none; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 0.5rem 0; min-width: 200px; opacity: 0; visibility: hidden; transform: translateY(-10px);
                                         transition: all 0.2s ease !important; display: block; background-color: var(--navbar-bg); }
.dropdown-hover:hover .dropdown-menu    { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item      { padding: 0.5rem 1rem; color: var(--navbar-text); transition: all 0.2s; }
.dropdown-item:hover { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--navbar-hover); padding-left: 1.2rem; }
.dropdown-divider   { border-top-color: var(--navbar-border); }

/* Mobile Header (≤991px) */
.nav-mobile-header  { display: flex; align-items: center; gap: 0.5rem; }

@media (min-width: 992px) {
  .nav-mobile-header { display: none; }
}

/* Hamburger Button */
.hamburger-btn { display: flex; flex-direction: column; justify-content: space-around; width: 40px; height: 40px; background: transparent; border: none; cursor: pointer; padding: 10px 8px; z-index: 10; border-radius: 8px;
                 transition: background-color 0.2s; }
.hamburger-btn:hover { background-color: rgba(var(--bs-primary-rgb), 0.1); }
.hamburger-btn span { width: 100%; height: 2px; background: var(--navbar-text); border-radius: 4px; transition: all 0.3s ease; transform-origin: 1px; }
.hamburger-btn[aria-expanded="true"] span:first-child { transform: rotate(45deg) translate(2px, -1px); }
.hamburger-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.hamburger-btn[aria-expanded="true"] span:last-child { transform: rotate(-45deg) translate(2px, 1px); }

/* Mega Menu */
.megamenu-wrapper   { position: absolute; top: var(--navbar-height); left: 0; width: 100%; background-color: var(--navbar-bg) !important; border-top: 1px solid var(--navbar-border); box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 1020;
                      visibility: hidden; opacity: 0; transform: translateY(-10px); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; 
                      transition: 
            opacity 0.3s ease, 
            visibility 0.3s ease, 
            transform 0.3s ease, 
            height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.megamenu-wrapper.active { visibility: visible; opacity: 1; transform: translateY(0); }
.megamenu-panel     { display: none; padding: 2rem 0; max-height: calc(100vh - var(--navbar-height)); overflow-y: auto; transition: opacity 0.3s ease; }
.megamenu-panel.active { display: block; }
.megamenu-panel .container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.megamenu-panel h5  { color: var(--navbar-hover) !important; font-size: 1rem !important; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1rem; font-weight: 600; }
.megamenu-list      { list-style: none; padding: 0; margin: 0; }
.megamenu-list li   { margin-bottom: 0.5rem; }
.megamenu-list a    { color: var(--navbar-text) !important; text-decoration: none !important; font-size: 0.95rem !important; transition: all 0.2s; display: inline-block; padding: 0.25rem 0; }
.megamenu-list a:hover { color: var(--navbar-hover) !important; transform: translateX(5px); }

/* Mobile Menu (≤991px) */
.mobile-menu        { position: fixed; top: 0; right: -100%; width: 85%; max-width: 400px; height: 100vh; background-color: var(--navbar-bg); border-left: 1px solid var(--navbar-border); box-shadow: -5px 0 30px rgba(0,0,0,0.15);
                     z-index: 1050; transition: right 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); display: flex; flex-direction: column; overflow: hidden; }
.mobile-menu.active { right: 0; }
.mobile-menu-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--navbar-border); background-color: var(--navbar-bg); }
.mobile-menu-title  { font-size: 1.25rem; font-weight: 600; color: var(--navbar-text); }
.mobile-menu-close  { background: none; border: none; color: var(--navbar-text); font-size: 1.5rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
                     border-radius: 50%; cursor: pointer; transition: all 0.2s; }
.mobile-menu-close:hover { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--navbar-hover); }
.mobile-menu-body   { flex: 1; overflow-y: auto; padding: 1rem 0; }

/* Mobile Navigation Links */
.mobile-nav-list    { list-style: none; padding: 0; margin: 0; }
.mobile-nav-item    { border-bottom: 1px solid var(--navbar-border); }
.mobile-nav-link:focus-visible { outline: 2px solid var(--navbar-hover); outline-offset: 2px; border-radius: 4px; }
.mobile-nav-link-wrapper { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1.5rem; cursor: pointer; }
.mobile-nav-link    { color: var(--navbar-text); text-decoration: none; font-size: 1rem; font-weight: 500; flex: 1; transition: color 0.2s; cursor: pointer; user-select: none; display: inline-block; padding: 0.5rem 0; }
.mobile-nav-link-wrapper:active { background-color: rgba(var(--bs-primary-rgb), 0.05); }
.mobile-nav-link:hover  { color: var(--navbar-hover); }
.mobile-dropdown-toggle { background: none; border: none; color: var(--navbar-text); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; transition: all 0.2s; }
.mobile-dropdown-toggle:hover { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--navbar-hover); }
.mobile-dropdown-toggle i { transition: transform 0.3s ease; }
.mobile-dropdown-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.mobile-submenu         { list-style: none; padding: 0 1.5rem 0 3rem; margin: 0; display: none; background-color: rgba(0,0,0,0.02); }
[data-bs-theme="dark"] .mobile-submenu { background-color: rgba(255,255,255,0.02); }
.mobile-submenu.active  { display: block; padding-bottom: 0.75rem; }
.mobile-submenu li  { margin-bottom: 0.5rem; }
.mobile-submenu a   { color: var(--navbar-text); text-decoration: none; font-size: 0.95rem; opacity: 0.8; transition: all 0.2s; display: block; padding: 0.4rem 0; }
.mobile-submenu a:hover { color: var(--navbar-hover); opacity: 1; transform: translateX(5px); }

/* Mobile Icons Section */
.mobile-icons-section   { margin-top: 1.5rem; padding: 1.5rem; border-top: 1px solid var(--navbar-border); }
.mobile-icons-title     { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navbar-text); opacity: 0.7; margin-bottom: 1rem; }
.mobile-icons-grid      { display: flex; flex-direction: column; gap: 0.5rem; }
.mobile-icon-btn        { background: none; border: none; color: var(--navbar-text); padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; border-radius: 8px; transition: all 0.2s; width: 100%; font-size: 1rem; }
.mobile-icon-btn:hover  { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--navbar-hover); }
.mobile-icon-btn i:first-child { font-size: 1.25rem; width: 24px; }

/* Mobile Dropdowns */
.mobile-dropdown-container  { position: relative; }
.mobile-dropdown-trigger    { width: 100%; justify-content: flex-start; }
.mobile-dropdown-trigger .ms-auto { margin-left: auto; }
.mobile-dropdown-menu       { list-style: none; padding: 0.5rem 0 0.5rem 2.5rem; margin: 0.25rem 0 0 0; display: none; border-left: 2px solid var(--navbar-hover); }
.mobile-dropdown-menu.active { display: block; }
.mobile-dropdown-menu li    { margin-bottom: 0.5rem; }
.mobile-dropdown-menu a,
.mobile-language-option     { color: var(--navbar-text); text-decoration: none; font-size: 0.95rem; opacity: 0.8; transition: all 0.2s; display: block; padding: 0.4rem 1rem; background: none; border: none; width: 100%;
                              text-align: left; cursor: pointer; }
.mobile-dropdown-menu a:hover,
.mobile-language-option:hover { color: var(--navbar-hover); opacity: 1; background: none; }

/* Search Overlay */
.search-overlay         { position: absolute; top: var(--navbar-height); left: 0; width: 100%; background-color: var(--navbar-bg); border-top: 1px solid var(--navbar-border); box-shadow: 0 10px 20px rgba(0,0,0,0.1); padding: 1rem 0;
                         z-index: 1010; display: none; transform: translateY(-10px); opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; }
.search-overlay.active  { display: block; transform: translateY(0); opacity: 1; }
.search-container       { max-width: 800px; margin: 0 auto; padding: 0 2rem; }
.search-form            { display: flex; align-items: center; gap: 0.5rem; position: relative; }
.search-form input      { flex: 1; height: 50px; padding: 0 1rem; border: 2px solid transparent; border-radius: 8px; background-color: rgba(var(--bs-body-color-rgb), 0.05); color: var(--navbar-text); font-size: 1rem; transition: all 0.3s; }
.search-form input:focus { outline: none; border-color: var(--navbar-hover); background-color: var(--navbar-bg); }
.search-submit,
.search-close       { width: 50px; height: 50px; border: none; background: none; color: var(--navbar-text); font-size: 1.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer;
                               border-radius: 8px; transition: all 0.2s; }
.search-submit:hover,
.search-close:hover { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--navbar-hover); }

/* Mobile adjustments for search */
@media (max-width: 991px) {
    .search-overlay { position: fixed; top: var(--navbar-height); left: 0; width: 100%; height: auto; background-color: var(--navbar-bg); z-index: 1040; }
    .search-form input { height: 45px; font-size: 16px; /* Prevents zoom on iOS */ }
    .search-submit,
    .search-close { width: 45px; height: 45px; }
    /* Close button inside search for mobile */
    .search-close { display: flex; }
}

/* Backdrop for mobile menu */
.mobile-menu-backdrop        { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 1029; display: none; opacity: 0; transition: opacity 0.3s ease; }
.mobile-menu-backdrop.active { display: block; opacity: 1; }

/* Ensure proper stacking */
.navbar-corporate   { z-index: 1030; }
.megamenu-wrapper   { z-index: 1020; }
.search-overlay     { z-index: 1040; }

/* .mobile-menu-backdrop {
 z-index: 1045;
} */
.mobile-menu    { z-index: 1050; }

/* Hamburger Animation Refinements */
.hamburger-btn span { transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.2s ease, background-color 0.2s ease; }
.hamburger-btn[aria-expanded="true"] span:first-child { transform: rotate(45deg) translate(4px, 4px); }
.hamburger-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: translateX(-20px); }
.hamburger-btn[aria-expanded="true"] span:last-child { transform: rotate(-45deg) translate(4px, -4px); }

/* Smooth transitions for all interactive elements */
.navbar-corporate * { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;
                      transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;  transition-duration: 200ms !important; }

/* Remove transition for specific elements where it might cause issues */
.navbar-logo img { transition: none; }

/* Focus styles for accessibility */
.icon-btn:focus-visible,
.hamburger-btn:focus-visible,
.mobile-menu-close:focus-visible,
.search-form input:focus-visible { outline: 2px solid var(--navbar-hover); outline-offset: 2px; }

/* Print styles */
@media print {
    .navbar-corporate { position: static; box-shadow: none; }
    .megamenu-wrapper,
    .search-overlay,
    .mobile-menu,
    .hamburger-btn,
    .nav-icons-desktop .icon-btn:not(.theme-btn) { display: none !important; }
    .nav-desktop { display: block !important; }
}