/* Language switcher — En / Fa labels + sliding thumb */

.pp-lang-switch {
  --pp-lang-blue: #1866ff;
  --pp-lang-white: #ffffff;
  --pp-lang-h: 36px;
  --pp-lang-w: 88px;
  --pp-lang-pad: 3px;
  --pp-lang-dur: 0.25s;

  position: relative;
  z-index: 9999;
  display: inline-block;
  vertical-align: middle;
  direction: ltr;
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

.pp-lang-switch__pill {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: var(--pp-lang-w);
  height: var(--pp-lang-h);
  border: 1.5px solid var(--pp-lang-blue);
  border-radius: 999px;
  background: var(--pp-lang-white);
  overflow: hidden;
}

.pp-lang-switch__thumb {
  position: absolute;
  z-index: 1;
  top: var(--pp-lang-pad);
  left: var(--pp-lang-pad);
  width: calc(50% - var(--pp-lang-pad) * 1.5);
  height: calc(100% - var(--pp-lang-pad) * 2);
  border-radius: 999px;
  background: var(--pp-lang-blue);
  transition: transform var(--pp-lang-dur) cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.pp-lang-switch[data-lang="en"] .pp-lang-switch__thumb {
  transform: translateX(0);
}

.pp-lang-switch[data-lang="fa"] .pp-lang-switch__thumb {
  transform: translateX(calc(100% + var(--pp-lang-pad)));
}

.pp-lang-switch__track {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
  min-height: var(--pp-lang-h);
}

.pp-lang-switch button.pp-lang-switch__option,
.pp-lang-switch button.pp-lang-switch__option:hover,
.pp-lang-switch button.pp-lang-switch__option:focus,
.pp-lang-switch button.pp-lang-switch__option:active,
.pp-lang-switch button.pp-lang-switch__option:visited,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option:hover,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option:focus,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option:active,
.elementor-widget-html .pp-lang-switch button.pp-lang-switch__option,
.elementor-widget-html .pp-lang-switch button.pp-lang-switch__option:hover,
.elementor-widget-html .pp-lang-switch button.pp-lang-switch__option:focus,
.elementor-widget-html .pp-lang-switch button.pp-lang-switch__option:active {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: var(--pp-lang-blue) !important;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none !important;
  cursor: pointer;
  transition: color var(--pp-lang-dur) ease;
  user-select: none;
  -webkit-text-fill-color: currentColor;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  outline: none !important;
  min-height: 0;
  min-width: 0;
}

.pp-lang-switch button.pp-lang-switch__option--fa {
  font-size: 13px;
}

.pp-lang-switch button.pp-lang-switch__option.is-active,
.pp-lang-switch button.pp-lang-switch__option.is-active:hover,
.pp-lang-switch button.pp-lang-switch__option.is-active:focus,
.pp-lang-switch button.pp-lang-switch__option.is-active:active,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option.is-active,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option.is-active:hover,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option.is-active:focus,
.elementor-widget-shortcode .pp-lang-switch button.pp-lang-switch__option.is-active:active {
  color: var(--pp-lang-white) !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* Tooltip — opens below */
.pp-lang-switch__tip {
  position: absolute;
  z-index: 99999;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 6px 10px;
  border-radius: 6px;
  background: #0b1520;
  color: var(--pp-lang-white);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.pp-lang-switch__tip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #0b1520;
}

.pp-lang-switch:hover .pp-lang-switch__tip,
.pp-lang-switch:focus-within .pp-lang-switch__tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.elementor-widget-shortcode:has(.pp-lang-switch),
.elementor-widget-html:has(.pp-lang-switch) {
  position: relative;
  z-index: 9999;
  overflow: visible;
}
