/* ---------------- NAVBAR ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.nav-btn{
    background-color: var(--green-700);
    color: white !important;
}

.nav .container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 20px;
}

.logo {
  font-weight: 700;
  font-size: 22px;
  color: var(--green-700);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
  position: relative;
  
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 12px;
  color: black ;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}

.nav-links a:hover {
  background: var(--green-300);
  color: white;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-toggle .hamburger {
  width: 100%;
  height: 3px;
  background: var(--green-700);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ---------------- DROPDOWN / MEGA MENU ---------------- */
.mega-dropdown {
  position: relative;
}

/* Mega Menu Base */
.mega-menu {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px); /* slide down start */
  width: 900px;
  max-width: calc(100vw - 40px); /*prevent horizontal scroll*/
  background: #fff;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* responsive 3 columns */
  gap: 30px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
  z-index: 9999;
}

/* Hover/open state desktop */
@media (min-width: 901px) {
  .mega-dropdown:hover .mega-menu,
  .mega-dropdown.open .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
}

/* Columns inside mega menu */
.mega-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mega-col h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mega-col a {
  padding: 10px 14px;
  background: #fafafa;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  color: #444;
  transition: 0.2s;
}

.mega-col a:hover {
  background: var(--green-300);
  color: #fff;
}

/* Responsive tweaks */

/* Tablets / smaller desktops */
@media (max-width: 1200px) and (min-width: 901px) {
  .mega-menu {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Mobile */
/* ---------------- MOBILE ---------------- */
@media (max-width: 900px) {
  /* Mega menu hidden by default inside nav-links */
.mega-menu {
    border: 1px solid gray;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    /* max-width: 100%; */
    display: flex;               /* use flex for horizontal scroll */
    flex-wrap: nowrap;           /* prevent wrapping to next row */
    gap: 16px;                   /* spacing between columns */
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
    overflow-x: auto;            /* horizontal scroll */
    overflow-y: hidden;          /* hide vertical scroll */
    scroll-behavior: smooth;     /* smooth scroll */
    -webkit-overflow-scrolling: touch; /* smooth on iOS */
    transition: opacity 0.3s ease, max-height 0.3s ease, visibility 0.3s ease;
}

/* Show mega menu when open */
.mega-dropdown.open .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 400px;  /* enough to show content */
}

/* Each column inside mega menu */
.mega-col {
    min-width: 220px; /* width of each card */
    flex: 0 0 auto;   /* prevent shrinking */
    display: flex;
    flex-direction: column;
    gap: 10px;
}



  
  /* Only show mega menu when dropdown is open */
  .mega-dropdown.open .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 1000px; /* large enough to fit content */
  }

  /* Nav links container */
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255,255,255,0.98);
    padding: 20px;
    gap: 14px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
    overflow: visible; /* allow mega menu to expand */
  }

  .nav-links.open {
    transform: scaleY(1);
  }

  /* Hamburger toggle */
  .nav-toggle {
    display: flex;
  }
}

