/* ===== LINGUASWITCH ===== */
:root { --ls-color: #667eea; }

#ls-widget {
  position: fixed;
  z-index: 99999;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* Posiciones */
#ls-widget.ls-bottom-right { bottom: 28px; right: 28px; }
#ls-widget.ls-bottom-left  { bottom: 28px; left:  28px; }
#ls-widget.ls-top-right    { top: 28px;    right: 28px; }
#ls-widget.ls-top-left     { top: 28px;    left:  28px; }

/* Botón principal */
#ls-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ls-color);
  background: linear-gradient(135deg, var(--ls-color), #764ba2);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: .92em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(102,126,234,.45);
  transition: all .3s;
  white-space: nowrap;
}
#ls-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(102,126,234,.55);
}
#ls-toggle .ls-chevron {
  font-size: .8em;
  transition: transform .3s;
  opacity: .8;
}
#ls-widget.open #ls-toggle .ls-chevron { transform: rotate(180deg); }

/* Panel */
#ls-panel {
  display: none;
  position: absolute;
  bottom: 60px; right: 0;
  width: 280px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
  animation: lsIn .25s ease;
  border: 1px solid rgba(102,126,234,.15);
}
.ls-bottom-left  #ls-panel { right: auto; left: 0; }
.ls-top-right    #ls-panel { bottom: auto; top: 60px; }
.ls-top-left     #ls-panel { bottom: auto; top: 60px; right: auto; left: 0; }
#ls-widget.open  #ls-panel { display: block; }

@keyframes lsIn {
  from { opacity:0; transform: translateY(10px) scale(.97); }
  to   { opacity:1; transform: translateY(0)    scale(1);   }
}

/* Header panel */
.ls-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 12px;
  background: linear-gradient(135deg, var(--ls-color), #764ba2);
  color: #fff;
  font-weight: 700;
  font-size: .9em;
}
.ls-close {
  background: rgba(255,255,255,.2);
  border: none; color: #fff;
  width: 26px; height: 26px;
  border-radius: 50%; cursor: pointer;
  font-size: .85em; transition: background .2s;
}
.ls-close:hover { background: rgba(255,255,255,.35); }

/* Buscador */
.ls-search-wrap { padding: 12px 14px 8px; }
#ls-search {
  width: 100%;
  padding: 9px 14px;
  border: 2px solid #eee;
  border-radius: 50px;
  font-size: .85em;
  outline: none;
  transition: border .2s;
  box-sizing: border-box;
}
#ls-search:focus { border-color: var(--ls-color); }

/* Lista idiomas */
.ls-lang-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
.ls-lang-list::-webkit-scrollbar { width: 4px; }
.ls-lang-list::-webkit-scrollbar-track { background: #f1f1f1; }
.ls-lang-list::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 4px; }

.ls-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all .2s;
  font-size: .9em;
  color: #2c3e50;
}
.ls-lang-item:hover {
  background: #eef2ff;
  color: var(--ls-color);
}
.ls-lang-item.active {
  background: linear-gradient(135deg, var(--ls-color), #764ba2);
  color: #fff;
  font-weight: 700;
}
.ls-original { border-bottom: 1px solid #f0f0f0; margin-bottom: 4px; }
.ls-flag { font-size: 1.4em; }
.ls-lname { flex: 1; font-weight: 500; }
.ls-badge {
  background: #e0e7ff;
  color: var(--ls-color);
  padding: 2px 8px;
  border-radius: 50px;
  font-size: .72em;
  font-weight: 700;
}
.ls-lang-item.active .ls-badge {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.ls-hidden { display: none !important; }

/* Footer note */
.ls-footer-note {
  padding: 8px 16px 12px;
  font-size: .72em;
  color: #aaa;
  text-align: center;
  border-top: 1px solid #f0f0f0;
}
.ls-footer-note a { color: var(--ls-color); text-decoration: none; }

/* Loader */
#ls-loader {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 28px;
  background: #fff;
  border-radius: 50px;
  padding: 10px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  align-items: center;
  gap: 10px;
  font-size: .85em;
  font-weight: 600;
  color: #667eea;
  z-index: 99998;
  border: 2px solid #eef2ff;
}
#ls-loader.show { display: flex; }
.ls-spin {
  width: 18px; height: 18px;
  border: 3px solid #eee;
  border-top-color: var(--ls-color);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Banner traducido */
#ls-translated-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(135deg, var(--ls-color), #764ba2);
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  font-size: .88em;
  font-weight: 600;
  z-index: 99997;
  animation: slideDown .3s ease;
}
#ls-translated-banner.show { display: block; }
@keyframes slideDown { from{transform:translateY(-100%)} to{transform:translateY(0)} }
#ls-banner-text { display: inline; }
#ls-banner-close {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.2);
  border: none; color: #fff;
  width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer;
  font-size: .8em;
}

@media(max-width:480px){
  #ls-widget.ls-bottom-right, #ls-widget.ls-bottom-left { bottom:16px; right:16px; left:auto; }
  #ls-panel { width: 260px; }
  #ls-toggle span:nth-child(2) { display:none; }
}
