/* === HEADER STYLES === */

/* Remove Pico's default vertical padding from header */
body > header {
  padding-block: 0 !important;
}

/* Header main container */
#masthead {
  background: #fff;
  padding: 0.75rem 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #ececec; /* subtle divider */
}

/* Header inner container */
#masthead .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2.5rem;
  min-height: 80px;
}

/* Site branding/logo */
.site-branding {
  display: flex;
  align-items: center;
}

.site-branding img {
  max-height: 65px;
  height: auto;
  width: auto;
}

.site-branding a {
  display: inline-block;
  line-height: 1;
}

/* Desktop Navigation Container */
#site-navigation {
  display: flex;
  align-items: center;
}

.mobile-nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
}

#site-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem !important;
  align-items: center;
}

#site-navigation ul li {
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
  display: flex;
  align-items: center;
}

#site-navigation ul li a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 1rem !important;
  padding: 0.5rem 1.1rem !important;
  border-radius: 6px;
  transition: all 0.2s ease;
  border-bottom: none !important;
  display: block;
  line-height: 1.2;
}

#site-navigation ul li a:hover {
  color: #00a04a;
  background-color: rgba(0, 160, 74, 0.08);
  transform: translateY(-1px);
}

/* Desktop Account/Login Section */
.mobile-account {
  display: flex !important;
  list-style: none;
  margin: 0 0 0 1rem !important;
  padding: 0 !important;
  align-items: center;
}

.mobile-account li {
  margin: 0 !important;
  padding: 0 !important;
}

.mobile-account li a {
  background: #00a04a !important;
  color: #fff !important;
  border-radius: 20px;
  padding: 0.5rem 1.3rem !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,160,74,0.07);
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
  line-height: 1.2;
}

.mobile-account li a:hover {
  background: #008a3f !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 160, 74, 0.13);
}

/* Skip link accessibility */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #000;
  color: #fff;
  z-index: 1100;
  border-radius: 4px;
}

/* Mobile menu toggle */
#mobile-menu-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
  color: #333;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

#mobile-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* === MOBILE STYLES === */
@media (max-width: 768px) {
  #masthead .header-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #mobile-menu-toggle {
    display: block;
  }

  .mobile-nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  #site-navigation {
    position: fixed;
    top: 0;
    right: 0; /* keep sidebar aligned to the right edge */
    transform: translateX(100%); /* initially move it fully off-screen */
    width: 300px !important; /* fixed width to prevent viewport overflow */
    max-width: 85vw !important; /* but respect smaller screens */
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 2.5rem 1rem 2rem 1rem !important;
    gap: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    overflow-y: auto;
    border-left: 3px solid #00a04a;
  }

  #site-navigation.active {
    transform: translateX(0); /* slide into view */
  }

  #site-navigation ul {
    flex-direction: column;
    gap: 0 !important;
    width: 100%;
    margin-bottom: 1rem;
  }

  #site-navigation ul li {
    width: 100%;
    border-bottom: 1px solid #f5f5f5;
  }

  #site-navigation ul li:last-child {
    border-bottom: none;
  }

  #site-navigation ul li a {
    display: block;
    width: 100%;
    padding: 1rem 0 !important;
    border-bottom: none;
    font-size: 1.1rem !important;
    font-weight: 600;
    border-radius: 0;
    background: transparent !important;
    color: #333 !important;
    transition: all 0.2s ease;
  }

  #site-navigation ul li a:hover {
    color: #00a04a !important;
    background: rgba(0, 160, 74, 0.05) !important;
    padding-left: 0.5rem !important;
  }

  .mobile-account {
    display: block !important;
    width: 100%;
    margin-top: 1.5rem !important;
    padding-top: 1.5rem !important;
    border-top: 2px solid #f0f0f0;
  }

  .mobile-account li {
    border-bottom: none !important;
  }

  .mobile-account li a {
    font-weight: 700 !important;
    color: #00a04a !important;
    background: rgba(0, 160, 74, 0.08) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    box-shadow: none !important;
    border: 1px solid rgba(0, 160, 74, 0.2) !important;
    text-align: center;
    margin-top: 0.5rem;
  }

  .mobile-account li a:hover {
    background: #00a04a !important;
    color: #fff !important;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 160, 74, 0.2) !important;
    padding-left: 1rem !important;
  }

  /* Menu overlay */
  #menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    backdrop-filter: blur(2px);
  }

  #menu-overlay.show {
    display: block;
  }

  /* Header row inside the mobile menu */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 1rem;
  }

  #mobile-menu-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: #333;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
  }

  #mobile-menu-close:hover {
    color: #00a04a;
  }
}

/* Hide mobile elements on desktop */
@media (min-width: 769px) {
  #mobile-menu-toggle {
    display: none;
  }
  
  #masthead .header-inner {
    padding-left: 2rem;
    padding-right: 2.5rem;
    min-height: 80px;
  }
  
  #site-navigation ul {
    gap: 1.5rem !important;
  }
  
  .mobile-account {
    display: flex !important;
    margin: 0 0 0 1rem !important;
  }
}

/* Desktop manager dashboard button */
.desktop-manager-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #d62329;
  color: #fff;
  border: 1.5px solid #d62329;
  border-radius: 8px;
  padding: 0.45rem 1.2rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.desktop-manager-btn:hover {
  background: #b71c20;
  color: #fff;
  border-color: #b71c20;
  text-decoration: none;
}
