/* ════════════════════════════════════════════════════
   WP Translate Master — Language Switcher Styles
   All display modes: dropdown, list, flags, inline
   ════════════════════════════════════════════════════ */

/* ── Common ────────────────────────────────────────── */
.wptm-switcher { font-family: inherit; }
.wptm-flag { display: inline-block; line-height: 1; }
.wptm-flag-lg { font-size: 22px; }
.wptm-lang-name { display: inline-block; }
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ── Vertical layout modifier ──────────────────────── */
.wptm-vertical { flex-direction: column !important; align-items: flex-start !important; }

/* ════════════════════════════════════════════════════
   DROPDOWN
   ════════════════════════════════════════════════════ */
.wptm-switcher--dropdown {
  position: relative;
  display: inline-block;
}

.wptm-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  white-space: nowrap;
}
.wptm-switcher__toggle:hover,
.wptm-switcher--dropdown.open .wptm-switcher__toggle {
  border-color: #5C6AC4;
  box-shadow: 0 0 0 3px rgba(92,106,196,.12);
}
.wptm-switcher__toggle:focus-visible {
  outline: 2px solid #5C6AC4;
  outline-offset: 2px;
}

.wptm-chevron {
  margin-left: 2px;
  transition: transform .2s ease;
  flex-shrink: 0;
  opacity: .6;
}
.wptm-switcher--dropdown.open .wptm-chevron,
.wptm-switcher--dropdown:focus-within .wptm-chevron {
  transform: rotate(180deg);
}

.wptm-switcher__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 6px;
  z-index: 99999;
}
/* Open via JS class or :focus-within */
.wptm-switcher--dropdown.open .wptm-switcher__dropdown,
.wptm-switcher--dropdown:focus-within .wptm-switcher__dropdown {
  display: block;
  animation: wptm-dropdown-in .12s ease;
}
@keyframes wptm-dropdown-in {
  from { opacity:0; transform: translateY(-4px); }
  to   { opacity:1; transform: none; }
}

/* Align dropdown to the right when near viewport edge */
.wptm-switcher--dropdown.wptm-align-right .wptm-switcher__dropdown {
  left: auto;
  right: 0;
}

.wptm-switcher__item { list-style: none; }
.wptm-switcher__item a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.wptm-switcher__item a:hover {
  background: #F3F4F6;
  color: #1F2937;
}
.wptm-switcher__item--active a {
  background: rgba(92,106,196,.1);
  color: #5C6AC4;
  font-weight: 600;
}
.wptm-check {
  margin-left: auto;
  color: #2ECC71;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════
   LIST
   ════════════════════════════════════════════════════ */
.wptm-switcher--list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wptm-switcher__list-item a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  border-radius: 5px;
  transition: color .15s;
}
.wptm-switcher__list-item a:hover { color: #5C6AC4; }
.wptm-switcher__list-item.wptm-current-lang a {
  font-weight: 700;
  color: #5C6AC4;
}

/* ════════════════════════════════════════════════════
   FLAGS
   ════════════════════════════════════════════════════ */
.wptm-switcher--flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wptm-flag-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: .5;
  transition: opacity .15s, transform .15s;
  font-size: 24px;
  border-radius: 4px;
  padding: 2px;
}
.wptm-flag-link:hover { opacity: .85; transform: scale(1.15); }
.wptm-flag-link--active { opacity: 1; }
.wptm-flag-link--active:after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: #5C6AC4;
  border-radius: 1px;
  position: absolute;
  bottom: -3px;
  left: 0;
}
.wptm-flag-link { position: relative; }

/* ════════════════════════════════════════════════════
   INLINE ( ES | EN | FR )
   ════════════════════════════════════════════════════ */
.wptm-switcher--inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.wptm-inline-lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s;
  white-space: nowrap;
}
.wptm-inline-lang:hover { color: #5C6AC4; }
.wptm-inline-lang--active { font-weight: 700; color: #5C6AC4; }

.wptm-sep {
  color: #D1D5DB;
  font-weight: 300;
  user-select: none;
}

/* ════════════════════════════════════════════════════
   NAV MENU integration
   ════════════════════════════════════════════════════ */
.wptm-nav-switcher { list-style: none; }
.wptm-nav-switcher > .wptm-switcher--dropdown { display: block; }

/* Align dropdown up when in footer menus */
.wptm-nav-switcher.wptm-menu-up .wptm-switcher__dropdown {
  top: auto;
  bottom: calc(100% + 5px);
}

/* ════════════════════════════════════════════════════
   Elementor integration extras
   ════════════════════════════════════════════════════ */
.elementor-widget-wptm_language_switcher .wptm-switcher--dropdown { display: inline-block; }

/* In-menu style when placed inside a nav */
.wptm-in-nav.wptm-switcher--dropdown .wptm-switcher__toggle {
  background: transparent;
  border-color: transparent;
  padding: 4px 8px;
}
.wptm-in-nav.wptm-switcher--dropdown .wptm-switcher__toggle:hover {
  background: rgba(0,0,0,.05);
  border-color: transparent;
  box-shadow: none;
}

