/* Enhanced Liquid Glass Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  /* IMPORTANT */
  background: rgba(255, 252, 248, 0.4);
  backdrop-filter: blur(15px) saturate(160%);
  -webkit-backdrop-filter: blur(15px) saturate(160%);
  padding: 1.2rem 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
  border-radius: 0;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.4) 0%,
      rgba(255, 255, 255, 0.1) 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
  border-radius: inherit;
}

header.scrolled {
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  padding: 0.8rem 0;
  background: rgba(255, 252, 248, 0.6);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 25px;
}

/* Navigation Container */
nav {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  box-sizing: border-box;
  /* IMPORTANT */
}

/* Logo */
.logo {
  font-size: 2.2rem;
  color: var(--deep-teal);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 2px;
  transition: all 0.3s;
  z-index: 1002;
  /* Higher than mobile menu */
}

.logo:hover {
  color: var(--coral-peach);
  transform: scale(1.05);
}

/* Desktop Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 1002;
  /* Higher than mobile menu */
}

.nav-links a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: all 0.3s;
  font-size: 1rem;
  letter-spacing: 0.5px;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--coral-peach), var(--soft-teal));
  transition: width 0.3s ease;
}

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

.nav-links a:hover {
  color: var(--deep-teal);
}

/* Hamburger Menu Button (Hidden by default on desktop) */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
  /* Higher than mobile menu */
  position: relative;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: var(--deep-teal);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Mobile Menu Styles */
@media (max-width: 1024px) {

  /* Adjust padding for tablet */
  nav {
    padding: 0 1.5rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {

  /* Show hamburger menu */
  .hamburger-menu {
    display: flex;
  }

  /* Hide desktop nav links */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgba(255, 249, 244, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1001;
    padding: 2rem;
    box-shadow: -10px 0 30px rgba(125, 189, 182, 0.2);
    border-left: 1px solid rgba(125, 189, 182, 0.3);
  }

  /* When menu is active */
  .nav-links.active {
    right: 0;
  }

  /* Mobile nav link styles */
  .nav-links a {
    margin: 0;
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
    width: 100%;
    text-align: center;
    border-radius: 10px;
    transition: all 0.3s ease;
  }

  .nav-links a:hover {
    background: rgba(240, 166, 147, 0.1);
    transform: translateX(-5px);
  }

  .nav-links a::after {
    display: none;
    /* Hide underline on mobile */
  }

  /* Adjust header when scrolled on mobile */
  header.scrolled {
    width: 95%;
    padding: 0.6rem 0;
    top: 0.3rem;
  }

  /* Logo size on mobile */
  .logo {
    font-size: 1.8rem;
  }

  /* Hamburger animation when active */
  .hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

/* iPhone SE and very small devices */
@media (max-width: 375px) {
  nav {
    padding: 0 1rem;
  }

  .logo {
    font-size: 1.6rem;
    letter-spacing: 1px;
  }

  .hamburger-menu {
    width: 26px;
    height: 18px;
  }

  .hamburger-line {
    height: 2.5px;
  }

  .nav-links {
    width: 85%;
    max-width: 280px;
  }

  .nav-links a {
    font-size: 1.1rem;
    padding: 0.7rem 1.2rem;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Overlay for mobile menu */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(74, 60, 49, 0.4);
  backdrop-filter: blur(2px);
  z-index: 899;
}

.menu-overlay.active {
  display: block;
}