.wpch-translate {
  --wpch-bg: #ffffff;
  --wpch-text: #1f2937;
  --wpch-muted: #6b7280;
  --wpch-border: rgba(17, 24, 39, .12);
  --wpch-shadow: 0 18px 50px rgba(15, 23, 42, .16), 0 6px 18px rgba(15, 23, 42, .08);
  --wpch-accent: #2563eb;
  position: relative;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  z-index: 99990;
}

.wpch-translate--footer:not(.wpch-translate--inline-footer) {
  position: fixed;
}

.wpch-translate--position-top-left { top: 22px; left: 22px; }
.wpch-translate--position-top-right { top: 22px; right: 22px; }
.wpch-translate--position-bottom-left { bottom: 22px; left: 22px; }
.wpch-translate--position-bottom-right { bottom: 22px; right: 22px; }

.wpch-translate--inline-footer {
  display: block;
  width: max-content;
  margin: 24px auto;
}

.wpch-translate-menu-item {
  position: relative;
}

.wpch-translate__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid var(--wpch-border);
  border-radius: 999px;
  background: var(--wpch-bg);
  color: var(--wpch-text);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.wpch-translate__button:hover,
.wpch-translate.is-open .wpch-translate__button {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
  border-color: rgba(37, 99, 235, .35);
}

.wpch-translate__button-icon,
.wpch-translate__button-icon svg {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: currentColor;
  flex: 0 0 auto;
}

.wpch-translate__button-label {
  font-weight: 650;
}

.wpch-translate__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  max-height: min(360px, 70vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--wpch-border);
  border-radius: 18px;
  background: var(--wpch-bg);
  color: var(--wpch-text);
  box-shadow: var(--wpch-shadow);
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.wpch-translate--position-top-left .wpch-translate__dropdown,
.wpch-translate--position-bottom-left .wpch-translate__dropdown,
.wpch-translate--inline-footer .wpch-translate__dropdown,
.wpch-translate--menu .wpch-translate__dropdown,
.wpch-translate--shortcode .wpch-translate__dropdown {
  left: 0;
  right: auto;
}

.wpch-translate--position-bottom-left .wpch-translate__dropdown,
.wpch-translate--position-bottom-right .wpch-translate__dropdown {
  top: auto;
  bottom: calc(100% + 10px);
  transform: translateY(8px) scale(.98);
}

.wpch-translate.is-open .wpch-translate__dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wpch-translate__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--wpch-text);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: background .15s ease, color .15s ease;
}

.wpch-translate__option:hover,
.wpch-translate__option.is-active {
  background: rgba(37, 99, 235, .09);
  color: var(--wpch-accent);
}

.wpch-translate__option.is-active {
  font-weight: 700;
}

.wpch-translate__option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.wpch-translate__option-icon img,
.wpch-translate__option-icon svg {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

.wpch-translate__emoji {
  font-size: 19px;
  line-height: 1;
}

.wpch-translate--theme-dark {
  --wpch-bg: #111827;
  --wpch-text: #f9fafb;
  --wpch-muted: #cbd5e1;
  --wpch-border: rgba(255, 255, 255, .14);
  --wpch-shadow: 0 18px 50px rgba(0, 0, 0, .32);
}

.wpch-translate--theme-blue {
  --wpch-bg: #1d4ed8;
  --wpch-text: #ffffff;
  --wpch-border: rgba(255, 255, 255, .22);
  --wpch-accent: #bfdbfe;
}
.wpch-translate--theme-blue .wpch-translate__dropdown {
  --wpch-bg: #ffffff;
  --wpch-text: #1f2937;
  --wpch-accent: #1d4ed8;
}

.wpch-translate--theme-glass .wpch-translate__button,
.wpch-translate--theme-glass .wpch-translate__dropdown {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.wpch-translate--theme-minimal .wpch-translate__button {
  box-shadow: none;
  border-radius: 12px;
  padding: 8px 10px;
}

.wpch-translate.has-error .wpch-translate__button {
  border-color: rgba(220, 38, 38, .45);
}

@media (max-width: 768px) {
  .wpch-translate--hide-mobile { display: none; }
  .wpch-translate--footer:not(.wpch-translate--inline-footer) { top: auto; right: auto; bottom: auto; left: auto; }
  .wpch-translate--mobile-top-left { top: 16px !important; left: 16px !important; }
  .wpch-translate--mobile-top-right { top: 16px !important; right: 16px !important; }
  .wpch-translate--mobile-bottom-left { bottom: 16px !important; left: 16px !important; }
  .wpch-translate--mobile-bottom-right { bottom: 16px !important; right: 16px !important; }
  .wpch-translate__button { min-height: 38px; padding: 9px 12px; }
  .wpch-translate__dropdown { width: min(230px, calc(100vw - 32px)); max-height: 55vh; }
}

/* V2.1 text badge icon mode */
.wpch-translate__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .10);
  color: var(--wpch-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
}
