/**
 * Estilos del widget flotante de selector de idiomas (A2M Traducciones).
 *
 * Modificadores del contenedor (los fija atr_render_widget según la
 * personalización): a2m-position-*, a2m-theme-*, a2m-size-*, a2m-shape-*.
 * Sin FontAwesome: el botón muestra el código del idioma y/o su bandera.
 */

.a2m-lang-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* MODIFICADORES DE POSICIÓN */
.a2m-lang-container.a2m-position-bottom-left {
    bottom: 20px;
    left: 20px;
}
.a2m-lang-container.a2m-position-bottom-right {
    bottom: 20px;
    right: 20px;
}
.a2m-lang-container.a2m-position-bottom-right .a2m-lang-dropdown-menu {
    left: auto;
    right: 0;
}
.a2m-lang-container.a2m-position-top-left {
    top: 20px;
    left: 20px;
}
.a2m-lang-container.a2m-position-top-left .a2m-lang-dropdown-menu {
    bottom: auto;
    top: calc(100% + 14px);
    animation: a2mSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.a2m-lang-container.a2m-position-top-right {
    top: 20px;
    right: 20px;
}
.a2m-lang-container.a2m-position-top-right .a2m-lang-dropdown-menu {
    bottom: auto;
    top: calc(100% + 14px);
    left: auto;
    right: 0;
    animation: a2mSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes a2mSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Botón flotante */
.a2m-lang-launcher-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    outline: none;
}

/* TAMAÑOS */
.a2m-size-small .a2m-lang-launcher-btn {
    width: 44px;
    height: 44px;
}
.a2m-size-small .a2m-lang-launcher-code {
    font-size: 14px;
}
.a2m-size-small .a2m-lang-launcher-flag {
    font-size: 16px;
}
.a2m-size-small img.a2m-lang-launcher-flag {
    width: 20px;
}
.a2m-size-large .a2m-lang-launcher-btn {
    width: 68px;
    height: 68px;
}
.a2m-size-large .a2m-lang-launcher-code {
    font-size: 22px;
}
.a2m-size-large .a2m-lang-launcher-flag {
    font-size: 26px;
}
.a2m-size-large img.a2m-lang-launcher-flag {
    width: 30px;
}

/* FORMAS */
.a2m-shape-rounded .a2m-lang-launcher-btn {
    border-radius: 16px;
}
.a2m-shape-square .a2m-lang-launcher-btn {
    border-radius: 6px;
}

/* TEMAS DEL GLOBO */
.a2m-theme-default .a2m-lang-launcher-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    color: #fff;
}
.a2m-theme-default .a2m-lang-launcher-btn:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.55);
}

.a2m-theme-dark .a2m-lang-launcher-btn {
    background: #1e293b;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.4);
    color: #fff;
}
.a2m-theme-dark .a2m-lang-launcher-btn:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.55);
}

.a2m-theme-glass .a2m-lang-launcher-btn {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    color: #0f172a;
}
.a2m-theme-glass .a2m-lang-launcher-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.a2m-theme-glass .a2m-lang-launcher-badge {
    background: #f1f5f9;
    color: #0f172a;
    border-color: rgba(226, 232, 240, 0.8);
}

.a2m-lang-launcher-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.55);
}

.a2m-lang-launcher-btn:active {
    transform: scale(0.95);
}

/* Contenido del botón: código del idioma (por defecto, claro y legible) */
.a2m-lang-launcher-code {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
}

/* Contenido del botón: bandera (SVG self-hosted; el font-size solo aplica
   al emoji de fallback) */
.a2m-lang-launcher-flag {
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s ease;
}
img.a2m-lang-launcher-flag {
    width: 24px;
    height: auto;
    display: block;
}

/* Bandera + código: chip pequeño con el código en la esquina */
.a2m-lang-launcher-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #1e293b;
    border-radius: 8px;
    padding: 2px 5px;
    line-height: 1;
    border: 1.5px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
}

/* Dropdown Menu (anclado al tamaño real del botón) */
.a2m-lang-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    width: 240px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: a2mSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes a2mSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.a2m-lang-header {
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.a2m-lang-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.a2m-lang-list li {
    display: block;
    margin: 0;
    padding: 0;
}

.a2m-lang-option {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    color: #334155;
    font-size: 14px;
    text-align: left;
    font-family: inherit;
}

.a2m-lang-list li:hover .a2m-lang-option {
    background: #f1f5f9;
    color: #0f172a;
}

.a2m-lang-list li.active .a2m-lang-option {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
}

/* Chip con el código en cada fila — "EN English" */
.a2m-lang-code {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 3px 6px;
    line-height: 1;
    min-width: 26px;
    text-align: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.a2m-lang-list li.active .a2m-lang-code {
    background: #bae6fd;
    border-color: #7dd3fc;
    color: #075985;
}

.a2m-lang-flag {
    font-size: 18px;
    display: inline-block;
    line-height: 1;
    flex-shrink: 0;
}
img.a2m-lang-flag {
    width: 20px;
    height: auto;
}

.a2m-lang-name {
    flex-grow: 1;
}

/* Personalizar barra de scroll del dropdown */
.a2m-lang-list::-webkit-scrollbar {
    width: 6px;
}
.a2m-lang-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.a2m-lang-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.a2m-lang-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
