[id] { 
  scroll-margin-top: 80px; 
}

.lang-link {
  display: inline-block;
  padding: 3px 12px;
  font-weight: 700;
  border-radius: 8px;
  color: #207132;
  background: #eaf6ef;
  border: 1.2px solid #b8dab7;
  text-decoration: none;
  font-size: 1rem;
  margin-right: 2px;
  transition: background .14s, color .14s;
}

.lang-link.active,
.lang-link:focus {
  background: #207132;
  color: #fff;
  border: 1.2px solid #207132;
  outline: none;
}

/* Hide mobile lang switcher on desktop */
.navbar .lang-switcher-bar {
  display: none;
}

/* Desktop top utility bar flex layout with left, center, right */
@media (min-width: 901px) {
  .header-utility {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
  }

  .header-utility .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .ccf-site {
    flex: 1;
    text-align: left;
  }

  /* Center language switcher */
  .header-utility .lang-switcher-bar {
    display: flex !important;
    flex: 1;
    justify-content: center;
    gap: 7px !important;
  }

  /* Right contact button */
  .header-utility-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
}

/* Show mobile lang switcher and hide desktop header utility on mobile */
@media (max-width: 900px) {
  /* Hide desktop top utility bar lang switcher and utility */
  .header-utility {
    display: none !important;
  }

  /* Show mobile lang switcher inside navbar */
  .navbar .lang-switcher-bar {
    display: flex !important;
    gap: 7px !important;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3002;
  }

  .navbar .container.nav-container { 
    justify-content: flex-start; 
    padding: 0 8px; 
    min-height: 54px; 
    position: relative; /* for absolute lang switcher */
  }

  .logo { 
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    font-size: 1rem; 
    z-index: 3000;
  }

  .logo img { 
    height: 32px; 
  }

  .nav-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 7px;
    z-index: 3001;
    order: 1;
  }

  .nav-toggle span {
    display: block;
    width: 27px;
    height: 3.2px;
    background: #207132;
    border-radius: 2px;
    transition: all 0.3s;
  }

  .main-nav-bar {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(34,51,39,0.14);
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s;
  }

  .main-nav-bar.open {
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav-overlay {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3000;
    background: rgba(34,51,39,0.18);
  }

  .main-nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    left: 0;
    top: 0;
    width: 92vw;
    max-width: 340px;
    height: 100vh;
    background: #eaf6ef;
    box-shadow: 2px 0 32px 0 rgba(34,51,39,0.14);
    border-radius: 0 32px 32px 0;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-100%);
    transition: transform .23s cubic-bezier(.64,.09,.57,1.01);
    z-index: 3200;
    padding: 24px 0 40px 0;
    font-size: 1.07rem;
  }

  .main-nav-links.active {
    transform: translateX(0);
  }

  .main-nav-links > li {
    width: 100%;
  }

  .main-nav-links > li > a {
    width: 100%;
    padding: 22px 0 22px 30px;
    font-size: 1.13rem;
    border-bottom: 1px solid #b8dab7;
    border-radius: 0;
    cursor: pointer;
  }

  .dropdown-arrow {
    margin-left: auto;
  }

  /* Accordion dropdowns for mobile */
  .dropdown {
    position: static !important;
    box-shadow: none !important;
    background: #fffbe8 !important;
    border-radius: 0 0 13px 13px;
    margin-top: 0 !important;
    display: none;
    padding-left: 8px;
    white-space: normal;
  }

  .dropdown.open {
    display: flex !important;
  }

  .has-dropdown::after {
    display: none;
  }

  .main-nav-links > li.has-dropdown > a {
    pointer-events: none;
  }

  .main-nav-links > li.has-dropdown > a .dropdown-arrow {
    pointer-events: auto;
  }
}

/* Desktop and shared styles */

.main-nav-links, .dropdown { 
  list-style: none !important; 
  margin: 0; 
  padding: 0; 
}

.main-nav-links > li, .dropdown li { 
  list-style: none !important; 
}

.main-nav-links { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 10px; 
  margin: 0 auto; 
  width: 100%; 
  max-width: 1100px; 
  padding-left: 30px; 
}

.main-nav-links > li { 
  position: relative; 
}

.main-nav-links > li > a {
  color: #207132;
  background: transparent;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 10px 10px 0 0;
  font-size: 1.07rem;
  display: flex;
  align-items: center;
  transition: background 0.13s, color 0.13s;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.main-nav-links > li > a:hover,
.main-nav-links > li > a:focus {
  background: #fffbe8;
  color: #16491e;
  outline: none;
}

.dropdown-arrow {
  margin-left: 4px;
  font-size: 0.88em;
  color: #207132;
  user-select: none;
}

.has-dropdown { 
  position: relative; 
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 185px;
  max-width: 320px;
  margin-top: -2px;
  pointer-events: auto;
  background: #fff;
  box-shadow: 0 7px 18px rgba(32,113,50,0.12);
  border-radius: 0 0 16px 16px;
  z-index: 99;
  flex-direction: column;
  overflow-x: auto;
  right: auto;
  white-space: nowrap;
}

/* Prevent dropdown overflow for last two items */
.main-nav-links > li:last-child .dropdown,
.main-nav-links > li:nth-last-child(2) .dropdown {
  right: 0; 
  left: auto;
}

.dropdown a {
  color: #207132;
  padding: 12px 24px;
  background: #fff;
  font-size: 1.01rem;
  border-radius: 0;
  text-decoration: none;
  transition: background 0.11s, color 0.11s;
  display: block;
}

.dropdown a:hover,
.dropdown a:focus {
  background: #eaf6ef;
  color: #16491e;
  outline: none;
}

.has-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 16px;
  background: transparent;
  pointer-events: auto;
  z-index: 20;
}

.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown {
  display: flex;
  flex-direction: column;
}
