.site-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1000;
  transition: all 0.3s ease;
  animation: fadeIn 0.6s ease-out forwards;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.header-container {
  max-width: 1550px;
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
}

/* ─── Logo ───────────────────────────────────────────────────────────────── */
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  flex-shrink: 0;
}

.site-logo img {
  max-height: 40px;
  width: auto;
  display: block;
}

/* ─── Primary Nav & Enhanced Dropdown ───────────────────────────────────────────── */
.main-nav {
  margin-left: 50px;
  margin-right: auto;
  display: flex;
  justify-content: center;
}

.main-nav > ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.main-nav li {
  position: relative;
}

.main-nav > ul > li > a {
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 600; 
  font-size: 15px;
  padding: 0.8rem 1rem;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.01em;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Dropdown indicator arrow */
.main-nav .has-dropdown > a::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.3s ease;
  opacity: 0.7;
}

.main-nav .has-dropdown:hover > a::after {
  transform: rotate(180deg);
}

.main-nav > ul > li > a:hover {
  color: #000;
  background: #FAFAFA;
}

.main-nav .dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  min-width: 280px;
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.main-nav > ul > li:hover .dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0);
}

.main-nav .dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: none;
  border-right: none;
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}

.main-nav .dropdown li {
  list-style: none;
  margin: 0;
}

.main-nav .dropdown li a {
  text-decoration: none;
  color: #2a2a2a;
  font-size: 14px;
  font-weight: 500; 
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
  border-left: 3px solid transparent;
  margin: 0 0.5rem;
  border-radius: 8px;
}

.main-nav .dropdown li a .icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(51, 74, 139, 0.3);
  border-radius: 6px;
  color: #334A8B;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.main-nav .dropdown li:nth-child(1) a .icon {
  background: rgba(51, 74, 139, 0.3);
  color: #334A8B;
}

.main-nav .dropdown li:nth-child(2) a .icon {
  background: rgba(94, 75, 139, 0.3);
  color: #5E4B8B;
}

.main-nav .dropdown li:nth-child(3) a .icon {
  background: rgba(127, 168, 232, 0.3);
  color: #7FA8E8;
}

.main-nav .dropdown li:nth-child(4) a .icon {
  background: rgba(166, 136, 232, 0.3);
  color: #A688E8;
}


.main-nav .dropdown li a:hover {
  background: #FAFAFA;
  color: #000;
  border-left: 3px solid #334A8B;
}

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.header-utils {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-shrink: 0;
}

.login-link {
  text-decoration: none;
  color: black;
  font-weight: 600; 
  font-size: 15px;
  transition: all 0.2s;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
}

.login-link:hover {
  color: #000; 
  background: #FAFAFA;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  color: black;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.01em;
}

.site-header.scrolled .btn-primary {
  background: var(--secondary-color);
  color: white;
}

.site-header.scrolled .btn-primary:hover {
  transform: translateY(-2px);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50px; 
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.icon-pencil {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  transition: all 0.3s;
}

.btn-primary:hover .icon-pencil {
  transform: translateX(3px);
}

.lang-switcher {
  position: relative;
}

.lang-switcher select {
  appearance: none;
  border: none;
  background: #f5f7fa;
  padding: 0.55rem 2.5rem 0.55rem 1rem;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600; 
  color: #404040;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lang-switcher::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='2' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  pointer-events: none;
}

.lang-switcher select:hover {
  background: #eef1f6;
}

.lang-switcher select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 113, 255, 0.2);
}

.site-header.scrolled {
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Mobile Menu Button ──────────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: relative;
  flex-direction: column;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
  margin-left: auto;
}

.mobile-menu-btn:hover {
  background: #FAFAFA;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: #000;
  margin: 2px 0;
  transition: all 0.3s ease;
  transform-origin: center;
  border-radius: 1px;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 1998;
  backdrop-filter: blur(4px);
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Navigation Panel */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: white;
  z-index: 1999;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eef1f6;
}

.mobile-nav-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-nav-close:hover {
  background: #FAFAFA;
}

.mobile-nav-close svg {
  width: 24px;
  height: 24px;
}

/* Mobile Nav Menu */
.mobile-nav-menu {
  padding: 1rem 0;
}

.mobile-nav-menu > li {
  list-style: none;
}

.mobile-nav-menu > li > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: #000;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.2s;
}

.mobile-nav-menu > li > a:hover {
  background: #FAFAFA;
  border-left: 3px solid #334A8B;
  color: #000;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  width: 100%;
}

.mobile-nav-link {
  flex: 1;
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: #000;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.2s;
}

.mobile-nav-link:hover {
  background: #FAFAFA;
  color: #000;
}

.dropdown-toggle {
  background: none;
  border: none;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  border-radius: 8px;
  margin-right: 0.5rem;
}

.dropdown-toggle:hover {
  background: #FAFAFA;
}

.dropdown-toggle svg {
  transition: transform 0.3s ease;
}

.has-dropdown.active .dropdown-toggle svg {
  transform: rotate(180deg);
}

.mobile-nav-menu .has-dropdown > a::after {
  content: '';
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s;
}

.mobile-nav-menu .has-dropdown.active > a::after {
  transform: rotate(180deg);
}

.mobile-nav-menu .has-dropdown .mobile-nav-item .mobile-nav-link::after {
  display: none;
}

/* Mobile Submenu */
.mobile-submenu {
  display: none;
  background: #f7f9fd;
  padding: 0.5rem 0;
}

.mobile-submenu.active {
  display: block;
}

.mobile-submenu li {
  list-style: none;
}

.mobile-submenu li a {
  display: block;
  padding: 0.75rem 1.5rem 0.75rem 3rem;
  text-decoration: none;
  color: #404040;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
}

.mobile-submenu li a:hover {
  background: #FAFAFA;
  color: #000;
}

/* Mobile submenu icons */
.mobile-submenu li a::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #334A8B;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Mobile Nav Footer */
.mobile-nav-footer {
  padding: 1.5rem;
  border-top: 1px solid #eef1f6;
  margin-top: auto;
}

.mobile-nav-footer .login-link {
  display: block;
  text-align: center;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: #f5f7fa;
  border-radius: 8px;
}

.mobile-nav-footer .login-link:hover {
  background: #FAFAFA;
  border-color: #334A8B;
}

.mobile-nav-footer .btn-primary {
  display: block;
  text-align: center;
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--secondary-color);
  color: white;
}

.mobile-nav-footer .lang-switcher select {
  width: 100%;
}

/* ─── Responsive Adjustments ───────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .header-container {
    padding: 1rem;
    position: relative;
  }

  .mobile-menu-btn {
    display: flex;
    order: 3;
  }

  .main-nav,
  .header-utils {
    display: none;
  }

  .site-logo {
    order: 1;
  }

  .site-logo img {
    height: 36px;
    width: auto;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0.75rem 1rem;
  }

  .site-logo img {
    height: 28px;
  }

  .mobile-menu-btn {
    width: 36px;
    height: 36px;
  }
}

@media (min-width: 1025px) {
  .header-container {
    padding: 1.2rem 2rem;
  }

  .main-nav > ul {
    gap: 0.5rem;
  }

  .header-utils {
    gap: 1.75rem;
  }
}