/* ==========================================================================
   🇱🇰 Ceylon Discovery Holidays - Professional Multi-Language Converter & Scroll Fix
   Top Inbound Tourist Markets to Sri Lanka (UK, India, China, Japan, Europe, Russia, Middle East)
   ========================================================================== */

/* 1. Eliminate CSS Smooth-Scroll & Fixed Background Repaint Conflict with Lenis Smooth Scroller */
html,
html.lenis,
html.lenis-smooth,
html.translated-ltr,
html.translated-rtl {
  scroll-behavior: auto !important;
  height: auto !important;
  min-height: 100% !important;
}

body {
  background-attachment: scroll !important;
}

.lenis.lenis-smooth iframe {
  pointer-events: auto !important;
}

/* 2. Complete Google Translate Default Banner / Tooltip / Frame Suppression */
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.skiptranslate.goog-te-banner-frame,
body > .skiptranslate,
iframe.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-OiiCO,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-spinner-pos {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
}

body {
  top: 0px !important;
  margin-top: 0px !important;
  position: relative !important;
}

.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
}

.goog-text-highlight,
font[ style*="background-color" ] {
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

#google_translate_element {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

/* 3. Desktop Right-Middle Fixed Vertical Translator Widget (Sleek & Compact) */
#cdh-desktop-lang-widget {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: flex;
  align-items: center;
  font-family: 'Plus Jakarta Sans', 'Outfit', 'DM Sans', sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.cdh-lang-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 30px;
  padding: 9px 4px;
  background: linear-gradient(180deg, rgba(10, 18, 42, 0.95) 0%, rgba(18, 31, 74, 0.95) 100%);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 213, 27, 0.42);
  border-right: none;
  border-radius: 10px 0 0 10px;
  box-shadow: -3px 4px 16px rgba(6, 11, 28, 0.32), 0 0 10px rgba(255, 213, 27, 0.12);
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  outline: none;
  margin: 0;
}

.cdh-lang-tab-btn:hover,
.cdh-lang-tab-btn.is-open {
  width: 33px;
  background: linear-gradient(180deg, rgba(15, 27, 64, 0.98) 0%, rgba(26, 44, 108, 0.98) 100%);
  border-color: rgba(255, 213, 27, 0.85);
  box-shadow: -5px 6px 20px rgba(6, 11, 28, 0.45), 0 0 14px rgba(255, 213, 27, 0.25);
}

.cdh-lang-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #ffd51b;
  flex-shrink: 0;
}

.cdh-lang-icon-wrap svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.1;
}

.cdh-lang-current-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 13px;
  border-radius: 2.5px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.cdh-lang-current-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cdh-lang-vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8fafc;
  white-space: nowrap;
  line-height: 1;
  padding: 2px 0;
}

.cdh-lang-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffd51b;
  opacity: 0.85;
  flex-shrink: 0;
}

/* 4. Desktop Language Flyout Card */
.cdh-lang-flyout {
  position: fixed;
  right: 38px;
  top: 50%;
  transform: translateY(-50%) translateX(12px) scale(0.97);
  width: 268px;
  background: rgba(9, 15, 36, 0.97);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255, 213, 27, 0.34);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(4, 8, 22, 0.62), 0 0 18px rgba(255, 213, 27, 0.12);
  padding: 12px;
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9991;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cdh-lang-flyout.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.cdh-lang-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cdh-lang-flyout-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffd51b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cdh-lang-flyout-title svg {
  width: 14px;
  height: 14px;
}

.cdh-lang-flyout-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.18s ease;
  padding: 0;
}

.cdh-lang-flyout-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 213, 27, 0.4);
}

.cdh-lang-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.cdh-lang-list::-webkit-scrollbar {
  width: 4px;
}
.cdh-lang-list::-webkit-scrollbar-thumb {
  background: rgba(255, 213, 27, 0.32);
  border-radius: 4px;
}

.cdh-lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.cdh-lang-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 213, 27, 0.25);
}

.cdh-lang-item.active {
  background: linear-gradient(90deg, rgba(31, 49, 167, 0.55) 0%, rgba(255, 213, 27, 0.16) 100%);
  border-color: rgba(255, 213, 27, 0.52);
}

.cdh-lang-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cdh-lang-item-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.cdh-lang-item-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cdh-lang-item-text {
  display: flex;
  flex-direction: column;
  line-height: 1.22;
  min-width: 0;
}

.cdh-lang-item-native {
  font-size: 12.2px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdh-lang-item.active .cdh-lang-item-native {
  color: #ffd51b;
}

.cdh-lang-item-eng {
  font-size: 10.2px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdh-lang-check {
  color: #ffd51b;
  font-size: 12.5px;
  font-weight: 800;
  flex-shrink: 0;
  margin-left: 6px;
}

/* 5. Mobile Drawer Language Selector (Responsive & Non-Intrusive) */
.cdh-mobile-drawer-lang {
  margin: 8px 0 10px;
  padding: 10px 11px;
  background: linear-gradient(145deg, rgba(31, 49, 167, 0.05) 0%, rgba(15, 23, 42, 0.03) 100%);
  border: 1px solid rgba(31, 49, 167, 0.14);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: 'Plus Jakarta Sans', 'Outfit', 'DM Sans', sans-serif;
}

.cdh-mobile-lang-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cdh-mobile-lang-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #1f31a7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cdh-mobile-lang-label svg {
  width: 13px;
  height: 13px;
}

.cdh-mobile-lang-current {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.cdh-mobile-lang-current .cdh-mini-flag {
  width: 15px;
  height: 11px;
  border-radius: 2px;
  overflow: hidden;
  display: inline-flex;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}

.cdh-mobile-lang-current .cdh-mini-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cdh-mobile-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  max-height: 172px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.cdh-mobile-lang-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
  outline: none;
  min-width: 0;
  font-family: inherit;
}

.cdh-mobile-lang-pill:hover,
.cdh-mobile-lang-pill:active {
  border-color: #1f31a7;
  background: #f4f7ff;
}

.cdh-mobile-lang-pill.active {
  background: linear-gradient(135deg, #1f31a7 0%, #15227a 100%);
  border-color: #1f31a7;
  box-shadow: 0 2px 8px rgba(31, 49, 167, 0.25);
}

.cdh-mobile-lang-pill-flag {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  overflow: hidden;
  display: inline-flex;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.cdh-mobile-lang-pill-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cdh-mobile-lang-pill-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.cdh-mobile-lang-pill-name {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none !important;
}

.cdh-mobile-lang-pill-sub {
  font-size: 9.2px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none !important;
}

.cdh-mobile-lang-pill.active .cdh-mobile-lang-pill-name {
  color: #ffd51b;
}

.cdh-mobile-lang-pill.active .cdh-mobile-lang-pill-sub {
  color: rgba(255, 255, 255, 0.8);
}

/* Hide desktop floating tab on mobile & tablet screens (shown in mobile drawer instead) */
@media (max-width: 1024px) {
  #cdh-desktop-lang-widget {
    display: none !important;
  }
}
