/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #2c3e50;
}

/* Mobile menu container */
#mobile-menu {
  width: 100%;
  box-sizing: border-box;
}

#mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

#mobile-menu li {
  width: 100%;
  text-align: center;
}

#mobile-menu a {
  display: block;
  width: 100%;
  padding: 10px 0;
  text-decoration: none;
  color: #2c3e50;
}


/* Hide on desktop */
@media (min-width: 769px) {
  #mobile-menu {
    display: none;
  }
}

/* Show toggle on mobile */
@media (max-width: 768px) {

  .mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
  }

  #mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #fff;
    z-index: 100;
    padding: 60px 20px 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }

  #mobile-menu.active {
    display: block;
  }

  #mobile-menu:not(.active) {
    display: none;
  }

  /* Make header fixed with higher z-index */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  /* Ensure logo is visible */
  .logo {
    z-index: 1001;
    position: relative;
    display: block;
  }
  
  /* Style the toggle button */
  .mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    background: none;
    border: none;
    font-size: 24px;
    color: #2c3e50;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    text-align: center;
  }
  
  /* Style the navigation menu when active */
  .nav {
    display: none;
    position: fixed;
    top: 70px; /* Header height */
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: #ffffff;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow-y: auto;
  }
  
  .nav.active {
    display: flex;
  }
  
  /* Style the nav items */
  .nav a {
    margin: 10px 0;
    padding: 10px 0;
    font-size: 18px;
    width: 80%;
    text-align: center;
  }

  .nav .btn-header {
    width: auto;
    min-width: 120px;
    max-width: fit-content;
    margin: 15px auto;
    padding: 6px 18px;
  }
  
  /* Adjust body padding to account for fixed header */
  body {
    padding-top: 70px;
  }
  
  /* Make sure other elements don't overlap with the fixed header */
  .hero, section:first-of-type {
    margin-top: 0;
  }
}

/* For medium-sized screens - ensure proper button sizing */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav .btn-header {
    width: auto;
    padding: 6px 15px;
  }
}

/* Support for larger mobile devices like tablets in portrait mode */
@media (min-width: 600px) and (max-width: 768px) {
  .nav.active {
    display: flex;
  }
  
  .nav a {
    width: auto;
    min-width: 120px;
    margin: 10px auto;
  }
}