/* ═══════════════════════════════════════════════════════════
   Exely Auto-Translate Widget Styles
   Подключить перед </head> или в конец header.php:
   <link rel="stylesheet" href="/local/js/exely-translate.css">
   ═══════════════════════════════════════════════════════════ */

/* ── Контейнер виджета ────────────────────────────────────── */
#exely-lang-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Кнопка-триггер ───────────────────────────────────────── */
.exely-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 100px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  transition: box-shadow 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.exely-lang-btn:hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.exely-flag {
  font-size: 18px;
  line-height: 1;
}
.exely-code {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.exely-chevron {
  font-size: 14px;
  color: #9ca3af;
  transform: rotate(90deg);
  display: inline-block;
  margin-left: 2px;
}

/* ── Попап ────────────────────────────────────────────────── */
.exely-lang-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}
.exely-lang-popup.exely-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.exely-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}
.exely-popup-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.exely-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #9ca3af;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}
.exely-popup-close:hover {
  color: #374151;
}

.exely-popup-body {
  padding: 16px 20px 20px;
}

.exely-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.exely-select-wrap {
  position: relative;
  margin-bottom: 14px;
}
.exely-select-wrap select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.exely-select-wrap select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.exely-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca3af;
  font-size: 12px;
}

.exely-hint {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Прогресс-бар ─────────────────────────────────────────── */
.exely-progress-wrap {
  margin-bottom: 12px;
}
.exely-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 6px;
}
.exely-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 100px;
  transition: width 0.3s ease;
  width: 0%;
}
.exely-progress-text {
  font-size: 12px;
  color: #6b7280;
}

/* ── Кнопка "Применить" ───────────────────────────────────── */
.exely-apply-btn {
  width: 100%;
  padding: 11px;
  background: #1f2937;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.exely-apply-btn:hover {
  background: #374151;
}

/* ── Баннер автоопределения языка ─────────────────────────── */
#exely-detected-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
  padding: 12px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #0c4a6e;
}
.exely-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.exely-banner-inner span {
  flex: 1;
  min-width: 200px;
}
.exely-banner-yes {
  padding: 7px 16px;
  background: #0284c7;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.exely-banner-yes:hover {
  background: #0369a1;
}
.exely-banner-no {
  padding: 7px 12px;
  background: transparent;
  color: #0284c7;
  border: none;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.exely-banner-no:hover {
  text-decoration: underline;
}

/* ── RTL поддержка ────────────────────────────────────────── */
[dir="rtl"] #exely-lang-widget {
  right: auto;
  left: 24px;
}
[dir="rtl"] .exely-lang-popup {
  right: auto;
  left: 0;
}

/* ── Мобильная адаптация ──────────────────────────────────── */
@media (max-width: 480px) {
  #exely-lang-widget {
    bottom: 16px;
    right: 16px;
  }
  .exely-lang-popup {
    width: calc(100vw - 32px);
    right: 0;
  }
  .exely-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
