.header {
  background-color: #561616;
  padding: 10px 30px;
  z-index: 1000;
  justify-content: space-between;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
}

#headerLink {
  text-decoration: none;
}

#headerName {
  margin: 0;
  color: white;
  font-family: "Playfair Display", serif;
  font-weight: 550; 
  font-size: 20px;
  padding-left: 10px;
}

.menu {
  text-align: center;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  font-family: "Noto Sans Sunuwar", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 14px;
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.menu li {
  position: relative;
}

.menu a {
  display: block;
  padding: 10px 15px;
  color: white;
  font-weight: 547;
  text-decoration: none;
}

.menu a:hover,
.menu .active,
.dropdown-link-desktop:hover,
.dropdown-link-desktop:focus-visible {
  background-color: #333333dc;
  color: white;
  border-radius: 4px;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: rgb(36, 35, 35);
  top: 100%;
  left: 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  min-width: 180px;
  visibility: hidden;
  z-index: 9999;
}

.dropdown:hover .dropdown-content {
  visibility: visible;
  display: block;
  border-radius: 5px;
}

.dropdown-content li a {
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
}

.login {
  padding: 8px 16px;
  background-color: #1D2433;
  color: white;
  border: none;
  border-radius: 4px;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
}

.user-chip {
  margin-right: 10px;
  color: #fff;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
}

.account-menu {
  position: relative;
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0d276;
  color: #561616;
  font-weight: 800;
}

.account-caret {
  font-size: 1.1rem;
  line-height: 1;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100500;
  display: grid;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  background: #242323;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.account-menu:hover .account-dropdown,
.account-menu:focus-within .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-dropdown a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.account-dropdown a:hover,
.account-dropdown a:focus-visible {
  background: rgba(255,255,255,0.12);
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


#menu-toggle, 
.submenu-toggle-cb,
.hamburger-label, 
.dropdown-label-mobile,
.mobile-auth,
.mobile-spacer {
  display: none !important; 
}
.dropdown-link-desktop {
  display: block;
}

.dropdown-link-desktop {
  display: block;
  padding: 10px 15px;
  background: none;
  border: 0;
  font: inherit;
  color: white;
  font-weight: 547;
  text-decoration: none;
  cursor: pointer;
  width: auto;
  line-height: inherit;
  appearance: none;
  -webkit-appearance: none;
}



@media screen and (max-width: 768px) {
  
  .header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    z-index: 100200;
  }

  .left {
    order: 2; 
    flex-grow: 0;
  }

  #headerName {
    padding-left: 0;
    font-size: 18px;
  }

 
  .hamburger-label {
    order: 1; /* Hamburger to left slot */
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    cursor: pointer;
    z-index: 100300; 
  }

  .mobile-spacer {
    order: 3; 
    display: block !important;
    width: 22px;
    height: 16px;
  }

  .desktop-auth {
    display: none !important;
  }

  .account-menu {
    display: none;
  }

  .hamburger-label span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 1px;
    transition: all 0.25s ease-in-out;
  }

  .menu {
    position: fixed;
    top: 0;
    left: -280px; /* Completely hidden off-screen left */
    width: 280px;
    height: 100dvh;
    background-color: rgb(36, 35, 35);
    padding: 72px 0 0 0;
    transition: left 0.3s ease-in-out;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
    z-index: 100250;
    display: flex !important; /* Enforces block layout alignment over desktop rule */
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    text-align: left;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header #menu-toggle:checked ~ .menu {
    left: 0;
  }

 
  .menu ul.nav-links {
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .menu li {
    width: 100%;
  }

  .menu a, .dropdown-label-mobile, .dropdown-link-desktop {
    padding: 14px 24px;
    display: block;
    color: white;
    font-size: 15px;
    text-align: left;
    box-sizing: border-box;
  }

  .dropdown-link-desktop {
    display: none !important;
  }

  .dropdown-label-mobile {
    display: block !important;
    cursor: pointer;
    width: 100%;
  }

  
  .dropdown-content {
    display: none;
    visibility: visible !important; 
    position: relative;
    top: 0;
    left: 0;
    box-shadow: none;
    background-color: #1a1a1a;
    width: 100%;
    border-radius: 0 !important;
  }

.dropdown-content {
    display: none !important; 
    visibility: visible !important; 
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    box-shadow: none !important;
    background-color: #1a1a1a !important;
    width: 100% !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    
    flex-direction: column !important; 
    justify-content: flex-start !important;
    gap: 0 !important;
  }

  .dropdown-content li {
    display: block !important;
    width: 100% !important;
    float: none !important;
  }

  .dropdown-content li a {
    display: block !important;
    padding: 12px 40px !important; 
    white-space: normal !important; 
    width: 100% !important;
    box-sizing: border-box !important;
  }

 
  .submenu-toggle-cb:checked ~ .dropdown-content {
    display: flex !important; 
  }

  .submenu-toggle-cb:checked ~ .dropdown-content {
    display: block !important;
  }

 
  .dropdown:hover .dropdown-content {
    display: none;
  }

  
  .mobile-auth {
    position: sticky;
    bottom: 0;
    z-index: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    background-color: rgb(36, 35, 35);
    margin-top: auto; 
  }

  .mobile-auth .user-chip {
    margin-right: 0;
    margin-bottom: 5px;
  }

  .mobile-auth .login {
    width: 90%;
    text-align: center;
    padding: 10px;
  }


  .header #menu-toggle:checked + .hamburger-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .header #menu-toggle:checked + .hamburger-label span:nth-child(2) {
    opacity: 0;
  }

  .header #menu-toggle:checked + .hamburger-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 100240;
  }

  .header #menu-toggle:checked ~ .menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
.dropdown-caret {
    display: inline-flex;
    align-items: center;

    margin-left: 6px;

  
    position: relative;
    top: 1px;

    width: 11px;
    height: 11px;
}
.dropdown-caret svg {
    width: 11px;
    height: 11px;
    display: block;
}
  .submenu-toggle-cb:checked ~ .dropdown-label-mobile .dropdown-caret {
    transform: rotate(180deg);
}
}