/* ========== i18n Language Switcher ========== */

/* Prevent flash of English text when non-English language is selected */
[data-i18n] {
  transition: opacity 0.15s ease;
}
body:not(.i18n-ready) [data-i18n] {
  opacity: 0;
}
body.i18n-ready [data-i18n] {
  opacity: 1;
}

/* Switcher container */
.i18n-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
  z-index: 10000;
}

.i18n-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 5px 14px;
  color: inherit;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.i18n-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
}
.i18n-btn .fa-globe {
  font-size: 14px;
}
.i18n-arrow {
  font-size: 10px !important;
  transition: transform 0.2s ease;
}

/* Dropdown panel */
.i18n-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 10001;
}
.i18n-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.i18n-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  transition: background 0.15s ease;
}
.i18n-option:hover {
  background: #f0f7e6;
}
.i18n-option.active {
  background: #85bf18;
  color: #fff;
  font-weight: 600;
}

/* Scrolled header — dark text state */
.header-section-1.scrolled .i18n-btn {
  border-color: rgba(0, 0, 0, 0.2);
  color: #333;
}
.header-section-1.scrolled .i18n-btn:hover {
  border-color: #85bf18;
  background: rgba(133, 191, 24, 0.08);
}

/* Mobile off-canvas placement */
.i18n-mobile {
  margin: 20px 0 0 0;
  display: flex;
  justify-content: center;
}
.i18n-mobile .i18n-btn {
  border-color: rgba(0, 0, 0, 0.2);
  color: #333;
  font-size: 14px;
  padding: 8px 18px;
}
.i18n-mobile .i18n-dropdown {
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(-8px);
}
.i18n-mobile .i18n-dropdown.open {
  transform: translateX(-50%) translateY(0);
}

/* Ensure translated text wraps properly */
[data-i18n] {
  word-wrap: break-word;
  overflow-wrap: break-word;
}
