/**
 * CRREM Language Switcher — glass dropdown
 * @package CRREM
 * @since   2.12.0
 */

/* ── Hide Google Translate chrome ── */
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover,
.goog-text-highlight {
  display: none !important;
}
body { top: 0 !important; }
.skiptranslate { display: none !important; }

/* ── Kill Google Translate red/colored text everywhere ── */
font[color],
font[style],
font,
.goog-text-highlight,
span[style*="color"] font,
[data-ogsc] font,
.VIpgJd-ZVi9od-l4eHX-hSRGPd span,
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
[class*="VIpgJd"] {
  color: inherit !important;
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  border: none !important;
}

*:hover > font,
*:hover > font[color],
*:hover > font[style],
font:hover,
*:hover > [class*="VIpgJd"],
a:hover font,
button:hover font,
span:hover > font {
  color: inherit !important;
  background: none !important;
  background-color: transparent !important;
}

/* Also target the translated text wrapper Google injects */
.translated-ltr font,
.translated-rtl font {
  color: inherit !important;
  background: transparent !important;
}

/* ── Keep header on one line ── */
.crrem-header-inner .e-con-inner {
  flex-wrap: nowrap !important;
}

/* ── Container ── */
.crrem-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0;
  font-family: 'Lexend Deca', sans-serif;
  z-index: 1001;
}

/* ── Trigger: subtle 2-letter code + chevron ── */
.crrem-lang-trigger {
  background: none !important;
  border: none !important;
  padding: 6px 2px;
  color: rgba(255, 255, 255, 0.35) !important;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.crrem-lang-chevron {
  opacity: 0.7;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.crrem-lang-trigger[aria-expanded="true"] .crrem-lang-chevron {
  transform: rotate(180deg);
}

.crrem-lang-trigger:hover,
.crrem-lang-trigger:focus-visible {
  color: rgba(255, 255, 255, 0.6) !important;
  background: none !important;
}

/* ── Glass dropdown ── */
.crrem-lang-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: -8px;
  width: 190px;
  max-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.04);
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.25s ease, opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  padding: 0;
}

.crrem-lang-panel.is-open {
  max-height: 340px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Search ── */
.crrem-lang-panel .crrem-lang-search {
  display: block !important;
  width: 100% !important;
  padding: 10px 14px !important;
  border: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  background: transparent !important;
  color: var(--slate-blue, #213338) !important;
  font-family: 'Lexend Deca', sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  outline: none;
  box-sizing: border-box;
  margin: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.crrem-lang-panel .crrem-lang-search::placeholder {
  color: rgba(0, 0, 0, 0.3) !important;
}

/* ── List ── */
.crrem-lang-panel .crrem-lang-list {
  max-height: 245px;
  overflow-y: auto;
  padding: 4px !important;
  margin: 0 !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.crrem-lang-list::-webkit-scrollbar { width: 3px; }
.crrem-lang-list::-webkit-scrollbar-track { background: transparent; }
.crrem-lang-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

/* ── Option ── */
.crrem-lang-panel .crrem-lang-option {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  padding: 5px 8px !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  color: var(--dark-evergreen, #174A3B) !important;
  font-family: 'Lexend Deca', sans-serif !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-shadow: none !important;
  cursor: pointer;
  text-align: left !important;
  border-radius: 8px !important;
  transition: background 0.12s;
  box-sizing: border-box;
  min-height: 0 !important;
  box-shadow: none !important;
}

.crrem-lang-panel .crrem-lang-option:hover {
  background: rgba(23, 74, 59, 0.07) !important;
  color: var(--fern-green, #4A7C59) !important;
}

.crrem-lang-panel .crrem-lang-option:hover * {
  color: inherit !important;
}

.crrem-lang-panel .crrem-lang-option:hover .crrem-lang-option-code {
  color: var(--fern-green, #4A7C59) !important;
  opacity: 0.6;
}

.crrem-lang-panel .crrem-lang-option.is-active {
  color: var(--dark-evergreen, #174A3B) !important;
  font-weight: 500 !important;
  background: rgba(23, 74, 59, 0.05) !important;
}

.crrem-lang-panel .crrem-lang-option-code {
  display: inline-block !important;
  width: 20px !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
  color: rgba(0, 0, 0, 0.3) !important;
  flex-shrink: 0 !important;
  text-transform: uppercase !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.crrem-lang-panel .crrem-lang-option.is-active .crrem-lang-option-code {
  color: var(--dark-evergreen, #174A3B) !important;
}

/* ── Disclaimer ── */
.crrem-lang-panel .crrem-lang-disc {
  padding: 6px 14px 8px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
  font-size: 9px !important;
  font-weight: 400 !important;
  color: rgba(0, 0, 0, 0.25) !important;
  text-align: center !important;
  margin: 0 !important;
}

/* ── Mobile ── */
@media (max-width: 1024px) {
  .crrem-lang { margin-left: 8px; }
}

@media (max-width: 768px) {
  .crrem-lang-trigger { font-size: 11px; padding: 8px 2px; }
  .crrem-lang-panel { right: -4px; }
}

@media (max-width: 480px) {
  .crrem-lang-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 0;
  }
  .crrem-lang-panel.is-open { max-height: 55vh; }
  .crrem-lang-list { max-height: 42vh; }
}
