/* Stiluri pentru meniul Jet Xpert Group - responsive & animat */

.main-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.1rem 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
  backdrop-filter: blur(4px);
}  

.main-menu .container {
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.logo-img {
  max-height: 100%;
  height: 100px;
  width: auto;
  transition: transform 0.3s ease;
  display: block;
}

.logo:hover .logo-img {
  transform: scale(1.05);
}

.main-menu.scrolled {
  background: rgba(26, 26, 26, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.main-menu .logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: #facc15;
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  transition: transform 0.3s ease;
}

.main-menu .logo:hover {
  transform: scale(1.05);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
  max-width: 100%;
  flex-wrap: wrap;
  box-sizing: border-box;
  z-index: 1100;
}

.nav-links li a {
  color: #facc15;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #facc15;
  transition: width 0.3s ease;
}

.nav-links li a:hover::after {
  width: 100%;
}

.nav-links li a:hover {
  color: #facc15;
}

/* Hamburger icon */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 20px;
  cursor: pointer;
}

.menu-toggle span {
  height: 3px;
  background: #facc15;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle:hover span {
  background: #fbbf24;
}

/* Mobile behavior */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    width: auto;
    min-width: max-content;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    padding: 1rem;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    border-bottom-left-radius: 12px;
    transition: transform 0.4s ease, opacity 0.4s ease, background 0.6s ease;
    max-width: 100%;
    overflow-x: hidden;

    background: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
  }

  .nav-links.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-menu.scrolled .nav-links {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.2);
  }
}

/* Global fix */
html, body {
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.main-menu.transparent {
  background: transparent;
  box-shadow: none;
}

@media (max-width: 768px) {
  .main-menu.transparent {
    background: transparent;
  }
  .main-menu.scrolled {
    background: rgba(26, 26, 26, 0.95);
  }
}

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

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

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

.nav-links li {
  opacity: 0;
  transform: translateY(-10px);
  animation-fill-mode: forwards;
}

.nav-links.open li {
  animation: cascadeIn 0.4s ease-out forwards;
}
.nav-links.open li:nth-child(1) { animation-delay: 0.1s; }
.nav-links.open li:nth-child(2) { animation-delay: 0.2s; }
.nav-links.open li:nth-child(3) { animation-delay: 0.3s; }
.nav-links.open li:nth-child(4) { animation-delay: 0.4s; }
.nav-links.open li:nth-child(5) { animation-delay: 0.5s; }

.nav-links.closing li {
  animation: cascadeOut 0.3s ease-in forwards;
}
.nav-links.closing li:nth-child(1) { animation-delay: 0.5s; }
.nav-links.closing li:nth-child(2) { animation-delay: 0.4s; }
.nav-links.closing li:nth-child(3) { animation-delay: 0.3s; }
.nav-links.closing li:nth-child(4) { animation-delay: 0.2s; }
.nav-links.closing li:nth-child(5) { animation-delay: 0.1s; }

@media (min-width: 769px) {
  .menu-animate {
    opacity: 0;
    transform: translateY(-15px);
    animation: fadeInSlide 0.6s ease-out forwards;
  }

  .menu-animate.delay-1 { animation-delay: 0.5s; }
  .menu-animate.delay-2 { animation-delay: 0.8s; }
  .menu-animate.delay-3 { animation-delay: 1.0s; }
  .menu-animate.delay-4 { animation-delay: 1.3s; }
  .menu-animate.delay-5 { animation-delay: 1.6s; }
}

.menu-toggle span {
  height: 3px;
  background: #facc15;
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
  transform-origin: center;
  opacity: 1;
}
.menu-toggle.open span:nth-child(1) {
  opacity: 0;
  transform: translateY(-5px) scaleX(0.5);
  transition-delay: 0s;
}
.menu-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.5);
  transition-delay: 0.1s;
}
.menu-toggle.open span:nth-child(3) {
  opacity: 0;
  transform: translateY(5px) scaleX(0.5);
  transition-delay: 0.2s;
}

.nav-links.open ~ .menu-toggle span:nth-child(1) {
  opacity: 0;
  transform: translateY(-5px) scaleX(0.5);
  transition-delay: 0s;
}
.nav-links.open ~ .menu-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.5);
  transition-delay: 0.1s;
}
.nav-links.open ~ .menu-toggle span:nth-child(3) {
  opacity: 0;
  transform: translateY(5px) scaleX(0.5);
  transition-delay: 0.2s;
}

@media (min-width: 769px) {
  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    gap: 1.5rem;
  }

  .nav-links li {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
