/* Nutresa Multilanguage Plugin Styles */

/* Contenedor principal del selector */
.nml-language-selector {
    display: inline-block;
    position: relative;
}

/* Estilo de banderas */
.nml-flags-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nml-flag-btn {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nml-flag-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.nml-flag-btn.active {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nml-flag-img {
    width: 32px;
    height: 22px;
    display: block;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nml-flag-label {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

/* Estilo de texto */
.nml-text-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nml-text-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nml-text-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.nml-text-btn.active {
    font-weight: 700;
    text-decoration: underline;
}

.nml-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Estilo dropdown */
.nml-dropdown-selector {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #fff;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.nml-dropdown-selector:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.nml-dropdown-selector:focus {
    border-color: #fff;
}

.nml-dropdown-selector option {
    background: #c8102e;
    color: #fff;
    padding: 10px;
}

/* Animación de cambio de idioma */
.nml-translate-content {
    transition: opacity 0.3s ease;
}

.nml-translate-content.changing {
    opacity: 0.5;
}

/* Efecto de carga al cambiar idioma */
body.nml-changing-language {
    cursor: wait;
}

body.nml-changing-language::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    pointer-events: none;
}

/* Indicador de traducción mejorado */
#nml-translating-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.nml-indicator-content {
    background: #fff;
    padding: 30px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    min-width: 250px;
}

.nml-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c8102e;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: nml-spin 1s linear infinite;
}

@keyframes nml-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nml-indicator-text {
    font-size: 18px;
    font-weight: bold;
    color: #c8102e;
    margin-bottom: 15px;
}

.nml-indicator-progress {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.nml-indicator-progress span {
    display: inline-block;
    min-width: 40px;
    font-weight: bold;
    color: #c8102e;
}

/* Fallback para navegadores antiguos */
body.nml-changing-language::after {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .nml-flag-img {
        width: 28px;
        height: 19px;
    }
    
    .nml-text-btn {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .nml-dropdown-selector {
        font-size: 13px;
        padding: 5px 10px;
    }
}

/* Clases de utilidad para ocultar/mostrar según idioma */
.lang-es .nml-hide-es,
.lang-en .nml-hide-en {
    display: none !important;
}

.lang-es .nml-show-es,
.lang-en .nml-show-en {
    display: block;
}

/* Variación para header rojo de Nutresa */
.header-nutresa .nml-flag-btn,
.header-nutresa .nml-text-btn {
    color: #fff;
}

.header-nutresa .nml-flag-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Variación para menú */
.menu-item .nml-language-selector {
    margin: 0;
}

.menu-item .nml-flags-container {
    gap: 8px;
}

.menu-item .nml-flag-btn {
    padding: 2px 6px;
}

.menu-item .nml-flag-img {
    width: 28px;
    height: 19px;
}
