.ufl-floating-bar {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ufl-item {
  --bg: #222;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.06)), var(--bg);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
  text-decoration: none !important;
  color: #fff !important;
  position: relative;
  overflow: visible;
  transition: transform .25s ease, box-shadow .25s ease, border-radius .25s ease;
  backdrop-filter: blur(8px);
}

.ufl-item:hover {
  transform: translateX(-8px) scale(1.05);
  box-shadow: 0 16px 32px rgba(0,0,0,.22);
  border-radius: 20px;
}

.ufl-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ufl-icon svg { width: 24px; height: 24px; display:block; }

.ufl-tooltip {
  position: absolute;
  right: 66px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #111827;
  color: #fff;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}

.ufl-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #111827;
}

.ufl-item:hover .ufl-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.ufl-chatbot { --bg: #5b5cf0; }
.ufl-whatsapp { --bg: #25D366; }
.ufl-instagram { --bg: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.ufl-youtube { --bg: #FF0000; }
.ufl-tiktok { --bg: #111111; }
.ufl-facebook { --bg: #1877F2; }

@media (max-width: 767px) {
  .ufl-floating-bar {
    right: 12px;
    top: auto;
    bottom: 144px; /* v1.4.3: mobilde bir buton bloğu yukarı */
    transform: none;
    gap: 8px;
  }
  .ufl-item {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
  .ufl-tooltip {
    display: none;
  }
}

.ufl-floating-bar button.ufl-item {
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}


/* Entegrasyon açıkken eski bağımsız chatbot düğmesi ilk yüklemeden itibaren gizlidir. */
body.ufl-assistant-integration #wba-assistant .wba-assistant-toggle {
  display: none !important;
}

.ufl-chatbot .ufl-icon {
  width: 40px;
  height: 40px;
}

.ufl-chatbot-logo-wrap {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #6fd3ff 0%, #2e8fff 52%, #1a63f0 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 6px 14px rgba(11, 80, 190, .22);
}

.ufl-chatbot-logo {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.12));
}

@media (max-width: 767px) {
  .ufl-chatbot .ufl-icon {
    width: 36px;
    height: 36px;
  }
  .ufl-chatbot-logo-wrap {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .ufl-chatbot-logo {
    width: 31px;
    height: 31px;
  }
}


/* v1.2.2 - tema buton stillerini ezerek chatbot ikonunu diğerleriyle aynı kart yap */
.ufl-floating-bar button.ufl-item.ufl-chatbot,
.ufl-floating-bar .ufl-item.ufl-chatbot {
  background: linear-gradient(135deg, #59c8ff 0%, #278cff 48%, #1766e8 100%) !important;
  border-radius: 18px !important;
  border: 0 !important;
  box-shadow: 0 12px 28px rgba(23,102,232,.28) !important;
  overflow: visible !important;
}

.ufl-floating-bar button.ufl-item.ufl-chatbot:hover,
.ufl-floating-bar .ufl-item.ufl-chatbot:hover {
  border-radius: 20px !important;
  background: linear-gradient(135deg, #6ed1ff 0%, #3698ff 48%, #1c70f5 100%) !important;
}

.ufl-floating-bar .ufl-chatbot-logo-wrap {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 12px !important;
}

.ufl-floating-bar .ufl-chatbot-logo {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
}

@media (max-width: 767px) {
  .ufl-floating-bar button.ufl-item.ufl-chatbot,
  .ufl-floating-bar .ufl-item.ufl-chatbot {
    border-radius: 16px !important;
  }
  .ufl-floating-bar .ufl-chatbot-logo {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
  }
}


/* v1.3.0 - GTranslate entegrasyonu */
.ufl-gtranslate { --bg: linear-gradient(135deg, #7c4dff 0%, #4f46e5 48%, #2563eb 100%); }

.ufl-gtranslate-panel {
  position: fixed;
  right: 84px;
  top: 50%;
  transform: translateY(-50%) translateX(12px);
  z-index: 99998;
  min-width: 230px;
  max-width: 320px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 50px rgba(15,23,42,.22);
  border: 1px solid rgba(148,163,184,.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.ufl-gtranslate-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.ufl-gtranslate-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.ufl-gtranslate-widget {
  position: relative;
  z-index: 1;
}

.ufl-gtranslate-widget .gtranslate_wrapper,
.ufl-gtranslate-widget .gt_float_switcher,
.ufl-gtranslate-widget .switcher,
.ufl-gtranslate-widget select {
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  max-width: 100% !important;
}

/* GTranslate'ın eski sol-alt floating kutusunu kapat, panel içindekine dokunma. */
body.ufl-gtranslate-integration > .gt_float_switcher,
body.ufl-gtranslate-integration > .gt_switcher_wrapper,
body.ufl-gtranslate-integration > #gt_float_wrapper,
body.ufl-gtranslate-integration .gt_float_switcher.ufl-original-gtranslate,
body.ufl-gtranslate-integration .gt_switcher_wrapper.ufl-original-gtranslate {
  display: none !important;
}

@media (max-width: 767px) {
  .ufl-gtranslate-panel {
    right: 70px;
    top: auto;
    bottom: 88px;
    transform: translateX(12px);
    min-width: 210px;
    max-width: calc(100vw - 96px);
  }
  .ufl-gtranslate-panel.is-open {
    transform: translateX(0);
  }
}

/* v1.4.0 - Dil seçici görünüm iyileştirmeleri */
/* Tüm floating kutular aynı köşe formunda kalsın. Tema button stillerini de ezer. */
.ufl-floating-bar .ufl-item,
.ufl-floating-bar a.ufl-item,
.ufl-floating-bar button.ufl-item {
  border-radius: 16px !important;
  overflow: visible !important;
}

.ufl-floating-bar .ufl-item:hover,
.ufl-floating-bar a.ufl-item:hover,
.ufl-floating-bar button.ufl-item:hover {
  border-radius: 16px !important;
}

/* Dil butonu: bunun bir dil seçimi olduğu ilk bakışta anlaşılsın. */
.ufl-floating-bar button.ufl-item.ufl-gtranslate {
  background: linear-gradient(135deg, #7c4dff 0%, #5b50ea 48%, #345ee8 100%) !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: 0 12px 28px rgba(79,70,229,.28) !important;
}

.ufl-gtranslate .ufl-icon {
  width: 44px;
  height: 44px;
}

.ufl-language-icon {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #fff;
  line-height: 1;
}

.ufl-language-icon svg {
  width: 22px !important;
  height: 22px !important;
}

.ufl-language-icon-label {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .5px;
  color: #fff;
}

/* Açılan dil panelini daha okunaklı, daha geniş ve tutarlı yap. */
.ufl-gtranslate-panel {
  right: 86px;
  min-width: 310px;
  width: 310px;
  max-width: min(360px, calc(100vw - 120px));
  padding: 18px;
  border-radius: 16px !important;
  overflow: visible;
  background: #fff;
  border: 1px solid rgba(148,163,184,.28);
  box-shadow: 0 20px 55px rgba(15,23,42,.24);
}

.ufl-gtranslate-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0 2px 12px;
  border-bottom: 1px solid #e7eaf0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
  color: #111827;
}

.ufl-gtranslate-panel-title svg {
  width: 22px;
  height: 22px;
  color: #4f46e5;
  flex: 0 0 auto;
}

.ufl-gtranslate-widget {
  width: 100%;
  min-width: 0;
}

/* GTranslate'ın floating switcher'ını panel içinde normal bir liste gibi göster. */
.ufl-gtranslate-widget .gt_float_switcher,
.ufl-gtranslate-widget .gt_switcher_wrapper,
.ufl-gtranslate-widget .switcher {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  float: none !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: visible !important;
  font-family: inherit !important;
}

.ufl-gtranslate-widget .gt-selected,
.ufl-gtranslate-widget .gt-current-lang,
.ufl-gtranslate-widget .selected {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
}

.ufl-gtranslate-widget .gt-selected,
.ufl-gtranslate-widget .gt-current-lang {
  background: #f6f7fb !important;
  border: 1px solid #e2e6ef !important;
}

.ufl-gtranslate-widget .gt-current-lang,
.ufl-gtranslate-widget .gt-selected a,
.ufl-gtranslate-widget .selected a {
  min-height: 48px !important;
  padding: 10px 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #111827 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.ufl-gtranslate-widget .gt_options,
.ufl-gtranslate-widget .option,
.ufl-gtranslate-widget .switcher .option {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  max-height: 330px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin-top: 8px !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  border: 1px solid #e2e6ef !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.ufl-gtranslate-widget .gt_options a,
.ufl-gtranslate-widget .option a,
.ufl-gtranslate-widget .switcher .option a {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 46px !important;
  padding: 9px 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  box-sizing: border-box !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #1f2937 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  white-space: normal !important;
  overflow: visible !important;
}

.ufl-gtranslate-widget .gt_options a:hover,
.ufl-gtranslate-widget .option a:hover,
.ufl-gtranslate-widget .switcher .option a:hover {
  background: #f1f4ff !important;
  color: #3730a3 !important;
}

.ufl-gtranslate-widget img,
.ufl-gtranslate-widget .gt_options img,
.ufl-gtranslate-widget .gt-current-lang img {
  width: 28px !important;
  height: 20px !important;
  min-width: 28px !important;
  object-fit: cover !important;
  border-radius: 3px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

.ufl-gtranslate-widget .gt-lang-code,
.ufl-gtranslate-widget .gt-current-lang span,
.ufl-gtranslate-widget .gt_options a span {
  font-size: 16px !important;
  line-height: 1.25 !important;
}

/* Select tipi GTranslate kullanılıyorsa onu da okunaklı tut. */
.ufl-gtranslate-widget select {
  width: 100% !important;
  min-height: 48px !important;
  padding: 8px 12px !important;
  border: 1px solid #dfe3eb !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #111827 !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
}

@media (max-width: 767px) {
  .ufl-floating-bar .ufl-item,
  .ufl-floating-bar a.ufl-item,
  .ufl-floating-bar button.ufl-item {
    border-radius: 14px !important;
  }

  .ufl-gtranslate .ufl-icon,
  .ufl-language-icon {
    width: 40px;
    height: 40px;
  }

  .ufl-language-icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  .ufl-language-icon-label {
    font-size: 8px;
  }

  .ufl-gtranslate-panel {
    right: 68px;
    bottom: 88px;
    width: min(300px, calc(100vw - 92px));
    min-width: 0;
    max-width: calc(100vw - 92px);
    padding: 14px;
    border-radius: 14px !important;
  }

  .ufl-gtranslate-panel-title {
    font-size: 16px;
  }

  .ufl-gtranslate-widget .gt_options a,
  .ufl-gtranslate-widget .option a,
  .ufl-gtranslate-widget .switcher .option a,
  .ufl-gtranslate-widget .gt-current-lang,
  .ufl-gtranslate-widget .gt-selected a,
  .ufl-gtranslate-widget select {
    font-size: 15px !important;
  }
}

/* v1.4.1 - Seçili dili doğrudan floating butonda göster */
.ufl-floating-bar button.ufl-item.ufl-gtranslate {
  border-radius: 16px !important;
  overflow: visible !important;
}

.ufl-language-current {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1;
  color: #fff;
  border-radius: inherit;
}

.ufl-language-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 23px;
  font-size: 21px;
  line-height: 1;
}

.ufl-language-flag img {
  width: 27px !important;
  height: 19px !important;
  object-fit: cover !important;
  border-radius: 3px !important;
  display: block !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35);
}

.ufl-language-code {
  display: block;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .7px;
  color: #fff;
}

/* GTranslate panelindeki tüm ana kutular aynı köşe diliyle. */
.ufl-gtranslate-panel,
.ufl-gtranslate-widget .gt_float_switcher,
.ufl-gtranslate-widget .gt_switcher_wrapper,
.ufl-gtranslate-widget .switcher,
.ufl-gtranslate-widget .gt-selected,
.ufl-gtranslate-widget .gt-current-lang,
.ufl-gtranslate-widget .selected,
.ufl-gtranslate-widget .gt_options,
.ufl-gtranslate-widget .option,
.ufl-gtranslate-widget select {
  border-radius: 16px !important;
}

.ufl-gtranslate-widget .gt_options a,
.ufl-gtranslate-widget .option a,
.ufl-gtranslate-widget .switcher .option a {
  border-radius: 12px !important;
}

@media (max-width: 767px) {
  .ufl-floating-bar button.ufl-item.ufl-gtranslate {
    border-radius: 14px !important;
  }

  .ufl-language-flag {
    height: 21px;
    font-size: 19px;
  }

  .ufl-language-flag img {
    width: 25px !important;
    height: 17px !important;
  }

  .ufl-language-code {
    font-size: 9px;
  }

  .ufl-gtranslate-panel,
  .ufl-gtranslate-widget .gt_float_switcher,
  .ufl-gtranslate-widget .gt_switcher_wrapper,
  .ufl-gtranslate-widget .switcher,
  .ufl-gtranslate-widget .gt-selected,
  .ufl-gtranslate-widget .gt-current-lang,
  .ufl-gtranslate-widget .selected,
  .ufl-gtranslate-widget .gt_options,
  .ufl-gtranslate-widget .option,
  .ufl-gtranslate-widget select {
    border-radius: 14px !important;
  }
}


/* v1.4.2 - performans ve köşe tutarlılığı düzeltmesi */
.ufl-floating-bar button.ufl-item.ufl-chatbot:hover,
.ufl-floating-bar .ufl-item.ufl-chatbot:hover,
.ufl-floating-bar .ufl-item:hover,
.ufl-floating-bar a.ufl-item:hover,
.ufl-floating-bar button.ufl-item:hover {
  border-radius: 16px !important;
}

@media (max-width: 767px) {
  .ufl-floating-bar button.ufl-item.ufl-chatbot:hover,
  .ufl-floating-bar .ufl-item.ufl-chatbot:hover,
  .ufl-floating-bar .ufl-item:hover,
  .ufl-floating-bar a.ufl-item:hover,
  .ufl-floating-bar button.ufl-item:hover {
    border-radius: 14px !important;
  }
}
