.navbar {
  background: var(--box-bg);
  padding: 22px 0;
  width: 100%;
  border-bottom: 2px solid #d1d1d1;
  position: relative;
  z-index: 2000;
}

#navbar {
  min-height: 104px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  height: 60px;
}

.header-wrapper {
  display: flex;
  align-items: center;
  gap: 18px;
}

.home-button,
.map-button,
.maintenance-button {
  font-size: 1.05rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--dark);
  text-decoration: none;
  cursor: pointer;
}

.home-button:hover,
.map-button:hover,
.maintenance-button:hover,
.profile-button:hover {
  color: var(--buttons);
}

.profile-wrapper,
.language-wrapper {
  position: relative;
}

.profile-button,
.language-button {
  margin-top: 3px;
  background: none;
  border: none;
  padding: 0;
  color: var(--dark);
  cursor: pointer;
}

.profile-button i {
  font-size: 1.3rem;
}

.profile-button:hover .profile-circle {
  border-color: var(--buttons);
}

.profile-dropdown,
.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--box-bg);
  border: 1px solid #d1d1d1;
  border-radius: 6px;
  min-width: 140px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 3000;
}

.language-dropdown {
  margin-top: 10px;
  padding-bottom: 2px;
}

.profile-dropdown {
  margin-top: 12px;
  padding-bottom: 4px;
}

.profile-dropdown a,
.profile-dropdown button,
.language-dropdown button {
  display: block;
  padding: 10px 14px;
  font-size: 0.95rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--dark);
  font-family: inherit;
  text-decoration: none;
}

.language-dropdown button,
.mobile-language-dropdown button {
  display: flex;
  align-items: center;
}

.profile-dropdown button {
  width: 100%;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover,
.language-dropdown button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.lang-flag {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.flag-us {
  background-image: url("/images/flags/us.svg");
}

.flag-es {
  background-image: url("/images/flags/es.svg");
}

.profile-slot {
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-circle {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid var(--dark);
  border-radius: 50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.mobile-language-toggle {
  padding: 12px 20px;
  font-size: 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--dark);
  font-family: inherit;
}

.mobile-language-dropdown {
  display: flex;
  flex-direction: column;
}

.mobile-language-dropdown button {
  font: inherit;
  padding: 12px 20px;
  font-size: 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--dark);
  width: 100%;         
  box-sizing: border-box;
}

.mobile-language-dropdown button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mobile-profile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--box-bg);
  border-top: 1px solid #d1d1d1;
  padding: 8px 0 12px;
  display: flex;
  flex-direction: column;
  z-index: 2500;
}

.mobile-profile-menu a,
.mobile-profile-menu button {
  padding: 12px 20px;
  font-size: 1rem;
  color: var(--dark);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.hamburger-button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
}

.hamburger-button i {
  font-size: 1.55rem;
}

.mobile-actions {
  display: none;
  align-items: center;
  gap: 14px;
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--box-bg);
  border-top: 1px solid #d1d1d1;
  padding: 8px 0 12px;
  display: flex;
  flex-direction: column;
  z-index: 2500;
}

.mobile-menu a {
  padding: 12px 20px;
  font-size: 1rem;
  color: var(--dark);
  text-decoration: none;
}

.touch-active {
  color: var(--buttons) !important;
}

.touch-active .profile-circle {
  border-color: var(--buttons) !important;
}

.touch-bg {
  background: rgba(0, 0, 0, 0.08) !important;
}

@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }

  button,
  a {
    outline: none;
    -webkit-focus-ring-color: transparent;
  }

  .mobile-language-toggle .lang-flag {
    display: none;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-actions {
    display: flex;
  }

  .profile-circle {
    width: 1.55rem;
    height: 1.55rem;
    transform: translateY(-1.75px);
  }

  .profile-button {
    transform: translateY(-0.5px);
  }

  .nav-logo {
    height: 52px;
  }

  .mobile-profile .profile-button i {
    font-size: 1.55rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .profile-button:hover {
    color: var(--dark);
  }

  .profile-button:hover .profile-circle {
    border-color: var(--dark);
  }
}

@media (min-width: 769px) and (max-width: 1300px) {
  .profile-circle {
    border: 1.5px solid var(--dark);
    font-weight: 400;
  }

  .nav-container {
    padding-left: 55px;
    padding-right: 55px;
  }
}

@media (min-width: 769px) {
  .language-button {
    display: flex;
    align-items: center;
  }

  .language-button .lang-flag {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 0 1px #292929;
  }
}

