
/* Estilos para el traductor gratuito */
.free-translator {
    position: relative;
    z-index: 1000;
    /* Importante: Asegurarse de que no empuje otros elementos */
    display: inline-flex;
}

.translator-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #d4af37, #f4e4bc);
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    color: #2c2c2c;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    /* Ajustar tamaño para que coincida con otros botones */
    white-space: nowrap;
}

.translator-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #f4e4bc, #d4af37);
}

.translator-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Ajustar header-actions para que distribuya el espacio correctamente */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px !important; /* Reducir gap para ahorrar espacio */
}

/* Asegurar que la barra de búsqueda tenga el tamaño adecuado */
.search-bar {
    flex: 1; /* Que ocupe el espacio disponible */
    margin: 0 10px; /* Asegurar que haya algo de espacio a los lados */
}

/* Evitar que los botones ocupen más espacio del necesario */
.header-actions a, 
.header-actions .free-translator {
    flex: 0 0 auto; /* No crecer ni encoger, mantenerse en su tamaño automático */
}

/* Asegurar que el traductor no rompa el layout */
#translator-overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

#translator-dropdown {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    padding: 10px 0;
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    pointer-events: all;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
}

.language-option:hover {
    background-color: #f9f3e5;
}

.language-option.active {
    background: linear-gradient(135deg, #f4e4bc, #d4af37);
    color: #2c2c2c;
    font-weight: 500;
}

.language-flag {
    width: 20px;
    height: 15px;
    margin-right: 10px;
    border-radius: 2px;
    object-fit: cover;
}

/* Notificación de traducción */
.translation-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #d4af37, #f4e4bc);
    color: #2c2c2c;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.translation-notification.active {
    opacity: 1;
    transform: translateY(0);
}

.notification-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.notification-text {
    font-size: 14px;
    font-weight: 500;
}

.notification-close {
    margin-left: 10px;
    background: none;
    border: none;
    color: #2c2c2c;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* Ocultar elementos de Google Translate */
.goog-te-banner-frame, 
.goog-te-menu-frame,
.goog-te-balloon-frame,
.goog-te-gadget,
#google_translate_element,
.goog-te-banner,
.skiptranslate,
iframe[src*="translate.google.com"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -9999 !important;
    pointer-events: none !important;
}

/* Restaurar el margen superior del body que Google modifica */
body {
    top: 0 !important;
    position: static !important;
}

/* Estilos para pantallas más pequeñas */
@media (max-width: 768px) {
    #translator-dropdown {
        width: 180px;
    }
    
    .translator-button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .translator-icon {
        width: 16px;
        height: 16px;
    }
    
    /* Ajustes específicos para móvil */
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .search-bar {
        order: -1; /* Mover barra de búsqueda al principio en móvil */
        width: 100%;
        margin: 10px 0;
    }
    
    .free-translator,
    .header-actions a {
        margin: 5px;
    }
}
