/* ================================================
   DESKTOP MEGA MENU NAVIGATION
   ================================================ */

/* Base Navigation */
.menu {
  position: relative;
}

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

.menu-main > li {
  position: relative;
}

.menu-main > li > a {
  font-size: 20px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.8);
  text-decoration: none;
  text-transform: capitalize;
  transition: color 0.3s ease;
  font-family: var(--font-primary);
  display: block;
  padding: 12px 0;
  position: relative;
}

.menu-main > li > a:hover {
  color: #3d84f3;
}

/* Mega Menu Container */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width:  max-content;
  max-width: 1200px;
  background: #ffffff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 40px;
  margin-top: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.mega-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: none;
  border-right: none;
  transform: translateX(-50%) rotate(45deg);
}

/* Show mega menu on hover */
.dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Mega Menu Content */
.mega-menu-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.mega-menu-column {
   
  margin-bottom: 24px;
}

.mega-menu-column h3 {
  font-size: 18px;
  font-weight: 600;
  color: #032d60;
  margin: 0 0 5px 0;
  font-family: var(--font-secondary);
  padding-bottom: 5px;  
}

.mega-menu-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu-items li {
  margin-bottom: 12px;
}

.mega-menu-items a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #5f6368;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: var(--font-primary);
}

.mega-menu-column li {
    min-height: 34px;
}
.mega-menu-items a:hover {
  background: #f8f9fa;
  color: #032d60;
  transform: translateX(4px);
}

.mega-menu-items a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3d84f3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mega-menu-items a:hover::before {
  opacity: 1;
}

/* Featured Section */
.mega-menu-featured {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
}

.mega-menu-featured h4 {
  font-size: 16px;
  font-weight: 600;
  color: #032d60;
  margin: 0 0 12px 0;
  font-family: var(--font-secondary);
}

.mega-menu-featured p {
  font-size: 14px;
  color: #5f6368;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.mega-menu-featured .btn {
  display: inline-block;
  background: #3d84f3;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.mega-menu-featured .btn:hover {
  background: #2c6ed5;
  transform: translateY(-1px);
}

/* Ensure mega-menu-featured takes full width in flex columns */
.mega-menu-column .mega-menu-featured {
  width: 100% !important;
  box-sizing: border-box !important;
  flex-grow: 1 !important;
  margin-top: auto !important;
}

/* Navigation Colored Circles - Bottom Right Positioning */
.nav-circle {
      position: absolute;
    bottom: 15px;
    right: -8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-circle-yellow {
  background-color: #FBBC05;
}

.nav-circle-red {
  background-color: #EA4335;
}

.nav-circle-blue {
  background-color: #4285F4;
}

.nav-circle-green {
  background-color: #34A853;
}

/* Ensure parent link has relative positioning */
.dropdown > a {
  position: relative;
}

/* Hover effect */
.dropdown:hover .nav-circle {
  transform: scale(1.2);
}

/* Active state wave effect */
@keyframes wave {
  0% {
    box-shadow: 0 0 0 0 rgba(251, 188, 5, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(251, 188, 5, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(251, 188, 5, 0);
  }
}

@keyframes wave-red {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 67, 53, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(234, 67, 53, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(234, 67, 53, 0);
  }
}

@keyframes wave-blue {
  0% {
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(66, 133, 244, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
  }
}

/* Active dropdown with wave effect */
.dropdown.active .nav-circle-yellow,
.dropdown:hover .nav-circle-yellow {
  animation: wave 2s infinite;
}

.dropdown.active .nav-circle-red,
.dropdown:hover .nav-circle-red {
  animation: wave-red 2s infinite;
}

.dropdown.active .nav-circle-blue,
.dropdown:hover .nav-circle-blue {
  animation: wave-blue 2s infinite;
}

@keyframes wave-green {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(52, 168, 83, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 168, 83, 0);
  }
}

.dropdown.active .nav-circle-green,
.dropdown:hover .nav-circle-green {
  animation: wave-green 2s infinite;
}

/* Animation for smooth appearance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mega-menu-column {
  animation: fadeInUp 0.5s ease-out;
}

.mega-menu-column:nth-child(2) {
  animation-delay: 0.1s;
}

.mega-menu-column:nth-child(3) {
  animation-delay: 0.2s;
}

.mega-menu-column:nth-child(4) {
  animation-delay: 0.3s;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .mega-menu {
    
    padding: 30px;
  }
  
  .mega-menu-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .mega-menu {
    position: static;
    transform: none;
     
    max-width: none;
    box-shadow: none;
    border-radius: 0;
    border: none;
    margin-top: 0;
    padding: 20px;
    background: #f8f9fa;
  }
  
  .mega-menu::before {
    display: none;
  }
  
  .mega-menu-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

/* Mobile - Hide Mega Menu (Use Existing Mobile Navigation) */
@media (max-width: 991px) {
  .mega-menu {
    display: none;
  }
}

/* Overlay for mega menu */
.mega-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

.dropdown:hover ~ .mega-menu-overlay,
.dropdown:hover .mega-menu-overlay {
  opacity: 1;
  visibility: visible;
}

/* Ensure proper stacking */
.header {
  position: relative;
  z-index: 1100;
}

/* Sticky site header — desktop and mobile */
html {
  overflow-x: hidden;
}
body {
  overflow-x: visible;
}

.header-wrapper {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1100;
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.EZDrawer .EZDrawer__container {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.EZDrawer .accordion__button {
  position: relative;
  cursor: pointer;
  padding: 12px 40px 12px 0 !important;
}

.EZDrawer .accordion__button p {
  margin: 0;
}

.EZDrawer [data-accordion-component="AccordionItemPanel"]:not([hidden]) {
  display: block;
  padding: 0 0 12px;
}

/* Focus states for accessibility */
.menu-main > li > a:focus,
.mega-menu-items a:focus { 
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mega-menu {
    border: 2px solid #000;
  }
  
  .mega-menu-items a:hover {
    background: #000;
    color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .mega-menu,
  .mega-menu-items a,
  .dropdown > a::after {
    transition: none;
  }
  
  .mega-menu-column {
    animation: none;
  }
}

/* ================================================
   FINAL MEGA MENU FIX - CORRECT CLASSES & NO LEFT OVERFLOW
   ================================================ */
@media (min-width: 992px) {
  .menu-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  .menu-main > li {
    display: inline-block;
    margin: 0;
    position: relative;
  }
  
  /* Fix for .mega-menu-grid (the actual container in HTML) */
  .mega-menu-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    width: 100%;
    min-width: 780px;
    max-width: 1100px;
  }
  .mega-menu-column a:hover {
    text-decoration: underline !important;
}
  


  .max-mega-menu-two-column{
    
    min-width: 600px !important;
  }
  .mega-menu-column {
    flex: 1 1 0 !important;
    min-width: 230px !important;
    max-width: 300px !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Prevent left overflow with smart positioning */
  .mega-menu {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    
    min-width: 600px !important;
    max-width: min(1100px, 95vw) !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    padding: 32px 24px !important;
    z-index: 1000 !important;
  }
  
  /* If mega menu would overflow left, align to left edge */
  @supports (selector(:has(*))) {
    .dropdown:has(.mega-menu):hover .mega-menu {
      left: max(0px, 50%);
      transform: translateX(max(-50%, -50vw + 50px));
    }
  }
} 
.mega-menu-column small {
          color: #888888;
        display: block;
        font-size: 14px;
        font-weight: 400;
        margin-top: 0px;
        margin-bottom: 6px;
        line-height: 1.3;
        transition: color 0.2s ease;
}
@media (max-width: 1200px) {
  .mega-menu, .mega-menu-grid {
    min-width: 0 !important;
    max-width: 95vw !important;
  }
  .mega-menu-column {
    min-width: 180px !important;
    flex: 1 1 auto !important;
  }
}

/* Products specific grid (4 columns) */
.mega-menu.products-menu .mega-menu-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 30px !important;
    width: 100%;
    min-width: 800px;
    max-width: 1200px;
  }
  
  .mega-menu.products-menu .mega-menu-column {
    flex: 1 1 0 !important;
    min-width: 180px !important;
    max-width: 250px !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
  }

.mega-menu-column a {
    color: #2d2d2d;
}
.language-switcher-dropdown span{
    margin-left: 0 !important;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    background: #e3e3e3;
    height: 22px;
    width: 22px;
    left: auto;
    right: -12px;
    position: absolute;
    top: -4px;
    padding: 0;
    border-radius: 7px;
    border: 2px double #fff;
    z-index: 2;
    pointer-events: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.header-contact-btn .header-contact-icon {
  display: none;
}

@media (max-width: 991px) {
  .header .item-right .header-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
    flex-shrink: 0;
  }

  .header-contact-btn .header-contact-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .header-contact-btn .header-contact-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}